#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 */
struct timespec {
  double tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
unsigned int atoi(char *);
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  int i;
  struct timespec cgt1, cgt2;
  double ncgt;
  if (argc < 2) {
    printf("Faltan no componentes del vector\n");
    exit(-1);
  }
  unsigned int N = atoi(argv[1]);
  double v1[N], v2[N], v3[N];
  for (i = 0; i < N; i++) {
    v1[i] = N * 0.1 + i * 0.1;
    v2[i] = N * 0.1 - i * 0.1;
  }
  clock_gettime(CLOCK_REALTIME, &cgt1);
  for (i = 0; i < N; i++)
    v3[i] = v1[i] + v2[i];
  clock_gettime(CLOCK_REALTIME, &cgt2);
  ncgt = (double)(cgt2.tv_sec - cgt1.tv_sec) +
         (double)((cgt2.tv_nsec - cgt1.tv_nsec) / (1.e+9));
  printf("Tiempo(seg.):%11.9f\t / Tamaño Vectores:%u\n", ncgt, N);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    117b <main+0x3b>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x50(%rbp)
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x80(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x58(%rbp)
mov    -0x44(%rbp),%eax
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x78(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x60(%rbp)
mov    -0x44(%rbp),%eax
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x70(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x68(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x44(%rbp),%eax
jae    128f <main+0x14f>
mov    -0x78(%rbp),%rax
mov    -0x80(%rbp),%rcx
mov    -0x44(%rbp),%edx
cvtsi2sd %rdx,%xmm0
movslq -0x14(%rbp),%rdx
mov    %edx,%esi
cvtsi2sd %esi,%xmm1
movsd  0xde1(%rip),%xmm2
mulsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rcx,%rdx,8)
mov    -0x44(%rbp),%ecx
cvtsi2sd %rcx,%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
movsd  0xdbb(%rip),%xmm2
mulsd  %xmm2,%xmm1
movq   %xmm1,%rcx
movabs $0x8000000000000000,%rdx
xor    %rdx,%rcx
movq   %rcx,%xmm1
movsd  0xd98(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movslq -0x14(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11f9 <main+0xb9>
mov    0x2d4a(%rip),%rax
mov    (%rax),%edi
lea    -0x28(%rbp),%rsi
call   1030 <clock_gettime@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x44(%rbp),%eax
jae    12e9 <main+0x1a9>
mov    -0x70(%rbp),%rax
mov    -0x78(%rbp),%rcx
mov    -0x80(%rbp),%rdx
movslq -0x14(%rbp),%rsi
movsd  (%rdx,%rsi,8),%xmm0
movslq -0x14(%rbp),%rdx
addsd  (%rcx,%rdx,8),%xmm0
movslq -0x14(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    12a8 <main+0x168>
mov    0x2cf0(%rip),%rax
mov    (%rax),%edi
lea    -0x38(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    -0x30(%rbp),%rax
sub    -0x20(%rbp),%rax
cvtsi2sd %rax,%xmm0
movsd  -0x38(%rbp),%xmm1
subsd  -0x28(%rbp),%xmm1
movsd  0xce6(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
mov    -0x44(%rbp),%esi
lea    0xcfc(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x50(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
cmp    $0x1,%edi
jle    11cc <main+0x7c>
mov    0x8(%rsi),%rdi
call   1060 <atoi@plt>
mov    %eax,%ebp
mov    %rsp,%r14
mov    0x2e6e(%rip),%rbx
mov    (%rbx),%edi
lea    0x10(%rsp),%rsi
call   1040 <clock_gettime@plt>
mov    (%rbx),%edi
mov    %rsp,%rsi
call   1040 <clock_gettime@plt>
mov    0x8(%rsp),%rax
sub    0x18(%rsp),%rax
cvtsi2sd %rax,%xmm1
movsd  (%rsp),%xmm0
subsd  0x10(%rsp),%xmm0
divsd  0xe56(%rip),%xmm0
addsd  %xmm1,%xmm0
lea    0xe53(%rip),%rdi
mov    %ebp,%esi
mov    $0x1,%al
call   1050 <printf@plt>
mov    %r14,%rsp
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
lea    0xe61(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
%struct.timespec = type { double, i64 }
@.str = [34 x i8] c"Faltan no componentes del vector\0A\00"
@CLOCK_REALTIME = global i32 0
@.str.1 = [44 x i8] c"Tiempo(seg.):%11.9f\09 / Tama\C3\B1o Vectores:%u\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca %struct.timespec
%8 = alloca %struct.timespec
%9 = alloca double
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%15 = load i32, i32* %4
%16 = icmp slt i32 %15, 2
br i1 %16, label %17, label %20
17: ; preds = %2
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%19 = call i32 @exit(i32 -1)
unreachable
20: ; preds = %2
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
%24 = call i32 @atoi(i8* %23)
store i32 %24, i32* %10
%25 = load i32, i32* %10
%26 = zext i32 %25 to i64
%27 = call i8* @llvm.stacksave()
store i8* %27, i8** %11
%28 = alloca double, i64 %26
store i64 %26, i64* %12
%29 = load i32, i32* %10
%30 = zext i32 %29 to i64
%31 = alloca double, i64 %30
store i64 %30, i64* %13
%32 = load i32, i32* %10
%33 = zext i32 %32 to i64
%34 = alloca double, i64 %33
store i64 %33, i64* %14
store i32 0, i32* %6
br label %35
35: ; preds = %59, %20
%36 = load i32, i32* %6
%37 = load i32, i32* %10
%38 = icmp ult i32 %36, %37
br i1 %38, label %39, label %62
39: ; preds = %35
%40 = load i32, i32* %10
%41 = uitofp i32 %40 to double
%42 = load i32, i32* %6
%43 = sitofp i32 %42 to double
%44 = fmul double %43, 1.000000e-01
%45 = call double @llvm.fmuladd.f64(double %41, double 1.000000e-01, double %44)
%46 = load i32, i32* %6
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds double, double* %28, i64 %47
store double %45, double* %48
%49 = load i32, i32* %10
%50 = uitofp i32 %49 to double
%51 = load i32, i32* %6
%52 = sitofp i32 %51 to double
%53 = fmul double %52, 1.000000e-01
%54 = fneg double %53
%55 = call double @llvm.fmuladd.f64(double %50, double 1.000000e-01, double %54)
%56 = load i32, i32* %6
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds double, double* %31, i64 %57
store double %55, double* %58
br label %59
59: ; preds = %39
%60 = load i32, i32* %6
%61 = add nsw i32 %60, 1
store i32 %61, i32* %6
br label %35
62: ; preds = %35
%63 = load i32, i32* @CLOCK_REALTIME
%64 = call i32 @clock_gettime(i32 %63, %struct.timespec* %7)
store i32 0, i32* %6
br label %65
65: ; preds = %82, %62
%66 = load i32, i32* %6
%67 = load i32, i32* %10
%68 = icmp ult i32 %66, %67
br i1 %68, label %69, label %85
69: ; preds = %65
%70 = load i32, i32* %6
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds double, double* %28, i64 %71
%73 = load double, double* %72
%74 = load i32, i32* %6
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds double, double* %31, i64 %75
%77 = load double, double* %76
%78 = fadd double %73, %77
%79 = load i32, i32* %6
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds double, double* %34, i64 %80
store double %78, double* %81
br label %82
82: ; preds = %69
%83 = load i32, i32* %6
%84 = add nsw i32 %83, 1
store i32 %84, i32* %6
br label %65
85: ; preds = %65
%86 = load i32, i32* @CLOCK_REALTIME
%87 = call i32 @clock_gettime(i32 %86, %struct.timespec* %8)
%88 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 1
%89 = load i64, i64* %88
%90 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 1
%91 = load i64, i64* %90
%92 = sub nsw i64 %89, %91
%93 = sitofp i64 %92 to double
%94 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 0
%95 = load double, double* %94
%96 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 0
%97 = load double, double* %96
%98 = fsub double %95, %97
%99 = fdiv double %98, 1.000000e+09
%100 = fadd double %93, %99
store double %100, double* %9
%101 = load double, double* %9
%102 = load i32, i32* %10
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), double %101, i32 %102)
store i32 0, i32* %3
%104 = load i8*, i8** %11
%105 = load i32, i32* %3
ret i32 %105
}

LLVM IR (-O2):
%struct.timespec = type { double, i64 }
@CLOCK_REALTIME = global i32 0
@.str.1 = [44 x i8] c"Tiempo(seg.):%11.9f\09 / Tama\C3\B1o Vectores:%u\0A\00"
@str = [33 x i8] c"Faltan no componentes del vector\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.timespec
%4 = alloca %struct.timespec
%5 = bitcast %struct.timespec* %3 to i8*
%6 = bitcast %struct.timespec* %4 to i8*
%7 = icmp slt i32 %0, 2
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%10 = tail call i32 @exit(i32 -1)
unreachable
11: ; preds = %2
%12 = getelementptr inbounds i8*, i8** %1, i64 1
%13 = load i8*, i8** %12
%14 = tail call i32 @atoi(i8* %13)
%15 = tail call i8* @llvm.stacksave()
%16 = load i32, i32* @CLOCK_REALTIME
%17 = call i32 @clock_gettime(i32 %16, %struct.timespec* %3)
%18 = load i32, i32* @CLOCK_REALTIME
%19 = call i32 @clock_gettime(i32 %18, %struct.timespec* %4)
%20 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i64 0, i32 1
%21 = load i64, i64* %20
%22 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i64 0, i32 1
%23 = load i64, i64* %22
%24 = sub nsw i64 %21, %23
%25 = sitofp i64 %24 to double
%26 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i64 0, i32 0
%27 = load double, double* %26
%28 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i64 0, i32 0
%29 = load double, double* %28
%30 = fsub double %27, %29
%31 = fdiv double %30, 1.000000e+09
%32 = fadd double %31, %25
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), double %32, i32 %14)
ret i32 0
}