#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double M_PI;
float cos(float);
int /*<<< orphan*/ gfks_vector_length(float *, float, float, float);
float sin(float);
void gfks_set_matrix_rotation(float m[], float a, float x, float y, float z) {
  m[3] = 0;
  m[7] = 0;
  m[11] = 0;
  m[12] = 0;
  m[13] = 0;
  m[14] = 0;
  m[15] = 1;
  a *= M_PI / 180.0;
  float s = sin(a);
  float c = cos(a);
  if (x == 1.0 && y == 0.0 && z == 0.0) {
    m[5] = c;
    m[10] = c;
    m[6] = s;
    m[9] = -s;
    m[1] = 0;
    m[2] = 0;
    m[4] = 0;
    m[8] = 0;
    m[0] = 1;
  } else if (x == 0.0 && y == 1.0 && z == 0.0) {
    m[0] = c;
    m[10] = c;
    m[8] = s;
    m[2] = -s;
    m[1] = 0;
    m[4] = 0;
    m[6] = 0;
    m[9] = 0;
    m[5] = 1;
  } else if (x == 0.0 && y == 0.0 && z == 1.0) {
    m[0] = c;
    m[5] = c;
    m[1] = s;
    m[4] = -s;
    m[2] = 0;
    m[6] = 0;
    m[8] = 0;
    m[9] = 0;
    m[10] = 1;
  } else {
    float length;
    gfks_vector_length(&length, x, y, z);
    if (length != 1.0) {
      float r_len = 1 / length;
      x *= r_len;
      y *= r_len;
      z *= r_len;
    }
    float nc = 1.0 - c;
    float xy = x * y;
    float yz = y * z;
    float zx = z * x;
    float xs = x * s;
    float ys = y * s;
    float zs = z * s;
    m[0] = x * x * nc + c;
    m[4] = xy * nc - zs;
    m[8] = zx * nc + ys;
    m[1] = xy * nc + zs;
    m[5] = y * y * nc + c;
    m[9] = yz * nc - xs;
    m[2] = zx * nc - ys;
    m[6] = yz * nc + xs;
    m[10] = z * z * nc + c;
  }
}


x86 assembly (clang, -O0):
<gfks_set_matrix_rotation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
movss  %xmm3,-0x18(%rbp)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0xc(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x1c(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x2c(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x30(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x34(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x38(%rax)
mov    -0x8(%rbp),%rax
movss  0xe6c(%rip),%xmm0
movss  %xmm0,0x3c(%rax)
mov    0x2e38(%rip),%rax
movsd  (%rax),%xmm1
movsd  0xe4c(%rip),%xmm0
divsd  %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
call   1040 <sin@plt>
movss  %xmm0,-0x1c(%rbp)
movss  -0xc(%rbp),%xmm0
call   1050 <cos@plt>
movss  %xmm0,-0x20(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdfb(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    12d7 <gfks_set_matrix_rotation+0x1a7>
jp     12d7 <gfks_set_matrix_rotation+0x1a7>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    12d7 <gfks_set_matrix_rotation+0x1a7>
jp     12d7 <gfks_set_matrix_rotation+0x1a7>
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    12d7 <gfks_set_matrix_rotation+0x1a7>
jp     12d7 <gfks_set_matrix_rotation+0x1a7>
movss  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x14(%rax)
movss  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x28(%rax)
movss  -0x1c(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x18(%rax)
movss  -0x1c(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x24(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x10(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x20(%rax)
mov    -0x8(%rbp),%rax
movss  0xd42(%rip),%xmm0
movss  %xmm0,(%rax)
jmp    16f1 <gfks_set_matrix_rotation+0x5c1>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    13ba <gfks_set_matrix_rotation+0x28a>
jp     13ba <gfks_set_matrix_rotation+0x28a>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xcfc(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    13ba <gfks_set_matrix_rotation+0x28a>
jp     13ba <gfks_set_matrix_rotation+0x28a>
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    13ba <gfks_set_matrix_rotation+0x28a>
jp     13ba <gfks_set_matrix_rotation+0x28a>
movss  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x28(%rax)
movss  -0x1c(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x20(%rax)
movss  -0x1c(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x10(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x18(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x24(%rax)
mov    -0x8(%rbp),%rax
movss  0xc60(%rip),%xmm0
movss  %xmm0,0x14(%rax)
jmp    16ec <gfks_set_matrix_rotation+0x5bc>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    149d <gfks_set_matrix_rotation+0x36d>
jp     149d <gfks_set_matrix_rotation+0x36d>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    149d <gfks_set_matrix_rotation+0x36d>
jp     149d <gfks_set_matrix_rotation+0x36d>
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xbfd(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    149d <gfks_set_matrix_rotation+0x36d>
jp     149d <gfks_set_matrix_rotation+0x36d>
movss  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x14(%rax)
movss  -0x1c(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
movss  -0x1c(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x10(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x18(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x20(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x24(%rax)
mov    -0x8(%rbp),%rax
movss  0xb7d(%rip),%xmm0
movss  %xmm0,0x28(%rax)
jmp    16e7 <gfks_set_matrix_rotation+0x5b7>
movss  -0x10(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
movss  -0x18(%rbp),%xmm2
lea    -0x24(%rbp),%rdi
call   1030 <gfks_vector_length@plt>
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xb3a(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    14db <gfks_set_matrix_rotation+0x3ab>
jp     14db <gfks_set_matrix_rotation+0x3ab>
jmp    151a <gfks_set_matrix_rotation+0x3ea>
movss  0xb2d(%rip),%xmm0
divss  -0x24(%rbp),%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x28(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x28(%rbp),%xmm0
mulss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x28(%rbp),%xmm0
mulss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xad5(%rip),%xmm0
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x10(%rbp),%xmm0
mulss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x14(%rbp),%xmm0
mulss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x18(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x38(%rbp)
movss  -0x10(%rbp),%xmm0
mulss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x3c(%rbp)
movss  -0x14(%rbp),%xmm0
mulss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x40(%rbp)
movss  -0x18(%rbp),%xmm0
mulss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x44(%rbp)
movss  -0x10(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  -0x2c(%rbp),%xmm2
movss  -0x20(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x30(%rbp),%xmm0
movss  -0x2c(%rbp),%xmm2
movss  -0x44(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x10(%rax)
movss  -0x38(%rbp),%xmm0
movss  -0x2c(%rbp),%xmm2
movss  -0x40(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x20(%rax)
movss  -0x30(%rbp),%xmm0
movss  -0x2c(%rbp),%xmm2
movss  -0x44(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
movss  -0x14(%rbp),%xmm0
mulss  -0x14(%rbp),%xmm0
movss  -0x2c(%rbp),%xmm2
movss  -0x20(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x14(%rax)
movss  -0x34(%rbp),%xmm0
movss  -0x2c(%rbp),%xmm2
movss  -0x3c(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x24(%rax)
movss  -0x38(%rbp),%xmm0
movss  -0x2c(%rbp),%xmm2
movss  -0x40(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
movss  -0x34(%rbp),%xmm0
movss  -0x2c(%rbp),%xmm2
movss  -0x3c(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x18(%rax)
movss  -0x18(%rbp),%xmm0
mulss  -0x18(%rbp),%xmm0
movss  -0x2c(%rbp),%xmm2
movss  -0x20(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x28(%rax)
jmp    16ec <gfks_set_matrix_rotation+0x5bc>
jmp    16f1 <gfks_set_matrix_rotation+0x5c1>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gfks_set_matrix_rotation>:
push   %rbx
sub    $0x30,%rsp
movss  %xmm3,0x18(%rsp)
movss  %xmm2,0x14(%rsp)
movss  %xmm1,0x10(%rsp)
mov    %rdi,%rbx
movl   $0x0,0xc(%rdi)
movl   $0x0,0x1c(%rdi)
xorps  %xmm1,%xmm1
movups %xmm1,0x2c(%rdi)
movl   $0x3f800000,0x3c(%rdi)
mov    0x2e7b(%rip),%rax
movsd  (%rax),%xmm1
divsd  0xe87(%rip),%xmm1
cvtss2sd %xmm0,%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0xc(%rsp)
call   1040 <sin@plt>
movaps %xmm0,0x20(%rsp)
movss  0xc(%rsp),%xmm0
call   1050 <cos@plt>
movss  0x10(%rsp),%xmm5
movss  0x14(%rsp),%xmm1
movss  0x18(%rsp),%xmm2
ucomiss 0xe4f(%rip),%xmm5
jne    1212 <gfks_set_matrix_rotation+0xe2>
jp     1212 <gfks_set_matrix_rotation+0xe2>
xorps  %xmm3,%xmm3
ucomiss %xmm3,%xmm1
jne    1212 <gfks_set_matrix_rotation+0xe2>
jp     1212 <gfks_set_matrix_rotation+0xe2>
ucomiss %xmm3,%xmm2
jne    1212 <gfks_set_matrix_rotation+0xe2>
jp     1212 <gfks_set_matrix_rotation+0xe2>
movss  %xmm0,0x14(%rbx)
movss  %xmm0,0x28(%rbx)
movaps 0x20(%rsp),%xmm1
movss  %xmm1,0x18(%rbx)
movaps 0xe27(%rip),%xmm0
xorps  %xmm1,%xmm0
movss  %xmm0,0x24(%rbx)
movq   $0x0,0x4(%rbx)
movl   $0x0,0x10(%rbx)
movl   $0x0,0x20(%rbx)
movl   $0x3f800000,(%rbx)
jmp    1411 <gfks_set_matrix_rotation+0x2e1>
xorps  %xmm4,%xmm4
ucomiss %xmm4,%xmm5
jne    127b <gfks_set_matrix_rotation+0x14b>
jp     127b <gfks_set_matrix_rotation+0x14b>
ucomiss 0xde5(%rip),%xmm1
jne    127b <gfks_set_matrix_rotation+0x14b>
jp     127b <gfks_set_matrix_rotation+0x14b>
xorps  %xmm3,%xmm3
ucomiss %xmm3,%xmm2
jne    127b <gfks_set_matrix_rotation+0x14b>
jp     127b <gfks_set_matrix_rotation+0x14b>
movss  %xmm0,(%rbx)
movss  %xmm0,0x28(%rbx)
movaps 0x20(%rsp),%xmm1
movss  %xmm1,0x20(%rbx)
movaps 0xdc5(%rip),%xmm0
xorps  %xmm1,%xmm0
movss  %xmm0,0x8(%rbx)
movl   $0x0,0x4(%rbx)
movabs $0x3f80000000000000,%rax
mov    %rax,0x10(%rbx)
movl   $0x0,0x18(%rbx)
movl   $0x0,0x24(%rbx)
jmp    1411 <gfks_set_matrix_rotation+0x2e1>
ucomiss %xmm4,%xmm5
jne    12db <gfks_set_matrix_rotation+0x1ab>
jp     12db <gfks_set_matrix_rotation+0x1ab>
xorps  %xmm3,%xmm3
ucomiss %xmm3,%xmm1
jne    12db <gfks_set_matrix_rotation+0x1ab>
jp     12db <gfks_set_matrix_rotation+0x1ab>
ucomiss 0xd75(%rip),%xmm2
jne    12db <gfks_set_matrix_rotation+0x1ab>
jp     12db <gfks_set_matrix_rotation+0x1ab>
movss  %xmm0,(%rbx)
movss  %xmm0,0x14(%rbx)
movaps 0x20(%rsp),%xmm1
movss  %xmm1,0x4(%rbx)
movaps 0xd5f(%rip),%xmm0
xorps  %xmm1,%xmm0
movss  %xmm0,0x10(%rbx)
movl   $0x0,0x8(%rbx)
movl   $0x0,0x18(%rbx)
movq   $0x0,0x20(%rbx)
movl   $0x3f800000,0x28(%rbx)
jmp    1411 <gfks_set_matrix_rotation+0x2e1>
movss  %xmm0,0xc(%rsp)
lea    0x1c(%rsp),%rdi
movaps %xmm5,%xmm0
call   1030 <gfks_vector_length@plt>
movss  0x1c(%rsp),%xmm0
ucomiss 0xd0d(%rip),%xmm0
jne    12ff <gfks_set_matrix_rotation+0x1cf>
jnp    1337 <gfks_set_matrix_rotation+0x207>
movss  0xd01(%rip),%xmm1
divss  %xmm0,%xmm1
movss  0x10(%rsp),%xmm6
mulss  %xmm1,%xmm6
movss  0x14(%rsp),%xmm2
mulss  %xmm1,%xmm2
movss  0x18(%rsp),%xmm7
mulss  %xmm1,%xmm7
movss  0xc(%rsp),%xmm9
movaps 0x20(%rsp),%xmm4
jmp    1355 <gfks_set_matrix_rotation+0x225>
movss  0x18(%rsp),%xmm7
movss  0x14(%rsp),%xmm2
movss  0xc(%rsp),%xmm9
movaps 0x20(%rsp),%xmm4
movss  0x10(%rsp),%xmm6
movss  0xcab(%rip),%xmm0
subss  %xmm9,%xmm0
movaps %xmm2,%xmm5
mulss  %xmm6,%xmm5
movaps %xmm7,%xmm1
mulss  %xmm2,%xmm1
movaps %xmm7,%xmm3
mulss  %xmm6,%xmm3
movaps %xmm4,%xmm8
mulss  %xmm6,%xmm8
movaps %xmm4,%xmm10
mulss  %xmm2,%xmm10
mulss  %xmm7,%xmm4
mulss  %xmm6,%xmm6
mulss  %xmm0,%xmm6
addss  %xmm9,%xmm6
movss  %xmm6,(%rbx)
mulss  %xmm0,%xmm5
movaps %xmm5,%xmm6
subss  %xmm4,%xmm6
movss  %xmm6,0x10(%rbx)
mulss  %xmm0,%xmm3
movaps %xmm3,%xmm6
addss  %xmm10,%xmm6
movss  %xmm6,0x20(%rbx)
addss  %xmm4,%xmm5
movss  %xmm5,0x4(%rbx)
mulss  %xmm2,%xmm2
mulss  %xmm0,%xmm2
addss  %xmm9,%xmm2
movss  %xmm2,0x14(%rbx)
mulss  %xmm0,%xmm1
movaps %xmm1,%xmm5
subss  %xmm8,%xmm5
movss  %xmm5,0x24(%rbx)
subss  %xmm10,%xmm3
movss  %xmm3,0x8(%rbx)
addss  %xmm8,%xmm1
movss  %xmm1,0x18(%rbx)
mulss  %xmm7,%xmm7
mulss  %xmm0,%xmm7
addss  %xmm9,%xmm7
movss  %xmm7,0x28(%rbx)
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define void @gfks_set_matrix_rotation(float* %0, float %1, float %2, float %3, float %4) {
%6 = alloca float*
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca float
%16 = alloca float
%17 = alloca float
%18 = alloca float
%19 = alloca float
%20 = alloca float
%21 = alloca float
store float* %0, float** %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store float %4, float* %10
%22 = load float*, float** %6
%23 = getelementptr inbounds float, float* %22, i64 3
store float 0.000000e+00, float* %23
%24 = load float*, float** %6
%25 = getelementptr inbounds float, float* %24, i64 7
store float 0.000000e+00, float* %25
%26 = load float*, float** %6
%27 = getelementptr inbounds float, float* %26, i64 11
store float 0.000000e+00, float* %27
%28 = load float*, float** %6
%29 = getelementptr inbounds float, float* %28, i64 12
store float 0.000000e+00, float* %29
%30 = load float*, float** %6
%31 = getelementptr inbounds float, float* %30, i64 13
store float 0.000000e+00, float* %31
%32 = load float*, float** %6
%33 = getelementptr inbounds float, float* %32, i64 14
store float 0.000000e+00, float* %33
%34 = load float*, float** %6
%35 = getelementptr inbounds float, float* %34, i64 15
store float 1.000000e+00, float* %35
%36 = load double, double* @M_PI
%37 = fdiv double %36, 1.800000e+02
%38 = load float, float* %7
%39 = fpext float %38 to double
%40 = fmul double %39, %37
%41 = fptrunc double %40 to float
store float %41, float* %7
%42 = load float, float* %7
%43 = call float @sin(float %42)
store float %43, float* %11
%44 = load float, float* %7
%45 = call float @cos(float %44)
store float %45, float* %12
%46 = load float, float* %8
%47 = fpext float %46 to double
%48 = fcmp oeq double %47, 1.000000e+00
br i1 %48, label %49, label %81
49: ; preds = %5
%50 = load float, float* %9
%51 = fpext float %50 to double
%52 = fcmp oeq double %51, 0.000000e+00
br i1 %52, label %53, label %81
53: ; preds = %49
%54 = load float, float* %10
%55 = fpext float %54 to double
%56 = fcmp oeq double %55, 0.000000e+00
br i1 %56, label %57, label %81
57: ; preds = %53
%58 = load float, float* %12
%59 = load float*, float** %6
%60 = getelementptr inbounds float, float* %59, i64 5
store float %58, float* %60
%61 = load float, float* %12
%62 = load float*, float** %6
%63 = getelementptr inbounds float, float* %62, i64 10
store float %61, float* %63
%64 = load float, float* %11
%65 = load float*, float** %6
%66 = getelementptr inbounds float, float* %65, i64 6
store float %64, float* %66
%67 = load float, float* %11
%68 = fneg float %67
%69 = load float*, float** %6
%70 = getelementptr inbounds float, float* %69, i64 9
store float %68, float* %70
%71 = load float*, float** %6
%72 = getelementptr inbounds float, float* %71, i64 1
store float 0.000000e+00, float* %72
%73 = load float*, float** %6
%74 = getelementptr inbounds float, float* %73, i64 2
store float 0.000000e+00, float* %74
%75 = load float*, float** %6
%76 = getelementptr inbounds float, float* %75, i64 4
store float 0.000000e+00, float* %76
%77 = load float*, float** %6
%78 = getelementptr inbounds float, float* %77, i64 8
store float 0.000000e+00, float* %78
%79 = load float*, float** %6
%80 = getelementptr inbounds float, float* %79, i64 0
store float 1.000000e+00, float* %80
br label %261
81: ; preds = %53, %49, %5
%82 = load float, float* %8
%83 = fpext float %82 to double
%84 = fcmp oeq double %83, 0.000000e+00
br i1 %84, label %85, label %117
85: ; preds = %81
%86 = load float, float* %9
%87 = fpext float %86 to double
%88 = fcmp oeq double %87, 1.000000e+00
br i1 %88, label %89, label %117
89: ; preds = %85
%90 = load float, float* %10
%91 = fpext float %90 to double
%92 = fcmp oeq double %91, 0.000000e+00
br i1 %92, label %93, label %117
93: ; preds = %89
%94 = load float, float* %12
%95 = load float*, float** %6
%96 = getelementptr inbounds float, float* %95, i64 0
store float %94, float* %96
%97 = load float, float* %12
%98 = load float*, float** %6
%99 = getelementptr inbounds float, float* %98, i64 10
store float %97, float* %99
%100 = load float, float* %11
%101 = load float*, float** %6
%102 = getelementptr inbounds float, float* %101, i64 8
store float %100, float* %102
%103 = load float, float* %11
%104 = fneg float %103
%105 = load float*, float** %6
%106 = getelementptr inbounds float, float* %105, i64 2
store float %104, float* %106
%107 = load float*, float** %6
%108 = getelementptr inbounds float, float* %107, i64 1
store float 0.000000e+00, float* %108
%109 = load float*, float** %6
%110 = getelementptr inbounds float, float* %109, i64 4
store float 0.000000e+00, float* %110
%111 = load float*, float** %6
%112 = getelementptr inbounds float, float* %111, i64 6
store float 0.000000e+00, float* %112
%113 = load float*, float** %6
%114 = getelementptr inbounds float, float* %113, i64 9
store float 0.000000e+00, float* %114
%115 = load float*, float** %6
%116 = getelementptr inbounds float, float* %115, i64 5
store float 1.000000e+00, float* %116
br label %260
117: ; preds = %89, %85, %81
%118 = load float, float* %8
%119 = fpext float %118 to double
%120 = fcmp oeq double %119, 0.000000e+00
br i1 %120, label %121, label %153
121: ; preds = %117
%122 = load float, float* %9
%123 = fpext float %122 to double
%124 = fcmp oeq double %123, 0.000000e+00
br i1 %124, label %125, label %153
125: ; preds = %121
%126 = load float, float* %10
%127 = fpext float %126 to double
%128 = fcmp oeq double %127, 1.000000e+00
br i1 %128, label %129, label %153
129: ; preds = %125
%130 = load float, float* %12
%131 = load float*, float** %6
%132 = getelementptr inbounds float, float* %131, i64 0
store float %130, float* %132
%133 = load float, float* %12
%134 = load float*, float** %6
%135 = getelementptr inbounds float, float* %134, i64 5
store float %133, float* %135
%136 = load float, float* %11
%137 = load float*, float** %6
%138 = getelementptr inbounds float, float* %137, i64 1
store float %136, float* %138
%139 = load float, float* %11
%140 = fneg float %139
%141 = load float*, float** %6
%142 = getelementptr inbounds float, float* %141, i64 4
store float %140, float* %142
%143 = load float*, float** %6
%144 = getelementptr inbounds float, float* %143, i64 2
store float 0.000000e+00, float* %144
%145 = load float*, float** %6
%146 = getelementptr inbounds float, float* %145, i64 6
store float 0.000000e+00, float* %146
%147 = load float*, float** %6
%148 = getelementptr inbounds float, float* %147, i64 8
store float 0.000000e+00, float* %148
%149 = load float*, float** %6
%150 = getelementptr inbounds float, float* %149, i64 9
store float 0.000000e+00, float* %150
%151 = load float*, float** %6
%152 = getelementptr inbounds float, float* %151, i64 10
store float 1.000000e+00, float* %152
br label %259
153: ; preds = %125, %121, %117
%154 = load float, float* %8
%155 = load float, float* %9
%156 = load float, float* %10
%157 = call i32 @gfks_vector_length(float* %13, float %154, float %155, float %156)
%158 = load float, float* %13
%159 = fpext float %158 to double
%160 = fcmp une double %159, 1.000000e+00
br i1 %160, label %161, label %173
161: ; preds = %153
%162 = load float, float* %13
%163 = fdiv float 1.000000e+00, %162
store float %163, float* %14
%164 = load float, float* %14
%165 = load float, float* %8
%166 = fmul float %165, %164
store float %166, float* %8
%167 = load float, float* %14
%168 = load float, float* %9
%169 = fmul float %168, %167
store float %169, float* %9
%170 = load float, float* %14
%171 = load float, float* %10
%172 = fmul float %171, %170
store float %172, float* %10
br label %173
173: ; preds = %161, %153
%174 = load float, float* %12
%175 = fpext float %174 to double
%176 = fsub double 1.000000e+00, %175
%177 = fptrunc double %176 to float
store float %177, float* %15
%178 = load float, float* %8
%179 = load float, float* %9
%180 = fmul float %178, %179
store float %180, float* %16
%181 = load float, float* %9
%182 = load float, float* %10
%183 = fmul float %181, %182
store float %183, float* %17
%184 = load float, float* %10
%185 = load float, float* %8
%186 = fmul float %184, %185
store float %186, float* %18
%187 = load float, float* %8
%188 = load float, float* %11
%189 = fmul float %187, %188
store float %189, float* %19
%190 = load float, float* %9
%191 = load float, float* %11
%192 = fmul float %190, %191
store float %192, float* %20
%193 = load float, float* %10
%194 = load float, float* %11
%195 = fmul float %193, %194
store float %195, float* %21
%196 = load float, float* %8
%197 = load float, float* %8
%198 = fmul float %196, %197
%199 = load float, float* %15
%200 = load float, float* %12
%201 = call float @llvm.fmuladd.f32(float %198, float %199, float %200)
%202 = load float*, float** %6
%203 = getelementptr inbounds float, float* %202, i64 0
store float %201, float* %203
%204 = load float, float* %16
%205 = load float, float* %15
%206 = load float, float* %21
%207 = fneg float %206
%208 = call float @llvm.fmuladd.f32(float %204, float %205, float %207)
%209 = load float*, float** %6
%210 = getelementptr inbounds float, float* %209, i64 4
store float %208, float* %210
%211 = load float, float* %18
%212 = load float, float* %15
%213 = load float, float* %20
%214 = call float @llvm.fmuladd.f32(float %211, float %212, float %213)
%215 = load float*, float** %6
%216 = getelementptr inbounds float, float* %215, i64 8
store float %214, float* %216
%217 = load float, float* %16
%218 = load float, float* %15
%219 = load float, float* %21
%220 = call float @llvm.fmuladd.f32(float %217, float %218, float %219)
%221 = load float*, float** %6
%222 = getelementptr inbounds float, float* %221, i64 1
store float %220, float* %222
%223 = load float, float* %9
%224 = load float, float* %9
%225 = fmul float %223, %224
%226 = load float, float* %15
%227 = load float, float* %12
%228 = call float @llvm.fmuladd.f32(float %225, float %226, float %227)
%229 = load float*, float** %6
%230 = getelementptr inbounds float, float* %229, i64 5
store float %228, float* %230
%231 = load float, float* %17
%232 = load float, float* %15
%233 = load float, float* %19
%234 = fneg float %233
%235 = call float @llvm.fmuladd.f32(float %231, float %232, float %234)
%236 = load float*, float** %6
%237 = getelementptr inbounds float, float* %236, i64 9
store float %235, float* %237
%238 = load float, float* %18
%239 = load float, float* %15
%240 = load float, float* %20
%241 = fneg float %240
%242 = call float @llvm.fmuladd.f32(float %238, float %239, float %241)
%243 = load float*, float** %6
%244 = getelementptr inbounds float, float* %243, i64 2
store float %242, float* %244
%245 = load float, float* %17
%246 = load float, float* %15
%247 = load float, float* %19
%248 = call float @llvm.fmuladd.f32(float %245, float %246, float %247)
%249 = load float*, float** %6
%250 = getelementptr inbounds float, float* %249, i64 6
store float %248, float* %250
%251 = load float, float* %10
%252 = load float, float* %10
%253 = fmul float %251, %252
%254 = load float, float* %15
%255 = load float, float* %12
%256 = call float @llvm.fmuladd.f32(float %253, float %254, float %255)
%257 = load float*, float** %6
%258 = getelementptr inbounds float, float* %257, i64 10
store float %256, float* %258
br label %259
259: ; preds = %173, %129
br label %260
260: ; preds = %259, %93
br label %261
261: ; preds = %260, %57
ret void
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define void @gfks_set_matrix_rotation(float* writeonly %0, float %1, float %2, float %3, float %4) {
%6 = alloca float
%7 = getelementptr inbounds float, float* %0, i64 3
store float 0.000000e+00, float* %7
%8 = getelementptr inbounds float, float* %0, i64 7
store float 0.000000e+00, float* %8
%9 = getelementptr inbounds float, float* %0, i64 11
%10 = getelementptr inbounds float, float* %0, i64 15
%11 = bitcast float* %9 to i8*
store float 1.000000e+00, float* %10
%12 = load double, double* @M_PI
%13 = fdiv double %12, 1.800000e+02
%14 = fpext float %1 to double
%15 = fmul double %13, %14
%16 = fptrunc double %15 to float
%17 = tail call float @sin(float %16)
%18 = tail call float @cos(float %16)
%19 = fcmp oeq float %2, 1.000000e+00
%20 = fcmp oeq float %3, 0.000000e+00
%21 = and i1 %19, %20
%22 = fcmp oeq float %4, 0.000000e+00
%23 = and i1 %21, %22
br i1 %23, label %24, label %34
24: ; preds = %5
%25 = getelementptr inbounds float, float* %0, i64 5
store float %18, float* %25
%26 = getelementptr inbounds float, float* %0, i64 10
store float %18, float* %26
%27 = getelementptr inbounds float, float* %0, i64 6
store float %17, float* %27
%28 = fneg float %17
%29 = getelementptr inbounds float, float* %0, i64 9
store float %28, float* %29
%30 = getelementptr inbounds float, float* %0, i64 1
store float 0.000000e+00, float* %30
%31 = getelementptr inbounds float, float* %0, i64 2
store float 0.000000e+00, float* %31
%32 = getelementptr inbounds float, float* %0, i64 4
store float 0.000000e+00, float* %32
%33 = getelementptr inbounds float, float* %0, i64 8
store float 0.000000e+00, float* %33
store float 1.000000e+00, float* %0
br label %107
34: ; preds = %5
%35 = fcmp oeq float %2, 0.000000e+00
%36 = fcmp oeq float %3, 1.000000e+00
%37 = and i1 %35, %36
%38 = and i1 %37, %22
br i1 %38, label %39, label %49
39: ; preds = %34
store float %18, float* %0
%40 = getelementptr inbounds float, float* %0, i64 10
store float %18, float* %40
%41 = getelementptr inbounds float, float* %0, i64 8
store float %17, float* %41
%42 = fneg float %17
%43 = getelementptr inbounds float, float* %0, i64 2
store float %42, float* %43
%44 = getelementptr inbounds float, float* %0, i64 1
store float 0.000000e+00, float* %44
%45 = getelementptr inbounds float, float* %0, i64 4
store float 0.000000e+00, float* %45
%46 = getelementptr inbounds float, float* %0, i64 6
store float 0.000000e+00, float* %46
%47 = getelementptr inbounds float, float* %0, i64 9
store float 0.000000e+00, float* %47
%48 = getelementptr inbounds float, float* %0, i64 5
store float 1.000000e+00, float* %48
br label %107
49: ; preds = %34
%50 = and i1 %35, %20
%51 = fcmp oeq float %4, 1.000000e+00
%52 = and i1 %50, %51
br i1 %52, label %53, label %63
53: ; preds = %49
store float %18, float* %0
%54 = getelementptr inbounds float, float* %0, i64 5
store float %18, float* %54
%55 = getelementptr inbounds float, float* %0, i64 1
store float %17, float* %55
%56 = fneg float %17
%57 = getelementptr inbounds float, float* %0, i64 4
store float %56, float* %57
%58 = getelementptr inbounds float, float* %0, i64 2
store float 0.000000e+00, float* %58
%59 = getelementptr inbounds float, float* %0, i64 6
store float 0.000000e+00, float* %59
%60 = getelementptr inbounds float, float* %0, i64 8
store float 0.000000e+00, float* %60
%61 = getelementptr inbounds float, float* %0, i64 9
store float 0.000000e+00, float* %61
%62 = getelementptr inbounds float, float* %0, i64 10
store float 1.000000e+00, float* %62
br label %107
63: ; preds = %49
%64 = bitcast float* %6 to i8*
%65 = call i32 @gfks_vector_length(float* %6, float %2, float %3, float %4)
%66 = load float, float* %6
%67 = fcmp une float %66, 1.000000e+00
br i1 %67, label %68, label %73
68: ; preds = %63
%69 = fdiv float 1.000000e+00, %66
%70 = fmul float %69, %2
%71 = fmul float %69, %3
%72 = fmul float %69, %4
br label %73
73: ; preds = %68, %63
%74 = phi float [ %72, %68 ], [ %4, %63 ]
%75 = phi float [ %71, %68 ], [ %3, %63 ]
%76 = phi float [ %70, %68 ], [ %2, %63 ]
%77 = fsub float 1.000000e+00, %18
%78 = fmul float %75, %76
%79 = fmul float %74, %75
%80 = fmul float %74, %76
%81 = fmul float %17, %76
%82 = fmul float %17, %75
%83 = fmul float %17, %74
%84 = fmul float %76, %76
%85 = call float @llvm.fmuladd.f32(float %84, float %77, float %18)
store float %85, float* %0
%86 = fneg float %83
%87 = call float @llvm.fmuladd.f32(float %78, float %77, float %86)
%88 = getelementptr inbounds float, float* %0, i64 4
store float %87, float* %88
%89 = call float @llvm.fmuladd.f32(float %80, float %77, float %82)
%90 = getelementptr inbounds float, float* %0, i64 8
store float %89, float* %90
%91 = call float @llvm.fmuladd.f32(float %78, float %77, float %83)
%92 = getelementptr inbounds float, float* %0, i64 1
store float %91, float* %92
%93 = fmul float %75, %75
%94 = call float @llvm.fmuladd.f32(float %93, float %77, float %18)
%95 = getelementptr inbounds float, float* %0, i64 5
store float %94, float* %95
%96 = fneg float %81
%97 = call float @llvm.fmuladd.f32(float %79, float %77, float %96)
%98 = getelementptr inbounds float, float* %0, i64 9
store float %97, float* %98
%99 = fneg float %82
%100 = call float @llvm.fmuladd.f32(float %80, float %77, float %99)
%101 = getelementptr inbounds float, float* %0, i64 2
store float %100, float* %101
%102 = call float @llvm.fmuladd.f32(float %79, float %77, float %81)
%103 = getelementptr inbounds float, float* %0, i64 6
store float %102, float* %103
%104 = fmul float %74, %74
%105 = call float @llvm.fmuladd.f32(float %104, float %77, float %18)
%106 = getelementptr inbounds float, float* %0, i64 10
store float %105, float* %106
br label %107
107: ; preds = %39, %73, %53, %24
ret void
}