__attribute__((no)) void calculate(const double *__restrict__ A,
                                   const double *__restrict__ B,
                                   double *__restrict__ C) {
  unsigned int m = 0;
  unsigned int n = 0;
  unsigned int k = 0;
  A = (const double *)__builtin_assume_aligned(A, 16);
  B = (const double *)__builtin_assume_aligned(B, 16);
  C = (double *)__builtin_assume_aligned(C, 16);
  for (n = 0; n < 9; n++) {
    for (m = 0; m < 10; m++) {
      C[(n * 10) + m] = 0.0;
    }
    for (k = 0; k < 17; k++) {
#pragma simd
      for (m = 0; m < 10; m++) {
        C[(n * 10) + m] += A[(k * 20) + m] * B[(n * 20) + k];
      }
    }
  }
}


x86 assembly (clang, -O0):
<calculate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0x9,-0x20(%rbp)
jae    121b <calculate+0x11b>
movl   $0x0,-0x1c(%rbp)
cmpl   $0xa,-0x1c(%rbp)
jae    1182 <calculate+0x82>
mov    -0x18(%rbp),%rax
imul   $0xa,-0x20(%rbp),%ecx
add    -0x1c(%rbp),%ecx
mov    %ecx,%ecx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1155 <calculate+0x55>
movl   $0x0,-0x24(%rbp)
cmpl   $0x11,-0x24(%rbp)
jae    1208 <calculate+0x108>
movl   $0x0,-0x1c(%rbp)
cmpl   $0xa,-0x1c(%rbp)
jae    11f5 <calculate+0xf5>
mov    -0x8(%rbp),%rax
imul   $0x14,-0x24(%rbp),%ecx
add    -0x1c(%rbp),%ecx
mov    %ecx,%ecx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
imul   $0x14,-0x20(%rbp),%ecx
add    -0x24(%rbp),%ecx
mov    %ecx,%ecx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x18(%rbp),%rax
imul   $0xa,-0x20(%rbp),%ecx
add    -0x1c(%rbp),%ecx
mov    %ecx,%ecx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    119a <calculate+0x9a>
jmp    11fa <calculate+0xfa>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1189 <calculate+0x89>
jmp    120d <calculate+0x10d>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1144 <calculate+0x44>
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate>:
add    $0x40,%rdi
xor    %r8d,%r8d
xorps  %xmm8,%xmm8
nopl   0x0(%rax,%rax,1)
lea    (%r8,%r8,1),%rax
lea    (%rax,%rax,4),%r9
movaps %xmm8,0x10(%rdx,%r9,8)
movaps %xmm8,0x20(%rdx,%r9,8)
movaps %xmm8,0x30(%rdx,%r9,8)
movaps %xmm8,0x40(%rdx,%r9,8)
movaps %xmm8,(%rdx,%r9,8)
movapd 0x10(%rdx,%r9,8),%xmm0
movapd 0x20(%rdx,%r9,8),%xmm5
movapd 0x30(%rdx,%r9,8),%xmm6
movapd 0x40(%rdx,%r9,8),%xmm7
xorpd  %xmm14,%xmm14
movhpd 0x8(%rdx,%r9,8),%xmm14
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movapd %xmm7,%xmm13
movapd %xmm6,%xmm12
movapd %xmm5,%xmm11
movapd %xmm0,%xmm10
movapd %xmm14,%xmm9
movsd  (%rsi,%rcx,8),%xmm1
unpcklpd %xmm1,%xmm1
movapd -0x40(%rax),%xmm15
mulpd  %xmm1,%xmm15
movapd %xmm15,%xmm14
addpd  %xmm9,%xmm14
movapd -0x30(%rax),%xmm3
mulpd  %xmm1,%xmm3
movapd %xmm3,%xmm0
addpd  %xmm10,%xmm0
movapd -0x20(%rax),%xmm4
mulpd  %xmm1,%xmm4
movapd %xmm4,%xmm5
addpd  %xmm11,%xmm5
movapd -0x10(%rax),%xmm2
mulpd  %xmm1,%xmm2
movapd %xmm2,%xmm6
addpd  %xmm12,%xmm6
mulpd  (%rax),%xmm1
movapd %xmm1,%xmm7
addpd  %xmm13,%xmm7
add    $0x1,%rcx
add    $0xa0,%rax
cmp    $0x11,%rcx
jne    1170 <calculate+0x70>
addpd  %xmm13,%xmm1
addpd  %xmm12,%xmm2
addpd  %xmm11,%xmm4
addpd  %xmm10,%xmm3
addpd  %xmm9,%xmm15
movapd %xmm15,(%rdx,%r9,8)
movapd %xmm3,0x10(%rdx,%r9,8)
movapd %xmm4,0x20(%rdx,%r9,8)
movapd %xmm2,0x30(%rdx,%r9,8)
movapd %xmm1,0x40(%rdx,%r9,8)
add    $0x1,%r8
add    $0xa0,%rsi
cmp    $0x9,%r8
jne    1110 <calculate+0x10>
ret

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

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