void matrix3x3_multiply1x3(const double m[restrict 3][3],
                           const double b[restrict 3], double out[restrict 3]) {
  out[0] = m[0][0] * b[0] + m[0][1] * b[1] + m[0][2] * b[2];
  out[1] = m[1][0] * b[0] + m[1][1] * b[1] + m[1][2] * b[2];
  out[2] = m[2][0] * b[0] + m[2][1] * b[1] + m[2][2] * b[2];
}


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

x86 assembly (clang, -O2):
<matrix3x3_multiply1x3>:
movsd  (%rsi),%xmm0
movsd  0x8(%rsi),%xmm2
movsd  0x10(%rsi),%xmm1
movapd %xmm2,%xmm3
unpcklpd %xmm2,%xmm3
movsd  (%rdi),%xmm4
movsd  0x8(%rdi),%xmm5
movsd  0x10(%rdi),%xmm6
movhpd 0x20(%rdi),%xmm5
mulpd  %xmm3,%xmm5
movhpd 0x18(%rdi),%xmm4
movapd %xmm0,%xmm3
unpcklpd %xmm0,%xmm3
mulpd  %xmm4,%xmm3
addpd  %xmm5,%xmm3
movhpd 0x28(%rdi),%xmm6
movapd %xmm1,%xmm4
unpcklpd %xmm1,%xmm4
mulpd  %xmm6,%xmm4
addpd  %xmm3,%xmm4
mulsd  0x38(%rdi),%xmm2
movupd %xmm4,(%rdx)
mulsd  0x30(%rdi),%xmm0
addsd  %xmm2,%xmm0
mulsd  0x40(%rdi),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rdx)
ret

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

LLVM IR (-O2):
define void @matrix3x3_multiply1x3([3 x double]* noalias nocapture %0, double* noalias nocapture %1, double* noalias nocapture writeonly %2) {
%4 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 0, i64 0
%5 = load double, double* %4
%6 = load double, double* %1
%7 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 0, i64 1
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %1, i64 1
%10 = load double, double* %9
%11 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 0, i64 2
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %1, i64 2
%14 = load double, double* %13
%15 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 1, i64 0
%16 = load double, double* %15
%17 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 1, i64 1
%18 = load double, double* %17
%19 = insertelement <2 x double> poison, double %10, i64 0
%20 = shufflevector <2 x double> %19, <2 x double> poison, <2 x i32> zeroinitializer
%21 = insertelement <2 x double> poison, double %8, i64 0
%22 = insertelement <2 x double> %21, double %18, i64 1
%23 = fmul <2 x double> %20, %22
%24 = insertelement <2 x double> poison, double %5, i64 0
%25 = insertelement <2 x double> %24, double %16, i64 1
%26 = insertelement <2 x double> poison, double %6, i64 0
%27 = shufflevector <2 x double> %26, <2 x double> poison, <2 x i32> zeroinitializer
%28 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %25, <2 x double> %27, <2 x double> %23)
%29 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 1, i64 2
%30 = load double, double* %29
%31 = insertelement <2 x double> poison, double %12, i64 0
%32 = insertelement <2 x double> %31, double %30, i64 1
%33 = insertelement <2 x double> poison, double %14, i64 0
%34 = shufflevector <2 x double> %33, <2 x double> poison, <2 x i32> zeroinitializer
%35 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %32, <2 x double> %34, <2 x double> %28)
%36 = bitcast double* %2 to <2 x double>*
store <2 x double> %35, <2 x double>* %36
%37 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 2, i64 0
%38 = load double, double* %37
%39 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 2, i64 1
%40 = load double, double* %39
%41 = fmul double %10, %40
%42 = tail call double @llvm.fmuladd.f64(double %38, double %6, double %41)
%43 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 2, i64 2
%44 = load double, double* %43
%45 = tail call double @llvm.fmuladd.f64(double %44, double %14, double %42)
%46 = getelementptr inbounds double, double* %2, i64 2
store double %45, double* %46
ret void
}