void glmMatrixFromVectors4d(double m[16], const double v1[4],
                            const double v2[4], const double v3[4],
                            const double v4[4]) {
  m[0] = v1[0];
  m[4] = v2[0];
  m[8] = v3[0];
  m[12] = v4[0];
  m[1] = v1[1];
  m[5] = v2[1];
  m[9] = v3[1];
  m[13] = v4[1];
  m[2] = v1[2];
  m[6] = v2[2];
  m[10] = v3[2];
  m[14] = v4[2];
  m[3] = v1[3];
  m[7] = v2[3];
  m[11] = v3[3];
  m[15] = v4[3];
}


x86 assembly (clang, -O0):
<glmMatrixFromVectors4d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x20(%rax)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x40(%rax)
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x60(%rax)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x28(%rax)
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x48(%rax)
mov    -0x28(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x68(%rax)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x30(%rax)
mov    -0x20(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x50(%rax)
mov    -0x28(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x70(%rax)
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x18(%rax)
mov    -0x18(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x38(%rax)
mov    -0x20(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x58(%rax)
mov    -0x28(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x78(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmMatrixFromVectors4d>:
movsd  (%rsi),%xmm0
movsd  %xmm0,(%rdi)
movsd  (%rdx),%xmm0
movsd  %xmm0,0x20(%rdi)
movsd  (%rcx),%xmm0
movsd  %xmm0,0x40(%rdi)
movsd  (%r8),%xmm0
movsd  %xmm0,0x60(%rdi)
movsd  0x8(%rsi),%xmm0
movsd  %xmm0,0x8(%rdi)
movsd  0x8(%rdx),%xmm0
movsd  %xmm0,0x28(%rdi)
movsd  0x8(%rcx),%xmm0
movsd  %xmm0,0x48(%rdi)
movsd  0x8(%r8),%xmm0
movsd  %xmm0,0x68(%rdi)
movsd  0x10(%rsi),%xmm0
movsd  %xmm0,0x10(%rdi)
movsd  0x10(%rdx),%xmm0
movsd  %xmm0,0x30(%rdi)
movsd  0x10(%rcx),%xmm0
movsd  %xmm0,0x50(%rdi)
movsd  0x10(%r8),%xmm0
movsd  %xmm0,0x70(%rdi)
movsd  0x18(%rsi),%xmm0
movsd  %xmm0,0x18(%rdi)
movsd  0x18(%rdx),%xmm0
movsd  %xmm0,0x38(%rdi)
movsd  0x18(%rcx),%xmm0
movsd  %xmm0,0x58(%rdi)
movsd  0x18(%r8),%xmm0
movsd  %xmm0,0x78(%rdi)
ret

LLVM IR (-O0):
define void @glmMatrixFromVectors4d(double* %0, double* %1, double* %2, double* %3, double* %4) {
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
store double* %0, double** %6
store double* %1, double** %7
store double* %2, double** %8
store double* %3, double** %9
store double* %4, double** %10
%11 = load double*, double** %7
%12 = getelementptr inbounds double, double* %11, i64 0
%13 = load double, double* %12
%14 = load double*, double** %6
%15 = getelementptr inbounds double, double* %14, i64 0
store double %13, double* %15
%16 = load double*, double** %8
%17 = getelementptr inbounds double, double* %16, i64 0
%18 = load double, double* %17
%19 = load double*, double** %6
%20 = getelementptr inbounds double, double* %19, i64 4
store double %18, double* %20
%21 = load double*, double** %9
%22 = getelementptr inbounds double, double* %21, i64 0
%23 = load double, double* %22
%24 = load double*, double** %6
%25 = getelementptr inbounds double, double* %24, i64 8
store double %23, double* %25
%26 = load double*, double** %10
%27 = getelementptr inbounds double, double* %26, i64 0
%28 = load double, double* %27
%29 = load double*, double** %6
%30 = getelementptr inbounds double, double* %29, i64 12
store double %28, double* %30
%31 = load double*, double** %7
%32 = getelementptr inbounds double, double* %31, i64 1
%33 = load double, double* %32
%34 = load double*, double** %6
%35 = getelementptr inbounds double, double* %34, i64 1
store double %33, double* %35
%36 = load double*, double** %8
%37 = getelementptr inbounds double, double* %36, i64 1
%38 = load double, double* %37
%39 = load double*, double** %6
%40 = getelementptr inbounds double, double* %39, i64 5
store double %38, double* %40
%41 = load double*, double** %9
%42 = getelementptr inbounds double, double* %41, i64 1
%43 = load double, double* %42
%44 = load double*, double** %6
%45 = getelementptr inbounds double, double* %44, i64 9
store double %43, double* %45
%46 = load double*, double** %10
%47 = getelementptr inbounds double, double* %46, i64 1
%48 = load double, double* %47
%49 = load double*, double** %6
%50 = getelementptr inbounds double, double* %49, i64 13
store double %48, double* %50
%51 = load double*, double** %7
%52 = getelementptr inbounds double, double* %51, i64 2
%53 = load double, double* %52
%54 = load double*, double** %6
%55 = getelementptr inbounds double, double* %54, i64 2
store double %53, double* %55
%56 = load double*, double** %8
%57 = getelementptr inbounds double, double* %56, i64 2
%58 = load double, double* %57
%59 = load double*, double** %6
%60 = getelementptr inbounds double, double* %59, i64 6
store double %58, double* %60
%61 = load double*, double** %9
%62 = getelementptr inbounds double, double* %61, i64 2
%63 = load double, double* %62
%64 = load double*, double** %6
%65 = getelementptr inbounds double, double* %64, i64 10
store double %63, double* %65
%66 = load double*, double** %10
%67 = getelementptr inbounds double, double* %66, i64 2
%68 = load double, double* %67
%69 = load double*, double** %6
%70 = getelementptr inbounds double, double* %69, i64 14
store double %68, double* %70
%71 = load double*, double** %7
%72 = getelementptr inbounds double, double* %71, i64 3
%73 = load double, double* %72
%74 = load double*, double** %6
%75 = getelementptr inbounds double, double* %74, i64 3
store double %73, double* %75
%76 = load double*, double** %8
%77 = getelementptr inbounds double, double* %76, i64 3
%78 = load double, double* %77
%79 = load double*, double** %6
%80 = getelementptr inbounds double, double* %79, i64 7
store double %78, double* %80
%81 = load double*, double** %9
%82 = getelementptr inbounds double, double* %81, i64 3
%83 = load double, double* %82
%84 = load double*, double** %6
%85 = getelementptr inbounds double, double* %84, i64 11
store double %83, double* %85
%86 = load double*, double** %10
%87 = getelementptr inbounds double, double* %86, i64 3
%88 = load double, double* %87
%89 = load double*, double** %6
%90 = getelementptr inbounds double, double* %89, i64 15
store double %88, double* %90
ret void
}

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