#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*/ elimina(float *, int);
int /*<<< orphan*/ geraD(float *, float *, float *, float, float, int);
int /*<<< orphan*/ ler_vetores(float *, float *, int);
float *malloc(int);
int /*<<< orphan*/ printD(float *, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, ...);
int /*<<< orphan*/ verificaN(int *);
int main(int argc, const char *argv[]) {
  int n, i;
  float x, y, *A, *B, *d;
  printf("Informe o valor de x:\n");
  scanf("%f", &x);
  printf("Informe o valor de y:\n");
  scanf("%f", &y);
  printf("Informe o valor de n:\n");
  scanf("%d", &n);
  verificaN(&n);
  A = malloc(sizeof(float) * n);
  B = malloc(sizeof(float) * n);
  d = malloc(sizeof(float) * n);
  ler_vetores(A, B, n);
  geraD(d, A, B, x, y, n);
  elimina(d, n);
  printD(d, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe63(%rip),%rdi
call   1040 <printf@plt>
lea    0xe6e(%rip),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x0,%al
call   1070 <scanf@plt>
lea    0xe5f(%rip),%rdi
call   1040 <printf@plt>
lea    0xe50(%rip),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1070 <scanf@plt>
lea    0xe58(%rip),%rdi
call   1040 <printf@plt>
lea    0xe63(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1070 <scanf@plt>
lea    -0x14(%rbp),%rdi
call   1030 <verificaN@plt>
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x28(%rbp)
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x30(%rbp)
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1080 <ler_vetores@plt>
mov    -0x38(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
movss  -0x1c(%rbp),%xmm0
movss  -0x20(%rbp),%xmm1
mov    -0x14(%rbp),%ecx
call   1060 <geraD@plt>
mov    -0x38(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1090 <elimina@plt>
mov    -0x38(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   10a0 <printD@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xe75(%rip),%rdi
call   1040 <puts@plt>
lea    0xe63(%rip),%rbx
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <scanf@plt>
lea    0xe69(%rip),%rdi
call   1040 <puts@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <scanf@plt>
lea    0xe64(%rip),%rdi
call   1040 <puts@plt>
lea    0xe29(%rip),%rdi
lea    0xc(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
mov    %rbx,%rdi
call   1030 <verificaN@plt>
mov    0xc(%rsp),%r15d
lea    0x0(,%r15,4),%ebp
mov    %ebp,%edi
call   1050 <malloc@plt>
mov    %rax,%r14
mov    %ebp,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %ebp,%edi
call   1050 <malloc@plt>
mov    %rax,%rbp
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r15d,%edx
call   1080 <ler_vetores@plt>
movss  0x14(%rsp),%xmm0
movss  0x10(%rsp),%xmm1
mov    0xc(%rsp),%ecx
mov    %rbp,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1060 <geraD@plt>
mov    0xc(%rsp),%esi
mov    %rbp,%rdi
call   1090 <elimina@plt>
mov    0xc(%rsp),%esi
mov    %rbp,%rdi
call   10a0 <printD@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Informe o valor de x:\0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [23 x i8] c"Informe o valor de y:\0A\00"
@.str.3 = [23 x i8] c"Informe o valor de n:\0A\00"
@.str.4 = [3 x i8] c"%d\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 float
%9 = alloca float
%10 = alloca float*
%11 = alloca float*
%12 = alloca float*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %8)
%15 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %9)
%17 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %6)
%19 = call i32 @verificaN(i32* %6)
%20 = load i32, i32* %6
%21 = sext i32 %20 to i64
%22 = mul i64 4, %21
%23 = trunc i64 %22 to i32
%24 = call float* @malloc(i32 %23)
store float* %24, float** %10
%25 = load i32, i32* %6
%26 = sext i32 %25 to i64
%27 = mul i64 4, %26
%28 = trunc i64 %27 to i32
%29 = call float* @malloc(i32 %28)
store float* %29, float** %11
%30 = load i32, i32* %6
%31 = sext i32 %30 to i64
%32 = mul i64 4, %31
%33 = trunc i64 %32 to i32
%34 = call float* @malloc(i32 %33)
store float* %34, float** %12
%35 = load float*, float** %10
%36 = load float*, float** %11
%37 = load i32, i32* %6
%38 = call i32 @ler_vetores(float* %35, float* %36, i32 %37)
%39 = load float*, float** %12
%40 = load float*, float** %10
%41 = load float*, float** %11
%42 = load float, float* %8
%43 = load float, float* %9
%44 = load i32, i32* %6
%45 = call i32 @geraD(float* %39, float* %40, float* %41, float %42, float %43, i32 %44)
%46 = load float*, float** %12
%47 = load i32, i32* %6
%48 = call i32 @elimina(float* %46, i32 %47)
%49 = load float*, float** %12
%50 = load i32, i32* %6
%51 = call i32 @printD(float* %49, i32 %50)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.4 = [3 x i8] c"%d\00"
@str = [22 x i8] c"Informe o valor de x:\00"
@str.5 = [22 x i8] c"Informe o valor de y:\00"
@str.6 = [22 x i8] c"Informe o valor de n:\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca float
%6 = bitcast i32* %3 to i8*
%7 = bitcast float* %4 to i8*
%8 = bitcast float* %5 to i8*
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.5, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %5)
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.6, i64 0, i64 0))
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %3)
%15 = call i32 @verificaN(i32* %3)
%16 = load i32, i32* %3
%17 = shl i32 %16, 2
%18 = call float* @malloc(i32 %17)
%19 = call float* @malloc(i32 %17)
%20 = call float* @malloc(i32 %17)
%21 = call i32 @ler_vetores(float* %18, float* %19, i32 %16)
%22 = load float, float* %4
%23 = load float, float* %5
%24 = load i32, i32* %3
%25 = call i32 @geraD(float* %20, float* %18, float* %19, float %22, float %23, i32 %24)
%26 = load i32, i32* %3
%27 = call i32 @elimina(float* %20, i32 %26)
%28 = load i32, i32* %3
%29 = call i32 @printD(float* %20, i32 %28)
ret i32 0
}