void negate_matrix(double *matrix) {
  double swap;
  swap = matrix[1];
  matrix[1] = matrix[4];
  matrix[4] = swap;
  swap = matrix[2];
  matrix[2] = matrix[8];
  matrix[8] = swap;
  swap = matrix[3];
  matrix[3] = matrix[12];
  matrix[12] = swap;
  swap = matrix[6];
  matrix[6] = matrix[9];
  matrix[9] = swap;
  swap = matrix[7];
  matrix[7] = matrix[13];
  matrix[13] = swap;
  swap = matrix[11];
  matrix[11] = matrix[14];
  matrix[14] = swap;
}


x86 assembly (clang, -O0):
<negate_matrix>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x20(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x20(%rax)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x40(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x40(%rax)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x60(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x18(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x60(%rax)
mov    -0x8(%rbp),%rax
movsd  0x30(%rax),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x48(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x30(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x48(%rax)
mov    -0x8(%rbp),%rax
movsd  0x38(%rax),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x68(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x38(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x68(%rax)
mov    -0x8(%rbp),%rax
movsd  0x58(%rax),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x70(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x58(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x70(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<negate_matrix>:
movsd  0x20(%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
movsd  0x10(%rdi),%xmm2
movsd  %xmm0,0x8(%rdi)
movsd  %xmm1,0x20(%rdi)
movsd  0x40(%rdi),%xmm0
movsd  %xmm0,0x10(%rdi)
movsd  %xmm2,0x40(%rdi)
movsd  0x18(%rdi),%xmm0
movsd  0x60(%rdi),%xmm1
movsd  %xmm1,0x18(%rdi)
movsd  %xmm0,0x60(%rdi)
movsd  0x30(%rdi),%xmm0
movsd  0x48(%rdi),%xmm1
movsd  %xmm1,0x30(%rdi)
movsd  %xmm0,0x48(%rdi)
movsd  0x38(%rdi),%xmm0
movsd  0x68(%rdi),%xmm1
movsd  %xmm1,0x38(%rdi)
movsd  %xmm0,0x68(%rdi)
movsd  0x58(%rdi),%xmm0
movsd  0x70(%rdi),%xmm1
movsd  %xmm1,0x58(%rdi)
movsd  %xmm0,0x70(%rdi)
ret

LLVM IR (-O0):
define void @negate_matrix(double* %0) {
%2 = alloca double*
%3 = alloca double
store double* %0, double** %2
%4 = load double*, double** %2
%5 = getelementptr inbounds double, double* %4, i64 1
%6 = load double, double* %5
store double %6, double* %3
%7 = load double*, double** %2
%8 = getelementptr inbounds double, double* %7, i64 4
%9 = load double, double* %8
%10 = load double*, double** %2
%11 = getelementptr inbounds double, double* %10, i64 1
store double %9, double* %11
%12 = load double, double* %3
%13 = load double*, double** %2
%14 = getelementptr inbounds double, double* %13, i64 4
store double %12, double* %14
%15 = load double*, double** %2
%16 = getelementptr inbounds double, double* %15, i64 2
%17 = load double, double* %16
store double %17, double* %3
%18 = load double*, double** %2
%19 = getelementptr inbounds double, double* %18, i64 8
%20 = load double, double* %19
%21 = load double*, double** %2
%22 = getelementptr inbounds double, double* %21, i64 2
store double %20, double* %22
%23 = load double, double* %3
%24 = load double*, double** %2
%25 = getelementptr inbounds double, double* %24, i64 8
store double %23, double* %25
%26 = load double*, double** %2
%27 = getelementptr inbounds double, double* %26, i64 3
%28 = load double, double* %27
store double %28, double* %3
%29 = load double*, double** %2
%30 = getelementptr inbounds double, double* %29, i64 12
%31 = load double, double* %30
%32 = load double*, double** %2
%33 = getelementptr inbounds double, double* %32, i64 3
store double %31, double* %33
%34 = load double, double* %3
%35 = load double*, double** %2
%36 = getelementptr inbounds double, double* %35, i64 12
store double %34, double* %36
%37 = load double*, double** %2
%38 = getelementptr inbounds double, double* %37, i64 6
%39 = load double, double* %38
store double %39, double* %3
%40 = load double*, double** %2
%41 = getelementptr inbounds double, double* %40, i64 9
%42 = load double, double* %41
%43 = load double*, double** %2
%44 = getelementptr inbounds double, double* %43, i64 6
store double %42, double* %44
%45 = load double, double* %3
%46 = load double*, double** %2
%47 = getelementptr inbounds double, double* %46, i64 9
store double %45, double* %47
%48 = load double*, double** %2
%49 = getelementptr inbounds double, double* %48, i64 7
%50 = load double, double* %49
store double %50, double* %3
%51 = load double*, double** %2
%52 = getelementptr inbounds double, double* %51, i64 13
%53 = load double, double* %52
%54 = load double*, double** %2
%55 = getelementptr inbounds double, double* %54, i64 7
store double %53, double* %55
%56 = load double, double* %3
%57 = load double*, double** %2
%58 = getelementptr inbounds double, double* %57, i64 13
store double %56, double* %58
%59 = load double*, double** %2
%60 = getelementptr inbounds double, double* %59, i64 11
%61 = load double, double* %60
store double %61, double* %3
%62 = load double*, double** %2
%63 = getelementptr inbounds double, double* %62, i64 14
%64 = load double, double* %63
%65 = load double*, double** %2
%66 = getelementptr inbounds double, double* %65, i64 11
store double %64, double* %66
%67 = load double, double* %3
%68 = load double*, double** %2
%69 = getelementptr inbounds double, double* %68, i64 14
store double %67, double* %69
ret void
}

LLVM IR (-O2):
define void @negate_matrix(double* nocapture %0) {
%2 = getelementptr inbounds double, double* %0, i64 1
%3 = load double, double* %2
%4 = getelementptr inbounds double, double* %0, i64 4
%5 = load double, double* %4
store double %5, double* %2
store double %3, double* %4
%6 = getelementptr inbounds double, double* %0, i64 2
%7 = load double, double* %6
%8 = getelementptr inbounds double, double* %0, i64 8
%9 = load double, double* %8
store double %9, double* %6
store double %7, double* %8
%10 = getelementptr inbounds double, double* %0, i64 3
%11 = load double, double* %10
%12 = getelementptr inbounds double, double* %0, i64 12
%13 = load double, double* %12
store double %13, double* %10
store double %11, double* %12
%14 = getelementptr inbounds double, double* %0, i64 6
%15 = load double, double* %14
%16 = getelementptr inbounds double, double* %0, i64 9
%17 = load double, double* %16
store double %17, double* %14
store double %15, double* %16
%18 = getelementptr inbounds double, double* %0, i64 7
%19 = load double, double* %18
%20 = getelementptr inbounds double, double* %0, i64 13
%21 = load double, double* %20
store double %21, double* %18
store double %19, double* %20
%22 = getelementptr inbounds double, double* %0, i64 11
%23 = load double, double* %22
%24 = getelementptr inbounds double, double* %0, i64 14
%25 = load double, double* %24
store double %25, double* %22
store double %23, double* %24
ret void
}