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


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

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

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

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