void glmMakeVector4d(double result[4], const double p1[4], const double p2[4]) {
  result[0] = p2[0] - p1[0];
  result[1] = p2[1] - p1[1];
  result[2] = p2[2] - p1[2];
  result[3] = p2[3] - p1[3];
}


x86 assembly (clang, -O0):
<glmMakeVector4d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x18(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x18(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x18(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmMakeVector4d>:
movsd  (%rdx),%xmm0
subsd  (%rsi),%xmm0
movsd  %xmm0,(%rdi)
movsd  0x8(%rdx),%xmm0
subsd  0x8(%rsi),%xmm0
movsd  %xmm0,0x8(%rdi)
movsd  0x10(%rdx),%xmm0
subsd  0x10(%rsi),%xmm0
movsd  %xmm0,0x10(%rdi)
movsd  0x18(%rdx),%xmm0
subsd  0x18(%rsi),%xmm0
movsd  %xmm0,0x18(%rdi)
ret

LLVM IR (-O0):
define void @glmMakeVector4d(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %6
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = load double, double* %8
%10 = load double*, double** %5
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
%13 = fsub double %9, %12
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 0
store double %13, double* %15
%16 = load double*, double** %6
%17 = getelementptr inbounds double, double* %16, i64 1
%18 = load double, double* %17
%19 = load double*, double** %5
%20 = getelementptr inbounds double, double* %19, i64 1
%21 = load double, double* %20
%22 = fsub double %18, %21
%23 = load double*, double** %4
%24 = getelementptr inbounds double, double* %23, i64 1
store double %22, double* %24
%25 = load double*, double** %6
%26 = getelementptr inbounds double, double* %25, i64 2
%27 = load double, double* %26
%28 = load double*, double** %5
%29 = getelementptr inbounds double, double* %28, i64 2
%30 = load double, double* %29
%31 = fsub double %27, %30
%32 = load double*, double** %4
%33 = getelementptr inbounds double, double* %32, i64 2
store double %31, double* %33
%34 = load double*, double** %6
%35 = getelementptr inbounds double, double* %34, i64 3
%36 = load double, double* %35
%37 = load double*, double** %5
%38 = getelementptr inbounds double, double* %37, i64 3
%39 = load double, double* %38
%40 = fsub double %36, %39
%41 = load double*, double** %4
%42 = getelementptr inbounds double, double* %41, i64 3
store double %40, double* %42
ret void
}

LLVM IR (-O2):
define void @glmMakeVector4d(double* nocapture writeonly %0, double* nocapture %1, double* nocapture %2) {
%4 = load double, double* %2
%5 = load double, double* %1
%6 = fsub double %4, %5
store double %6, double* %0
%7 = getelementptr inbounds double, double* %2, i64 1
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %1, i64 1
%10 = load double, double* %9
%11 = fsub double %8, %10
%12 = getelementptr inbounds double, double* %0, i64 1
store double %11, double* %12
%13 = getelementptr inbounds double, double* %2, i64 2
%14 = load double, double* %13
%15 = getelementptr inbounds double, double* %1, i64 2
%16 = load double, double* %15
%17 = fsub double %14, %16
%18 = getelementptr inbounds double, double* %0, i64 2
store double %17, double* %18
%19 = getelementptr inbounds double, double* %2, i64 3
%20 = load double, double* %19
%21 = getelementptr inbounds double, double* %1, i64 3
%22 = load double, double* %21
%23 = fsub double %20, %22
%24 = getelementptr inbounds double, double* %0, i64 3
store double %23, double* %24
ret void
}