#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*/ check(double *, double *);
int /*<<< orphan*/ init(double *, double *);
int /*<<< orphan*/ vec_mult(double *, double *, double *);
int /*<<< orphan*/ vec_mult_ref(double *, double *, double *);
int main() {
  double p1[100000], p2[100000];
  double v1[100000], v2[100000];
  init(v1, v2);
  vec_mult_ref(p1, v1, v2);
  vec_mult(p2, v1, v2);
  check(p1, p2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30d410,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x249f10(%rbp),%rdi
lea    -0x30d410(%rbp),%rsi
call   1030 <init@plt>
lea    -0xc3510(%rbp),%rdi
lea    -0x249f10(%rbp),%rsi
lea    -0x30d410(%rbp),%rdx
call   1040 <vec_mult_ref@plt>
lea    -0x186a10(%rbp),%rdi
lea    -0x249f10(%rbp),%rsi
lea    -0x30d410(%rbp),%rdx
call   1060 <vec_mult@plt>
lea    -0xc3510(%rbp),%rdi
lea    -0x186a10(%rbp),%rsi
call   1050 <check@plt>
xor    %eax,%eax
add    $0x30d410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x30d408,%rsp
lea    0xc3500(%rsp),%rbx
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <init@plt>
lea    0x249f00(%rsp),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <vec_mult_ref@plt>
lea    0x186a00(%rsp),%r12
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1060 <vec_mult@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1050 <check@plt>
xor    %eax,%eax
add    $0x30d408,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [100000 x double]
%3 = alloca [100000 x double]
%4 = alloca [100000 x double]
%5 = alloca [100000 x double]
store i32 0, i32* %1
%6 = getelementptr inbounds [100000 x double], [100000 x double]* %4, i64 0, i64 0
%7 = getelementptr inbounds [100000 x double], [100000 x double]* %5, i64 0, i64 0
%8 = call i32 @init(double* %6, double* %7)
%9 = getelementptr inbounds [100000 x double], [100000 x double]* %2, i64 0, i64 0
%10 = getelementptr inbounds [100000 x double], [100000 x double]* %4, i64 0, i64 0
%11 = getelementptr inbounds [100000 x double], [100000 x double]* %5, i64 0, i64 0
%12 = call i32 @vec_mult_ref(double* %9, double* %10, double* %11)
%13 = getelementptr inbounds [100000 x double], [100000 x double]* %3, i64 0, i64 0
%14 = getelementptr inbounds [100000 x double], [100000 x double]* %4, i64 0, i64 0
%15 = getelementptr inbounds [100000 x double], [100000 x double]* %5, i64 0, i64 0
%16 = call i32 @vec_mult(double* %13, double* %14, double* %15)
%17 = getelementptr inbounds [100000 x double], [100000 x double]* %2, i64 0, i64 0
%18 = getelementptr inbounds [100000 x double], [100000 x double]* %3, i64 0, i64 0
%19 = call i32 @check(double* %17, double* %18)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [100000 x double]
%2 = alloca [100000 x double]
%3 = alloca [100000 x double]
%4 = alloca [100000 x double]
%5 = bitcast [100000 x double]* %1 to i8*
%6 = bitcast [100000 x double]* %2 to i8*
%7 = bitcast [100000 x double]* %3 to i8*
%8 = bitcast [100000 x double]* %4 to i8*
%9 = getelementptr inbounds [100000 x double], [100000 x double]* %3, i64 0, i64 0
%10 = getelementptr inbounds [100000 x double], [100000 x double]* %4, i64 0, i64 0
%11 = call i32 @init(double* %9, double* %10)
%12 = getelementptr inbounds [100000 x double], [100000 x double]* %1, i64 0, i64 0
%13 = call i32 @vec_mult_ref(double* %12, double* %9, double* %10)
%14 = getelementptr inbounds [100000 x double], [100000 x double]* %2, i64 0, i64 0
%15 = call i32 @vec_mult(double* %14, double* %9, double* %10)
%16 = call i32 @check(double* %12, double* %14)
ret i32 0
}