#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 */
double sla_dvdv_(double *, double *);
double slaDvdv(double va[3], double vb[3]) {
  double VA[3];
  double VB[3];
  double result;
  int i;
  for (i = 0; i < 3; i++) {
    VA[i] = va[i];
    VB[i] = vb[i];
  }
  result = sla_dvdv_((double *)VA, (double *)VB);
  return result;
}


x86 assembly (clang, -O0):
<slaDvdv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x5c(%rbp)
cmpl   $0x3,-0x5c(%rbp)
jge    116d <slaDvdv+0x5d>
mov    -0x8(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movslq -0x5c(%rbp),%rax
movsd  %xmm0,-0x30(%rbp,%rax,8)
mov    -0x10(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movslq -0x5c(%rbp),%rax
movsd  %xmm0,-0x50(%rbp,%rax,8)
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    1127 <slaDvdv+0x17>
lea    -0x30(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1030 <sla_dvdv_@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slaDvdv>:
sub    $0x38,%rsp
movups (%rdi),%xmm0
movaps %xmm0,0x20(%rsp)
mov    0x10(%rdi),%rax
mov    %rax,0x30(%rsp)
movups (%rsi),%xmm0
movaps %xmm0,(%rsp)
mov    0x10(%rsi),%rax
mov    %rax,0x10(%rsp)
lea    0x20(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <sla_dvdv_@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
define double @slaDvdv(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca [3 x double]
%6 = alloca [3 x double]
%7 = alloca double
%8 = alloca i32
store double* %0, double** %3
store double* %1, double** %4
store i32 0, i32* %8
br label %9
9: ; preds = %29, %2
%10 = load i32, i32* %8
%11 = icmp slt i32 %10, 3
br i1 %11, label %12, label %32
12: ; preds = %9
%13 = load double*, double** %3
%14 = load i32, i32* %8
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds double, double* %13, i64 %15
%17 = load double, double* %16
%18 = load i32, i32* %8
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 %19
store double %17, double* %20
%21 = load double*, double** %4
%22 = load i32, i32* %8
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds double, double* %21, i64 %23
%25 = load double, double* %24
%26 = load i32, i32* %8
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 %27
store double %25, double* %28
br label %29
29: ; preds = %12
%30 = load i32, i32* %8
%31 = add nsw i32 %30, 1
store i32 %31, i32* %8
br label %9
32: ; preds = %9
%33 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 0
%34 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 0
%35 = call double @sla_dvdv_(double* %33, double* %34)
store double %35, double* %7
%36 = load double, double* %7
ret double %36
}

LLVM IR (-O2):
define double @slaDvdv(double* nocapture %0, double* nocapture %1) {
%3 = bitcast double* %0 to i8*
%4 = bitcast double* %1 to i8*
%5 = alloca [3 x double]
%6 = bitcast [3 x double]* %5 to i8*
%7 = alloca [3 x double]
%8 = bitcast [3 x double]* %7 to i8*
%9 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 0
%10 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%11 = call double @sla_dvdv_(double* %9, double* %10)
ret double %11
}