void point_threw_matrix4(double *matrix, double *pos_x, double *pos_y,
                         double *pos_z, double *pos_w) {
  double x, y, z, w;
  x = *pos_x;
  y = *pos_y;
  z = *pos_z;
  w = *pos_w;
  *pos_x =
      (matrix[0] * x) + (matrix[4] * y) + (matrix[8] * z) + (matrix[12] * w);
  *pos_y =
      (matrix[1] * x) + (matrix[5] * y) + (matrix[9] * z) + (matrix[13] * w);
  *pos_z =
      (matrix[2] * x) + (matrix[6] * y) + (matrix[10] * z) + (matrix[14] * w);
  *pos_w =
      (matrix[3] * x) + (matrix[7] * y) + (matrix[11] * z) + (matrix[15] * w);
}


x86 assembly (clang, -O0):
<point_threw_matrix4>:
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
movsd  %xmm0,-0x30(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x30(%rbp),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x20(%rax),%xmm1
mulsd  -0x38(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  0x40(%rax),%xmm1
movsd  -0x40(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x60(%rax),%xmm0
movsd  -0x48(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  -0x30(%rbp),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x28(%rax),%xmm1
mulsd  -0x38(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  0x48(%rax),%xmm1
movsd  -0x40(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x68(%rax),%xmm0
movsd  -0x48(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  -0x30(%rbp),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x30(%rax),%xmm1
mulsd  -0x38(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  0x50(%rax),%xmm1
movsd  -0x40(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x70(%rax),%xmm0
movsd  -0x48(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  -0x30(%rbp),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x38(%rax),%xmm1
mulsd  -0x38(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  0x58(%rax),%xmm1
movsd  -0x40(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x78(%rax),%xmm0
movsd  -0x48(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @point_threw_matrix4(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*
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = 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
%15 = load double*, double** %7
%16 = load double, double* %15
store double %16, double* %11
%17 = load double*, double** %8
%18 = load double, double* %17
store double %18, double* %12
%19 = load double*, double** %9
%20 = load double, double* %19
store double %20, double* %13
%21 = load double*, double** %10
%22 = load double, double* %21
store double %22, double* %14
%23 = load double*, double** %6
%24 = getelementptr inbounds double, double* %23, i64 0
%25 = load double, double* %24
%26 = load double, double* %11
%27 = load double*, double** %6
%28 = getelementptr inbounds double, double* %27, i64 4
%29 = load double, double* %28
%30 = load double, double* %12
%31 = fmul double %29, %30
%32 = call double @llvm.fmuladd.f64(double %25, double %26, double %31)
%33 = load double*, double** %6
%34 = getelementptr inbounds double, double* %33, i64 8
%35 = load double, double* %34
%36 = load double, double* %13
%37 = call double @llvm.fmuladd.f64(double %35, double %36, double %32)
%38 = load double*, double** %6
%39 = getelementptr inbounds double, double* %38, i64 12
%40 = load double, double* %39
%41 = load double, double* %14
%42 = call double @llvm.fmuladd.f64(double %40, double %41, double %37)
%43 = load double*, double** %7
store double %42, double* %43
%44 = load double*, double** %6
%45 = getelementptr inbounds double, double* %44, i64 1
%46 = load double, double* %45
%47 = load double, double* %11
%48 = load double*, double** %6
%49 = getelementptr inbounds double, double* %48, i64 5
%50 = load double, double* %49
%51 = load double, double* %12
%52 = fmul double %50, %51
%53 = call double @llvm.fmuladd.f64(double %46, double %47, double %52)
%54 = load double*, double** %6
%55 = getelementptr inbounds double, double* %54, i64 9
%56 = load double, double* %55
%57 = load double, double* %13
%58 = call double @llvm.fmuladd.f64(double %56, double %57, double %53)
%59 = load double*, double** %6
%60 = getelementptr inbounds double, double* %59, i64 13
%61 = load double, double* %60
%62 = load double, double* %14
%63 = call double @llvm.fmuladd.f64(double %61, double %62, double %58)
%64 = load double*, double** %8
store double %63, double* %64
%65 = load double*, double** %6
%66 = getelementptr inbounds double, double* %65, i64 2
%67 = load double, double* %66
%68 = load double, double* %11
%69 = load double*, double** %6
%70 = getelementptr inbounds double, double* %69, i64 6
%71 = load double, double* %70
%72 = load double, double* %12
%73 = fmul double %71, %72
%74 = call double @llvm.fmuladd.f64(double %67, double %68, double %73)
%75 = load double*, double** %6
%76 = getelementptr inbounds double, double* %75, i64 10
%77 = load double, double* %76
%78 = load double, double* %13
%79 = call double @llvm.fmuladd.f64(double %77, double %78, double %74)
%80 = load double*, double** %6
%81 = getelementptr inbounds double, double* %80, i64 14
%82 = load double, double* %81
%83 = load double, double* %14
%84 = call double @llvm.fmuladd.f64(double %82, double %83, double %79)
%85 = load double*, double** %9
store double %84, double* %85
%86 = load double*, double** %6
%87 = getelementptr inbounds double, double* %86, i64 3
%88 = load double, double* %87
%89 = load double, double* %11
%90 = load double*, double** %6
%91 = getelementptr inbounds double, double* %90, i64 7
%92 = load double, double* %91
%93 = load double, double* %12
%94 = fmul double %92, %93
%95 = call double @llvm.fmuladd.f64(double %88, double %89, double %94)
%96 = load double*, double** %6
%97 = getelementptr inbounds double, double* %96, i64 11
%98 = load double, double* %97
%99 = load double, double* %13
%100 = call double @llvm.fmuladd.f64(double %98, double %99, double %95)
%101 = load double*, double** %6
%102 = getelementptr inbounds double, double* %101, i64 15
%103 = load double, double* %102
%104 = load double, double* %14
%105 = call double @llvm.fmuladd.f64(double %103, double %104, double %100)
%106 = load double*, double** %10
store double %105, double* %106
ret void
}

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