void six_mul_six(_Complex double c[6][6], _Complex double a[6][6],
                 _Complex double b[6][6]) {
  for (unsigned int i = 0; i < 6; ++i) {
    for (unsigned int j = 0; j < 6; ++j) {
      c[i][j] = 0;
      for (unsigned int k = 0; k < 6; ++k) {
        c[i][j] += a[i][k] * b[k][j];
      }
    }
  }
  return;
}


x86 assembly (clang, -O0):
<six_mul_six>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x6,-0x1c(%rbp)
jae    12b1 <six_mul_six+0x1b1>
movl   $0x0,-0x20(%rbp)
cmpl   $0x6,-0x20(%rbp)
jae    129e <six_mul_six+0x19e>
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
imul   $0x60,%rcx,%rcx
add    %rcx,%rax
mov    -0x20(%rbp),%ecx
shl    $0x4,%rcx
add    %rcx,%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
xorps  %xmm0,%xmm0
movsd  %xmm0,0x8(%rax)
movl   $0x0,-0x24(%rbp)
cmpl   $0x6,-0x24(%rbp)
jae    128b <six_mul_six+0x18b>
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
imul   $0x60,%rcx,%rcx
add    %rcx,%rax
mov    -0x24(%rbp),%ecx
shl    $0x4,%rcx
add    %rcx,%rax
movsd  (%rax),%xmm1
movsd  %xmm1,-0x68(%rbp)
movsd  0x8(%rax),%xmm2
movsd  %xmm2,-0x60(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x24(%rbp),%ecx
imul   $0x60,%rcx,%rcx
add    %rcx,%rax
mov    -0x20(%rbp),%ecx
shl    $0x4,%rcx
add    %rcx,%rax
movsd  (%rax),%xmm4
movsd  %xmm4,-0x58(%rbp)
movsd  0x8(%rax),%xmm5
movsd  %xmm5,-0x50(%rbp)
movaps %xmm1,%xmm0
mulsd  %xmm4,%xmm0
movaps %xmm2,%xmm3
mulsd  %xmm5,%xmm3
mulsd  %xmm5,%xmm1
mulsd  %xmm4,%xmm2
subsd  %xmm3,%xmm0
movsd  %xmm0,-0x48(%rbp)
addsd  %xmm2,%xmm1
movsd  %xmm1,-0x40(%rbp)
ucomisd %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  %xmm1,-0x30(%rbp)
jnp    1241 <six_mul_six+0x141>
movsd  -0x40(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm0
ucomisd %xmm1,%xmm1
movsd  %xmm0,-0x38(%rbp)
movsd  %xmm1,-0x30(%rbp)
jnp    1241 <six_mul_six+0x141>
movsd  -0x50(%rbp),%xmm3
movsd  -0x58(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm1
movsd  -0x68(%rbp),%xmm0
call   12c0 <__muldc3>
movsd  %xmm0,-0x38(%rbp)
movsd  %xmm1,-0x30(%rbp)
movsd  -0x38(%rbp),%xmm3
movsd  -0x30(%rbp),%xmm2
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
imul   $0x60,%rcx,%rcx
add    %rcx,%rax
mov    -0x20(%rbp),%ecx
shl    $0x4,%rcx
add    %rcx,%rax
movsd  (%rax),%xmm1
movsd  0x8(%rax),%xmm0
addsd  %xmm3,%xmm1
addsd  %xmm2,%xmm0
movsd  %xmm1,(%rax)
movsd  %xmm0,0x8(%rax)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1164 <six_mul_six+0x64>
jmp    1290 <six_mul_six+0x190>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    112c <six_mul_six+0x2c>
jmp    12a3 <six_mul_six+0x1a3>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111b <six_mul_six+0x1b>
add    $0x70,%rsp
pop    %rbp
ret
nopw   0x0(%rax,%rax,1)

x86 assembly (clang, -O2):
<six_mul_six>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
add    $0x8,%rdx
xor    %esi,%esi
xorps  %xmm7,%xmm7
jmp    1132 <six_mul_six+0x32>
nopl   0x0(%rax)
add    $0x1,%rsi
add    $0x60,%rbx
cmp    $0x6,%rsi
je     122b <six_mul_six+0x12b>
mov    %rdx,%r12
xor    %ebp,%ebp
jmp    114e <six_mul_six+0x4e>
nopl   0x0(%rax)
add    $0x1,%rbp
add    $0x10,%r12
cmp    $0x6,%rbp
je     1120 <six_mul_six+0x20>
lea    (%rsi,%rsi,2),%rax
shl    $0x5,%rax
add    %rdi,%rax
mov    %rbp,%rcx
shl    $0x4,%rcx
lea    (%rax,%rcx,1),%r14
movups %xmm7,(%rcx,%rax,1)
xorpd  %xmm5,%xmm5
mov    $0xffffffffffffffa0,%r15
mov    %r12,%r13
cs nopw 0x0(%rax,%rax,1)
movupd 0x60(%rbx,%r15,1),%xmm0
movsd  -0x8(%r13),%xmm2
movsd  0x0(%r13),%xmm3
movapd %xmm3,%xmm1
unpcklpd %xmm3,%xmm1
movapd %xmm0,%xmm4
shufpd $0x1,%xmm0,%xmm4
mulpd  %xmm1,%xmm4
movapd %xmm2,%xmm1
unpcklpd %xmm2,%xmm1
mulpd  %xmm0,%xmm1
movapd %xmm1,%xmm6
subpd  %xmm4,%xmm6
addpd  %xmm4,%xmm1
movapd %xmm1,%xmm4
movsd  %xmm6,%xmm4
ucomisd %xmm6,%xmm6
jp     11e6 <six_mul_six+0xe6>
addpd  %xmm4,%xmm5
movupd %xmm5,(%r14)
add    $0x60,%r13
add    $0x10,%r15
jne    1180 <six_mul_six+0x80>
jmp    1140 <six_mul_six+0x40>
unpckhpd %xmm1,%xmm1
ucomisd %xmm1,%xmm1
jnp    11ce <six_mul_six+0xce>
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
mov    %rdx,0x10(%rsp)
mov    %rdi,0x8(%rsp)
mov    %rsi,(%rsp)
call   1240 <__muldc3>
xorps  %xmm7,%xmm7
mov    (%rsp),%rsi
mov    0x8(%rsp),%rdi
mov    0x10(%rsp),%rdx
movapd %xmm0,%xmm4
movupd (%r14),%xmm5
unpcklpd %xmm1,%xmm4
jmp    11ce <six_mul_six+0xce>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
nopw   0x0(%rax,%rax,1)

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

LLVM IR (-O2):
define void @six_mul_six([6 x { double, double }]* nocapture %0, [6 x { double, double }]* nocapture %1, [6 x { double, double }]* nocapture %2) {
br label %4
4: ; preds = %3, %7
%5 = phi i64 [ 0, %3 ], [ %8, %7 ]
br label %10
6: ; preds = %7
ret void
7: ; preds = %16
%8 = add nuw nsw i64 %5, 1
%9 = icmp eq i64 %8, 6
br i1 %9, label %6, label %4
10: ; preds = %4, %16
%11 = phi i64 [ 0, %4 ], [ %17, %16 ]
%12 = getelementptr inbounds [6 x { double, double }], [6 x { double, double }]* %0, i64 %5, i64 %11, i32 0
%13 = bitcast double* %12 to i8*
%14 = bitcast double* %12 to <2 x double>*
%15 = bitcast double* %12 to <2 x double>*
br label %19
16: ; preds = %53
%17 = add nuw nsw i64 %11, 1
%18 = icmp eq i64 %17, 6
br i1 %18, label %7, label %10
19: ; preds = %10, %53
%20 = phi i64 [ 0, %10 ], [ %57, %53 ]
%21 = phi <2 x double> [ zeroinitializer, %10 ], [ %56, %53 ]
%22 = getelementptr inbounds [6 x { double, double }], [6 x { double, double }]* %1, i64 %5, i64 %20, i32 0
%23 = bitcast double* %22 to <2 x double>*
%24 = load <2 x double>, <2 x double>* %23
%25 = getelementptr inbounds [6 x { double, double }], [6 x { double, double }]* %2, i64 %20, i64 %11, i32 0
%26 = load double, double* %25
%27 = getelementptr inbounds [6 x { double, double }], [6 x { double, double }]* %2, i64 %20, i64 %11, i32 1
%28 = load double, double* %27
%29 = insertelement <2 x double> poison, double %28, i64 0
%30 = shufflevector <2 x double> %29, <2 x double> poison, <2 x i32> zeroinitializer
%31 = fmul <2 x double> %24, %30
%32 = shufflevector <2 x double> %31, <2 x double> poison, <2 x i32> <i32 1, i32 0>
%33 = insertelement <2 x double> poison, double %26, i64 0
%34 = shufflevector <2 x double> %33, <2 x double> poison, <2 x i32> zeroinitializer
%35 = fmul <2 x double> %24, %34
%36 = fsub <2 x double> %35, %32
%37 = fadd <2 x double> %35, %32
%38 = shufflevector <2 x double> %36, <2 x double> %37, <2 x i32> <i32 0, i32 3>
%39 = extractelement <2 x double> %36, i64 0
%40 = fcmp uno double %39, 0.000000e+00
br i1 %40, label %41, label %53
41: ; preds = %19
%42 = extractelement <2 x double> %37, i64 1
%43 = fcmp uno double %42, 0.000000e+00
br i1 %43, label %44, label %53
44: ; preds = %41
%45 = extractelement <2 x double> %24, i64 0
%46 = extractelement <2 x double> %24, i64 1
%47 = tail call { double, double } @__muldc3(double %45, double %46, double %26, double %28)
%48 = extractvalue { double, double } %47, 0
%49 = extractvalue { double, double } %47, 1
%50 = load <2 x double>, <2 x double>* %14
%51 = insertelement <2 x double> poison, double %48, i64 0
%52 = insertelement <2 x double> %51, double %49, i64 1
br label %53
53: ; preds = %44, %41, %19
%54 = phi <2 x double> [ %38, %19 ], [ %38, %41 ], [ %52, %44 ]
%55 = phi <2 x double> [ %21, %19 ], [ %21, %41 ], [ %50, %44 ]
%56 = fadd <2 x double> %54, %55
store <2 x double> %56, <2 x double>* %15
%57 = add nuw nsw i64 %20, 1
%58 = icmp eq i64 %57, 6
br i1 %58, label %16, label %19
}