float *mat3_negative(float *result, float *m) {
  result[0] = -m[0];
  result[1] = -m[1];
  result[2] = -m[2];
  result[3] = -m[3];
  result[4] = -m[4];
  result[5] = -m[5];
  result[6] = -m[6];
  result[7] = -m[7];
  result[8] = -m[8];
  return result;
}


x86 assembly (clang, -O0):
<mat3_negative>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movss  0xc(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0xc(%rax)
mov    -0x10(%rbp),%rax
movss  0x10(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x10(%rax)
mov    -0x10(%rbp),%rax
movss  0x14(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x14(%rax)
mov    -0x10(%rbp),%rax
movss  0x18(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x18(%rax)
mov    -0x10(%rbp),%rax
movss  0x1c(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x1c(%rax)
mov    -0x10(%rbp),%rax
movss  0x20(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x20(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat3_negative>:
mov    %rdi,%rax
movss  (%rsi),%xmm1
movaps 0xef2(%rip),%xmm0
xorps  %xmm0,%xmm1
movss  %xmm1,(%rdi)
movss  0x4(%rsi),%xmm1
xorps  %xmm0,%xmm1
movss  %xmm1,0x4(%rdi)
movss  0x8(%rsi),%xmm1
xorps  %xmm0,%xmm1
movss  %xmm1,0x8(%rdi)
movss  0xc(%rsi),%xmm1
xorps  %xmm0,%xmm1
movss  %xmm1,0xc(%rdi)
movss  0x10(%rsi),%xmm1
xorps  %xmm0,%xmm1
movss  %xmm1,0x10(%rdi)
movss  0x14(%rsi),%xmm1
xorps  %xmm0,%xmm1
movss  %xmm1,0x14(%rdi)
movss  0x18(%rsi),%xmm1
xorps  %xmm0,%xmm1
movss  %xmm1,0x18(%rdi)
movss  0x1c(%rsi),%xmm1
xorps  %xmm0,%xmm1
movss  %xmm1,0x1c(%rdi)
movss  0x20(%rsi),%xmm1
xorps  %xmm0,%xmm1
movss  %xmm1,0x20(%rdi)
ret

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

LLVM IR (-O2):
define float* @mat3_negative(float* returned writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = fneg float %3
store float %4, float* %0
%5 = getelementptr inbounds float, float* %1, i64 1
%6 = load float, float* %5
%7 = fneg float %6
%8 = getelementptr inbounds float, float* %0, i64 1
store float %7, float* %8
%9 = getelementptr inbounds float, float* %1, i64 2
%10 = load float, float* %9
%11 = fneg float %10
%12 = getelementptr inbounds float, float* %0, i64 2
store float %11, float* %12
%13 = getelementptr inbounds float, float* %1, i64 3
%14 = load float, float* %13
%15 = fneg float %14
%16 = getelementptr inbounds float, float* %0, i64 3
store float %15, float* %16
%17 = getelementptr inbounds float, float* %1, i64 4
%18 = load float, float* %17
%19 = fneg float %18
%20 = getelementptr inbounds float, float* %0, i64 4
store float %19, float* %20
%21 = getelementptr inbounds float, float* %1, i64 5
%22 = load float, float* %21
%23 = fneg float %22
%24 = getelementptr inbounds float, float* %0, i64 5
store float %23, float* %24
%25 = getelementptr inbounds float, float* %1, i64 6
%26 = load float, float* %25
%27 = fneg float %26
%28 = getelementptr inbounds float, float* %0, i64 6
store float %27, float* %28
%29 = getelementptr inbounds float, float* %1, i64 7
%30 = load float, float* %29
%31 = fneg float %30
%32 = getelementptr inbounds float, float* %0, i64 7
store float %31, float* %32
%33 = getelementptr inbounds float, float* %1, i64 8
%34 = load float, float* %33
%35 = fneg float %34
%36 = getelementptr inbounds float, float* %0, i64 8
store float %35, float* %36
ret float* %0
}