void multiply33d33d(double *m1, double *m2, double *m3) {
  int a;
  double m2r0, m2r1, m2r2;
  for (a = 0; a < 3; a++) {
    m2r0 = m2[a];
    m2r1 = m2[3 + a];
    m2r2 = m2[6 + a];
    m3[a] = m1[0] * m2r0 + m1[1] * m2r1 + m1[2] * m2r2;
    m3[3 + a] = m1[3] * m2r0 + m1[4] * m2r1 + m1[5] * m2r2;
    m3[6 + a] = m1[6] * m2r0 + m1[7] * m2r1 + m1[8] * m2r2;
  }
}


x86 assembly (clang, -O0):
<multiply33d33d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    124d <multiply33d33d+0x14d>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x6,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
movsd  -0x28(%rbp),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mulsd  -0x30(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  -0x38(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
movsd  0x18(%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  0x28(%rax),%xmm0
movsd  -0x38(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
movsd  0x30(%rax),%xmm1
movsd  -0x28(%rbp),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x38(%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    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x6,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <multiply33d33d+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiply33d33d>:
movsd  (%rsi),%xmm0
movsd  0x18(%rsi),%xmm2
movsd  0x30(%rsi),%xmm1
movsd  0x8(%rdi),%xmm3
mulsd  %xmm2,%xmm3
movsd  (%rdi),%xmm4
mulsd  %xmm0,%xmm4
addsd  %xmm3,%xmm4
movsd  0x10(%rdi),%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm4,%xmm3
movsd  %xmm3,(%rdx)
movsd  0x20(%rdi),%xmm3
mulsd  %xmm2,%xmm3
movsd  0x18(%rdi),%xmm4
mulsd  %xmm0,%xmm4
addsd  %xmm3,%xmm4
movsd  0x28(%rdi),%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm4,%xmm3
movsd  %xmm3,0x18(%rdx)
mulsd  0x38(%rdi),%xmm2
mulsd  0x30(%rdi),%xmm0
mulsd  0x40(%rdi),%xmm1
addsd  %xmm2,%xmm0
addsd  %xmm0,%xmm1
movsd  %xmm1,0x30(%rdx)
movsd  0x8(%rsi),%xmm0
movsd  0x20(%rsi),%xmm2
movsd  0x38(%rsi),%xmm1
movsd  0x8(%rdi),%xmm3
mulsd  %xmm2,%xmm3
movsd  (%rdi),%xmm4
mulsd  %xmm0,%xmm4
addsd  %xmm3,%xmm4
movsd  0x10(%rdi),%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm4,%xmm3
movsd  %xmm3,0x8(%rdx)
movsd  0x20(%rdi),%xmm3
mulsd  %xmm2,%xmm3
movsd  0x18(%rdi),%xmm4
mulsd  %xmm0,%xmm4
addsd  %xmm3,%xmm4
movsd  0x28(%rdi),%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm4,%xmm3
movsd  %xmm3,0x20(%rdx)
mulsd  0x38(%rdi),%xmm2
mulsd  0x30(%rdi),%xmm0
addsd  %xmm2,%xmm0
mulsd  0x40(%rdi),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x38(%rdx)
movsd  0x10(%rsi),%xmm0
movsd  0x28(%rsi),%xmm2
movsd  0x40(%rsi),%xmm1
movsd  0x8(%rdi),%xmm3
mulsd  %xmm2,%xmm3
movsd  (%rdi),%xmm4
mulsd  %xmm0,%xmm4
addsd  %xmm3,%xmm4
movsd  0x10(%rdi),%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm4,%xmm3
movsd  %xmm3,0x10(%rdx)
movsd  0x20(%rdi),%xmm3
mulsd  %xmm2,%xmm3
movsd  0x18(%rdi),%xmm4
mulsd  %xmm0,%xmm4
addsd  %xmm3,%xmm4
movsd  0x28(%rdi),%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm4,%xmm3
movsd  %xmm3,0x28(%rdx)
mulsd  0x38(%rdi),%xmm2
mulsd  0x30(%rdi),%xmm0
addsd  %xmm2,%xmm0
mulsd  0x40(%rdi),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x40(%rdx)
ret

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

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