void gpu_rotation_generator_z(const float m[9], float ans[9]) {
  ans[0] = -m[1];
  ans[1] = m[0];
  ans[2] = 0;
  ans[3] = -m[4];
  ans[4] = m[3];
  ans[5] = 0;
  ans[6] = -m[7];
  ans[7] = m[6];
  ans[8] = 0;
}


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

x86 assembly (clang, -O2):
<gpu_rotation_generator_z>:
movss  0x4(%rdi),%xmm0
movaps 0xef4(%rip),%xmm1
xorps  %xmm1,%xmm0
movss  %xmm0,(%rsi)
movss  (%rdi),%xmm0
movss  %xmm0,0x4(%rsi)
movl   $0x0,0x8(%rsi)
movss  0x10(%rdi),%xmm0
xorps  %xmm1,%xmm0
movss  %xmm0,0xc(%rsi)
movss  0xc(%rdi),%xmm0
movss  %xmm0,0x10(%rsi)
movl   $0x0,0x14(%rsi)
movss  0x1c(%rdi),%xmm0
xorps  %xmm1,%xmm0
movss  %xmm0,0x18(%rsi)
movss  0x18(%rdi),%xmm0
movss  %xmm0,0x1c(%rsi)
movl   $0x0,0x20(%rsi)
ret

LLVM IR (-O0):
define void @gpu_rotation_generator_z(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = getelementptr inbounds float, float* %5, i64 1
%7 = load float, float* %6
%8 = fneg float %7
%9 = load float*, float** %4
%10 = getelementptr inbounds float, float* %9, i64 0
store float %8, float* %10
%11 = load float*, float** %3
%12 = getelementptr inbounds float, float* %11, i64 0
%13 = load float, float* %12
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 1
store float %13, float* %15
%16 = load float*, float** %4
%17 = getelementptr inbounds float, float* %16, i64 2
store float 0.000000e+00, float* %17
%18 = load float*, float** %3
%19 = getelementptr inbounds float, float* %18, i64 4
%20 = load float, float* %19
%21 = fneg float %20
%22 = load float*, float** %4
%23 = getelementptr inbounds float, float* %22, i64 3
store float %21, float* %23
%24 = load float*, float** %3
%25 = getelementptr inbounds float, float* %24, i64 3
%26 = load float, float* %25
%27 = load float*, float** %4
%28 = getelementptr inbounds float, float* %27, i64 4
store float %26, float* %28
%29 = load float*, float** %4
%30 = getelementptr inbounds float, float* %29, i64 5
store float 0.000000e+00, float* %30
%31 = load float*, float** %3
%32 = getelementptr inbounds float, float* %31, i64 7
%33 = load float, float* %32
%34 = fneg float %33
%35 = load float*, float** %4
%36 = getelementptr inbounds float, float* %35, i64 6
store float %34, float* %36
%37 = load float*, float** %3
%38 = getelementptr inbounds float, float* %37, i64 6
%39 = load float, float* %38
%40 = load float*, float** %4
%41 = getelementptr inbounds float, float* %40, i64 7
store float %39, float* %41
%42 = load float*, float** %4
%43 = getelementptr inbounds float, float* %42, i64 8
store float 0.000000e+00, float* %43
ret void
}

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