#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(int *);
int /*<<< orphan*/ insere_vetor(int, int *);
int lista4_08b(int, int *, int *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char *argv[]) {
  int tamanho, i;
  int *vetor1, *vetor2;
  scanf("%d", &tamanho);
  printf("Tamanho do vetor  =   %d \n", tamanho);
  vetor1 = (int *)malloc(tamanho * sizeof(int *));
  vetor2 = (int *)malloc(tamanho * sizeof(int *));
  insere_vetor(tamanho, vetor1);
  insere_vetor(tamanho, vetor2);
  printf("O produto escalar dos vetores é = %d\n",
         lista4_08b(tamanho, vetor1, vetor2));
  free(vetor1);
  free(vetor2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe83(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1070 <scanf@plt>
mov    -0x14(%rbp),%esi
lea    0xe73(%rip),%rdi
call   1050 <printf@plt>
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x20(%rbp)
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1030 <insere_vetor@plt>
mov    -0x14(%rbp),%edi
mov    -0x28(%rbp),%rsi
call   1030 <insere_vetor@plt>
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1080 <lista4_08b@plt>
mov    %eax,%esi
lea    0xe32(%rip),%rdi
call   1050 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1040 <free@plt>
mov    -0x28(%rbp),%rdi
call   1040 <free@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xe95(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1070 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xe83(%rip),%rdi
call   1050 <printf@plt>
mov    0x4(%rsp),%edi
shl    $0x3,%edi
call   1060 <malloc@plt>
mov    %rax,%r14
mov    0x4(%rsp),%edi
shl    $0x3,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    0x4(%rsp),%edi
mov    %r14,%rsi
call   1030 <insere_vetor@plt>
mov    0x4(%rsp),%edi
mov    %rbx,%rsi
call   1030 <insere_vetor@plt>
mov    0x4(%rsp),%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1080 <lista4_08b@plt>
lea    0xe4d(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    %r14,%rdi
call   1040 <free@plt>
mov    %rbx,%rdi
call   1040 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [27 x i8] c"Tamanho do vetor = %d \0A\00"
@.str.2 = [39 x i8] c"O produto escalar dos vetores \C3\A9 = %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%11 = load i32, i32* %6
%12 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = mul i64 %14, 8
%16 = trunc i64 %15 to i32
%17 = call i64 @malloc(i32 %16)
%18 = inttoptr i64 %17 to i32*
store i32* %18, i32** %8
%19 = load i32, i32* %6
%20 = sext i32 %19 to i64
%21 = mul i64 %20, 8
%22 = trunc i64 %21 to i32
%23 = call i64 @malloc(i32 %22)
%24 = inttoptr i64 %23 to i32*
store i32* %24, i32** %9
%25 = load i32, i32* %6
%26 = load i32*, i32** %8
%27 = call i32 @insere_vetor(i32 %25, i32* %26)
%28 = load i32, i32* %6
%29 = load i32*, i32** %9
%30 = call i32 @insere_vetor(i32 %28, i32* %29)
%31 = load i32, i32* %6
%32 = load i32*, i32** %8
%33 = load i32*, i32** %9
%34 = call i32 @lista4_08b(i32 %31, i32* %32, i32* %33)
%35 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i32 %34)
%36 = load i32*, i32** %8
%37 = call i32 @free(i32* %36)
%38 = load i32*, i32** %9
%39 = call i32 @free(i32* %38)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [27 x i8] c"Tamanho do vetor = %d \0A\00"
@.str.2 = [39 x i8] c"O produto escalar dos vetores \C3\A9 = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %3
%9 = shl i32 %8, 3
%10 = call i64 @malloc(i32 %9)
%11 = inttoptr i64 %10 to i32*
%12 = load i32, i32* %3
%13 = shl i32 %12, 3
%14 = call i64 @malloc(i32 %13)
%15 = inttoptr i64 %14 to i32*
%16 = load i32, i32* %3
%17 = call i32 @insere_vetor(i32 %16, i32* %11)
%18 = load i32, i32* %3
%19 = call i32 @insere_vetor(i32 %18, i32* %15)
%20 = load i32, i32* %3
%21 = call i32 @lista4_08b(i32 %20, i32* %11, i32* %15)
%22 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i32 %21)
%23 = call i32 @free(i32* %11)
%24 = call i32 @free(i32* %15)
ret i32 0
}