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


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

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

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

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