void Multiply44(double a[4][4], double b[4][4], double c[4][4]) {
  int i, j, k;
  for (i = 0; i < 4; i++) {
    for (j = 0; j < 4; j++) {
      c[i][j] = 0;
      for (k = 0; k < 4; k++) {
        c[i][j] += a[i][k] * b[k][j];
      }
    }
  }
}


x86 assembly (clang, -O0):
<Multiply44>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x4,-0x1c(%rbp)
jge    11e7 <Multiply44+0xe7>
movl   $0x0,-0x20(%rbp)
cmpl   $0x4,-0x20(%rbp)
jge    11d4 <Multiply44+0xd4>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x0,-0x24(%rbp)
cmpl   $0x4,-0x24(%rbp)
jge    11c1 <Multiply44+0xc1>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1154 <Multiply44+0x54>
jmp    11c6 <Multiply44+0xc6>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1128 <Multiply44+0x28>
jmp    11d9 <Multiply44+0xd9>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <Multiply44+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Multiply44>:
xor    %eax,%eax
xorpd  %xmm0,%xmm0
cs nopw 0x0(%rax,%rax,1)
movq   $0x0,(%rdx,%rax,1)
movsd  (%rdi,%rax,1),%xmm1
mulsd  (%rsi),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rdx,%rax,1)
movsd  0x8(%rdi,%rax,1),%xmm2
mulsd  0x20(%rsi),%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,(%rdx,%rax,1)
movsd  0x10(%rdi,%rax,1),%xmm1
mulsd  0x40(%rsi),%xmm1
addsd  %xmm2,%xmm1
movsd  %xmm1,(%rdx,%rax,1)
movsd  0x18(%rdi,%rax,1),%xmm2
mulsd  0x60(%rsi),%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,(%rdx,%rax,1)
movq   $0x0,0x8(%rdx,%rax,1)
movsd  (%rdi,%rax,1),%xmm1
mulsd  0x8(%rsi),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rdx,%rax,1)
movsd  0x8(%rdi,%rax,1),%xmm2
mulsd  0x28(%rsi),%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,0x8(%rdx,%rax,1)
movsd  0x10(%rdi,%rax,1),%xmm1
mulsd  0x48(%rsi),%xmm1
addsd  %xmm2,%xmm1
movsd  %xmm1,0x8(%rdx,%rax,1)
movsd  0x18(%rdi,%rax,1),%xmm2
mulsd  0x68(%rsi),%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,0x8(%rdx,%rax,1)
movq   $0x0,0x10(%rdx,%rax,1)
movsd  (%rdi,%rax,1),%xmm1
mulsd  0x10(%rsi),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rdx,%rax,1)
movsd  0x8(%rdi,%rax,1),%xmm2
mulsd  0x30(%rsi),%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,0x10(%rdx,%rax,1)
movsd  0x10(%rdi,%rax,1),%xmm1
mulsd  0x50(%rsi),%xmm1
addsd  %xmm2,%xmm1
movsd  %xmm1,0x10(%rdx,%rax,1)
movsd  0x18(%rdi,%rax,1),%xmm2
mulsd  0x70(%rsi),%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,0x10(%rdx,%rax,1)
movq   $0x0,0x18(%rdx,%rax,1)
movsd  (%rdi,%rax,1),%xmm1
mulsd  0x18(%rsi),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x18(%rdx,%rax,1)
movsd  0x8(%rdi,%rax,1),%xmm2
mulsd  0x38(%rsi),%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,0x18(%rdx,%rax,1)
movsd  0x10(%rdi,%rax,1),%xmm1
mulsd  0x58(%rsi),%xmm1
addsd  %xmm2,%xmm1
movsd  %xmm1,0x18(%rdx,%rax,1)
movsd  0x18(%rdi,%rax,1),%xmm2
mulsd  0x78(%rsi),%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,0x18(%rdx,%rax,1)
add    $0x20,%rax
cmp    $0x80,%rax
jne    1110 <Multiply44+0x10>
ret

LLVM IR (-O0):
define void @Multiply44([4 x double]* %0, [4 x double]* %1, [4 x double]* %2) {
%4 = alloca [4 x double]*
%5 = alloca [4 x double]*
%6 = alloca [4 x double]*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store [4 x double]* %0, [4 x double]** %4
store [4 x double]* %1, [4 x double]** %5
store [4 x double]* %2, [4 x double]** %6
store i32 0, i32* %7
br label %10
10: ; preds = %62, %3
%11 = load i32, i32* %7
%12 = icmp slt i32 %11, 4
br i1 %12, label %13, label %65
13: ; preds = %10
store i32 0, i32* %8
br label %14
14: ; preds = %58, %13
%15 = load i32, i32* %8
%16 = icmp slt i32 %15, 4
br i1 %16, label %17, label %61
17: ; preds = %14
%18 = load [4 x double]*, [4 x double]** %6
%19 = load i32, i32* %7
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [4 x double], [4 x double]* %18, i64 %20
%22 = load i32, i32* %8
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [4 x double], [4 x double]* %21, i64 0, i64 %23
store double 0.000000e+00, double* %24
store i32 0, i32* %9
br label %25
25: ; preds = %54, %17
%26 = load i32, i32* %9
%27 = icmp slt i32 %26, 4
br i1 %27, label %28, label %57
28: ; preds = %25
%29 = load [4 x double]*, [4 x double]** %4
%30 = load i32, i32* %7
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [4 x double], [4 x double]* %29, i64 %31
%33 = load i32, i32* %9
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [4 x double], [4 x double]* %32, i64 0, i64 %34
%36 = load double, double* %35
%37 = load [4 x double]*, [4 x double]** %5
%38 = load i32, i32* %9
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [4 x double], [4 x double]* %37, i64 %39
%41 = load i32, i32* %8
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [4 x double], [4 x double]* %40, i64 0, i64 %42
%44 = load double, double* %43
%45 = load [4 x double]*, [4 x double]** %6
%46 = load i32, i32* %7
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [4 x double], [4 x double]* %45, i64 %47
%49 = load i32, i32* %8
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [4 x double], [4 x double]* %48, i64 0, i64 %50
%52 = load double, double* %51
%53 = call double @llvm.fmuladd.f64(double %36, double %44, double %52)
store double %53, double* %51
br label %54
54: ; preds = %28
%55 = load i32, i32* %9
%56 = add nsw i32 %55, 1
store i32 %56, i32* %9
br label %25
57: ; preds = %25
br label %58
58: ; preds = %57
%59 = load i32, i32* %8
%60 = add nsw i32 %59, 1
store i32 %60, i32* %8
br label %14
61: ; preds = %14
br label %62
62: ; preds = %61
%63 = load i32, i32* %7
%64 = add nsw i32 %63, 1
store i32 %64, i32* %7
br label %10
65: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @Multiply44([4 x double]* nocapture %0, [4 x double]* nocapture %1, [4 x double]* nocapture %2) {
%4 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 0
%5 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 1, i64 0
%6 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 2, i64 0
%7 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 3, i64 0
%8 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 1
%9 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 1, i64 1
%10 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 2, i64 1
%11 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 3, i64 1
%12 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 2
%13 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 1, i64 2
%14 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 2, i64 2
%15 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 3, i64 2
%16 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 3
%17 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 1, i64 3
%18 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 2, i64 3
%19 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 3, i64 3
br label %20
20: ; preds = %3, %20
%21 = phi i64 [ 0, %3 ], [ %78, %20 ]
%22 = getelementptr inbounds [4 x double], [4 x double]* %0, i64 %21, i64 0
%23 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 %21, i64 0
store double 0.000000e+00, double* %23
%24 = load double, double* %22
%25 = load double, double* %4
%26 = tail call double @llvm.fmuladd.f64(double %24, double %25, double 0.000000e+00)
store double %26, double* %23
%27 = getelementptr inbounds [4 x double], [4 x double]* %0, i64 %21, i64 1
%28 = load double, double* %27
%29 = load double, double* %5
%30 = tail call double @llvm.fmuladd.f64(double %28, double %29, double %26)
store double %30, double* %23
%31 = getelementptr inbounds [4 x double], [4 x double]* %0, i64 %21, i64 2
%32 = load double, double* %31
%33 = load double, double* %6
%34 = tail call double @llvm.fmuladd.f64(double %32, double %33, double %30)
store double %34, double* %23
%35 = getelementptr inbounds [4 x double], [4 x double]* %0, i64 %21, i64 3
%36 = load double, double* %35
%37 = load double, double* %7
%38 = tail call double @llvm.fmuladd.f64(double %36, double %37, double %34)
store double %38, double* %23
%39 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 %21, i64 1
store double 0.000000e+00, double* %39
%40 = load double, double* %22
%41 = load double, double* %8
%42 = tail call double @llvm.fmuladd.f64(double %40, double %41, double 0.000000e+00)
store double %42, double* %39
%43 = load double, double* %27
%44 = load double, double* %9
%45 = tail call double @llvm.fmuladd.f64(double %43, double %44, double %42)
store double %45, double* %39
%46 = load double, double* %31
%47 = load double, double* %10
%48 = tail call double @llvm.fmuladd.f64(double %46, double %47, double %45)
store double %48, double* %39
%49 = load double, double* %35
%50 = load double, double* %11
%51 = tail call double @llvm.fmuladd.f64(double %49, double %50, double %48)
store double %51, double* %39
%52 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 %21, i64 2
store double 0.000000e+00, double* %52
%53 = load double, double* %22
%54 = load double, double* %12
%55 = tail call double @llvm.fmuladd.f64(double %53, double %54, double 0.000000e+00)
store double %55, double* %52
%56 = load double, double* %27
%57 = load double, double* %13
%58 = tail call double @llvm.fmuladd.f64(double %56, double %57, double %55)
store double %58, double* %52
%59 = load double, double* %31
%60 = load double, double* %14
%61 = tail call double @llvm.fmuladd.f64(double %59, double %60, double %58)
store double %61, double* %52
%62 = load double, double* %35
%63 = load double, double* %15
%64 = tail call double @llvm.fmuladd.f64(double %62, double %63, double %61)
store double %64, double* %52
%65 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 %21, i64 3
store double 0.000000e+00, double* %65
%66 = load double, double* %22
%67 = load double, double* %16
%68 = tail call double @llvm.fmuladd.f64(double %66, double %67, double 0.000000e+00)
store double %68, double* %65
%69 = load double, double* %27
%70 = load double, double* %17
%71 = tail call double @llvm.fmuladd.f64(double %69, double %70, double %68)
store double %71, double* %65
%72 = load double, double* %31
%73 = load double, double* %18
%74 = tail call double @llvm.fmuladd.f64(double %72, double %73, double %71)
store double %74, double* %65
%75 = load double, double* %35
%76 = load double, double* %19
%77 = tail call double @llvm.fmuladd.f64(double %75, double %76, double %74)
store double %77, double* %65
%78 = add nuw nsw i64 %21, 1
%79 = icmp eq i64 %78, 4
br i1 %79, label %80, label %20
80: ; preds = %20
ret void
}