void add_shift_6x6(_Complex double a[6][6], const double mshift) {
  for (int i = 0; i < 6; i++) {
    a[i][i] += mshift;
  }
  return;
}


x86 assembly (clang, -O0):
<add_shift_6x6>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x6,-0x14(%rbp)
jge    1161 <add_shift_6x6+0x61>
movsd  -0x10(%rbp),%xmm2
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   $0x60,%rcx,%rcx
add    %rcx,%rax
movslq -0x14(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
movsd  (%rax),%xmm1
movsd  0x8(%rax),%xmm0
addsd  %xmm2,%xmm1
movsd  %xmm1,(%rax)
movsd  %xmm0,0x8(%rax)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1114 <add_shift_6x6+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_shift_6x6>:
movsd  (%rdi),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rdi)
movsd  0x70(%rdi),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x70(%rdi)
movsd  0xe0(%rdi),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0xe0(%rdi)
movsd  0x150(%rdi),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x150(%rdi)
movsd  0x1c0(%rdi),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x1c0(%rdi)
addsd  0x230(%rdi),%xmm0
movsd  %xmm0,0x230(%rdi)
ret

LLVM IR (-O0):
define void @add_shift_6x6([6 x { double, double }]* %0, double %1) {
%3 = alloca [6 x { double, double }]*
%4 = alloca double
%5 = alloca i32
store [6 x { double, double }]* %0, [6 x { double, double }]** %3
store double %1, double* %4
store i32 0, i32* %5
br label %6
6: ; preds = %25, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 6
br i1 %8, label %9, label %28
9: ; preds = %6
%10 = load double, double* %4
%11 = load [6 x { double, double }]*, [6 x { double, double }]** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [6 x { double, double }], [6 x { double, double }]* %11, i64 %13
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [6 x { double, double }], [6 x { double, double }]* %14, i64 0, i64 %16
%18 = getelementptr inbounds { double, double }, { double, double }* %17, i32 0, i32 0
%19 = load double, double* %18
%20 = getelementptr inbounds { double, double }, { double, double }* %17, i32 0, i32 1
%21 = load double, double* %20
%22 = fadd double %19, %10
%23 = getelementptr inbounds { double, double }, { double, double }* %17, i32 0, i32 0
%24 = getelementptr inbounds { double, double }, { double, double }* %17, i32 0, i32 1
store double %22, double* %23
store double %21, double* %24
br label %25
25: ; preds = %9
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 1
store i32 %27, i32* %5
br label %6
28: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @add_shift_6x6([6 x { double, double }]* nocapture %0, double %1) {
%3 = getelementptr inbounds [6 x { double, double }], [6 x { double, double }]* %0, i64 0, i64 0, i32 0
%4 = load double, double* %3
%5 = fadd double %4, %1
store double %5, double* %3
%6 = getelementptr inbounds [6 x { double, double }], [6 x { double, double }]* %0, i64 1, i64 1, i32 0
%7 = load double, double* %6
%8 = fadd double %7, %1
store double %8, double* %6
%9 = getelementptr inbounds [6 x { double, double }], [6 x { double, double }]* %0, i64 2, i64 2, i32 0
%10 = load double, double* %9
%11 = fadd double %10, %1
store double %11, double* %9
%12 = getelementptr inbounds [6 x { double, double }], [6 x { double, double }]* %0, i64 3, i64 3, i32 0
%13 = load double, double* %12
%14 = fadd double %13, %1
store double %14, double* %12
%15 = getelementptr inbounds [6 x { double, double }], [6 x { double, double }]* %0, i64 4, i64 4, i32 0
%16 = load double, double* %15
%17 = fadd double %16, %1
store double %17, double* %15
%18 = getelementptr inbounds [6 x { double, double }], [6 x { double, double }]* %0, i64 5, i64 5, i32 0
%19 = load double, double* %18
%20 = fadd double %19, %1
store double %20, double* %18
ret void
}