int matVectToRot(double *v1[3], double *v2[3], double *mat) {
  double px, py, pz, qx, qy, qz, rx, ry, rz;
  double ux, uy, uz, vx, vy, vz, wx, wy, wz;
  double a, b, c, d, e, f, g, h, i;
  double detm;
  double detx1, detx2, detx3;
  double dety1, dety2, dety3;
  double detz1, detz2, detz3;
  px = v2[0][0];
  py = v2[0][1];
  pz = v2[0][2];
  qx = v2[1][0];
  qy = v2[1][1];
  qz = v2[1][2];
  rx = v2[2][0];
  ry = v2[2][1];
  rz = v2[2][2];
  ux = v1[0][0];
  uy = v1[0][1];
  uz = v1[0][2];
  vx = v1[1][0];
  vy = v1[1][1];
  vz = v1[1][2];
  wx = v1[2][0];
  wy = v1[2][1];
  wz = v1[2][2];
  detm = px * (qy * rz - qz * ry) - py * (qx * rz - qz * rx) +
         pz * (qx * ry - qy * rx);
  if (detm == 0.0) {
    return -1;
  }
  detx1 = ux * (qy * rz - qz * ry) - py * (vx * rz - qz * wx) +
          pz * (vx * ry - qy * wx);
  detx2 = px * (vx * rz - qz * wx) - ux * (qx * rz - qz * rx) +
          pz * (qx * wx - vx * rx);
  detx3 = px * (qy * wx - vx * ry) - py * (qx * wx - vx * rx) +
          ux * (qx * ry - qy * rx);
  dety1 = uy * (qy * rz - qz * ry) - py * (vy * rz - qz * wy) +
          pz * (vy * ry - qy * wy);
  dety2 = px * (vy * rz - qz * wy) - uy * (qx * rz - qz * rx) +
          pz * (qx * wy - vy * rx);
  dety3 = px * (qy * wy - vy * ry) - py * (qx * wy - vy * rx) +
          uy * (qx * ry - qy * rx);
  detz1 = uz * (qy * rz - qz * ry) - py * (vz * rz - qz * wz) +
          pz * (vz * ry - qy * wz);
  detz2 = px * (vz * rz - qz * wz) - uz * (qx * rz - qz * rx) +
          pz * (qx * wz - vz * rx);
  detz3 = px * (qy * wz - vz * ry) - py * (qx * wz - vz * rx) +
          uz * (qx * ry - qy * rx);
  a = detx1 / detm;
  b = detx2 / detm;
  c = detx3 / detm;
  d = dety1 / detm;
  e = dety2 / detm;
  f = dety3 / detm;
  g = detz1 / detm;
  h = detz2 / detm;
  i = detz3 / detm;
  mat[0] = a;
  mat[1] = b;
  mat[2] = c;
  mat[3] = 0.0;
  mat[4] = d;
  mat[5] = e;
  mat[6] = f;
  mat[7] = 0.0;
  mat[8] = g;
  mat[9] = h;
  mat[10] = i;
  mat[11] = 0.0;
  mat[12] = 0.0;
  mat[13] = 0.0;
  mat[14] = 0.0;
  mat[15] = 1.0;
  return 0;
}


x86 assembly (clang, -O0):
<matVectToRot>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc8,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x28(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm3
movsd  -0x50(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm3,%xmm2
addsd  %xmm0,%xmm2
movsd  -0x30(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm3
movsd  -0x68(%rbp),%xmm5
movsd  -0x50(%rbp),%xmm4
mulsd  -0x58(%rbp),%xmm4
movq   %xmm4,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm4
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm4
movsd  -0x48(%rbp),%xmm3
mulsd  -0x58(%rbp),%xmm3
movq   %xmm3,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm3
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
movsd  -0x100(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1363 <matVectToRot+0x263>
jp     1363 <matVectToRot+0x263>
movl   $0xffffffff,-0x4(%rbp)
jmp    1d52 <matVectToRot+0xc52>
movsd  -0x70(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm3
movsd  -0x50(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm3,%xmm2
addsd  %xmm0,%xmm2
movsd  -0x30(%rbp),%xmm0
movsd  -0x88(%rbp),%xmm3
ff
movsd  -0x68(%rbp),%xmm5
movsd  -0x50(%rbp),%xmm4
mulsd  -0xa0(%rbp),%xmm4
ff
movq   %xmm4,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm4
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
movsd  -0x88(%rbp),%xmm2
ff
movsd  -0x60(%rbp),%xmm4
movsd  -0x48(%rbp),%xmm3
mulsd  -0xa0(%rbp),%xmm3
ff
movq   %xmm3,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm3
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x108(%rbp)
ff
movsd  -0x28(%rbp),%xmm1
movsd  -0x88(%rbp),%xmm2
ff
movsd  -0x68(%rbp),%xmm3
movsd  -0x50(%rbp),%xmm0
mulsd  -0xa0(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm3,%xmm2
addsd  %xmm0,%xmm2
movsd  -0x70(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm3
movsd  -0x68(%rbp),%xmm5
movsd  -0x50(%rbp),%xmm4
mulsd  -0x58(%rbp),%xmm4
movq   %xmm4,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm4
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
movsd  -0xa0(%rbp),%xmm4
ff
movsd  -0x88(%rbp),%xmm3
ff
mulsd  -0x58(%rbp),%xmm3
movq   %xmm3,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm3
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x110(%rbp)
ff
movsd  -0x28(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm2
movsd  -0xa0(%rbp),%xmm3
ff
movsd  -0x88(%rbp),%xmm0
ff
mulsd  -0x60(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm3,%xmm2
addsd  %xmm0,%xmm2
movsd  -0x30(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm3
movsd  -0xa0(%rbp),%xmm5
ff
movsd  -0x88(%rbp),%xmm4
ff
mulsd  -0x58(%rbp),%xmm4
movq   %xmm4,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm4
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm4
movsd  -0x48(%rbp),%xmm3
mulsd  -0x58(%rbp),%xmm3
movq   %xmm3,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm3
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x118(%rbp)
ff
movsd  -0x78(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm3
movsd  -0x50(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm3,%xmm2
addsd  %xmm0,%xmm2
movsd  -0x30(%rbp),%xmm0
movsd  -0x90(%rbp),%xmm3
ff
movsd  -0x68(%rbp),%xmm5
movsd  -0x50(%rbp),%xmm4
mulsd  -0xa8(%rbp),%xmm4
ff
movq   %xmm4,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm4
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
movsd  -0x90(%rbp),%xmm2
ff
movsd  -0x60(%rbp),%xmm4
movsd  -0x48(%rbp),%xmm3
mulsd  -0xa8(%rbp),%xmm3
ff
movq   %xmm3,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm3
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x120(%rbp)
ff
movsd  -0x28(%rbp),%xmm1
movsd  -0x90(%rbp),%xmm2
ff
movsd  -0x68(%rbp),%xmm3
movsd  -0x50(%rbp),%xmm0
mulsd  -0xa8(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm3,%xmm2
addsd  %xmm0,%xmm2
movsd  -0x78(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm3
movsd  -0x68(%rbp),%xmm5
movsd  -0x50(%rbp),%xmm4
mulsd  -0x58(%rbp),%xmm4
movq   %xmm4,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm4
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
movsd  -0xa8(%rbp),%xmm4
ff
movsd  -0x90(%rbp),%xmm3
ff
mulsd  -0x58(%rbp),%xmm3
movq   %xmm3,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm3
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x128(%rbp)
ff
movsd  -0x28(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm2
movsd  -0xa8(%rbp),%xmm3
ff
movsd  -0x90(%rbp),%xmm0
ff
mulsd  -0x60(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm3,%xmm2
addsd  %xmm0,%xmm2
movsd  -0x30(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm3
movsd  -0xa8(%rbp),%xmm5
ff
movsd  -0x90(%rbp),%xmm4
ff
mulsd  -0x58(%rbp),%xmm4
movq   %xmm4,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm4
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x78(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm4
movsd  -0x48(%rbp),%xmm3
mulsd  -0x58(%rbp),%xmm3
movq   %xmm3,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm3
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x130(%rbp)
ff
movsd  -0x80(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm3
movsd  -0x50(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm3,%xmm2
addsd  %xmm0,%xmm2
movsd  -0x30(%rbp),%xmm0
movsd  -0x98(%rbp),%xmm3
ff
movsd  -0x68(%rbp),%xmm5
movsd  -0x50(%rbp),%xmm4
mulsd  -0xb0(%rbp),%xmm4
ff
movq   %xmm4,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm4
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
movsd  -0x98(%rbp),%xmm2
ff
movsd  -0x60(%rbp),%xmm4
movsd  -0x48(%rbp),%xmm3
mulsd  -0xb0(%rbp),%xmm3
ff
movq   %xmm3,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm3
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x138(%rbp)
ff
movsd  -0x28(%rbp),%xmm1
movsd  -0x98(%rbp),%xmm2
ff
movsd  -0x68(%rbp),%xmm3
movsd  -0x50(%rbp),%xmm0
mulsd  -0xb0(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm3,%xmm2
addsd  %xmm0,%xmm2
movsd  -0x80(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm3
movsd  -0x68(%rbp),%xmm5
movsd  -0x50(%rbp),%xmm4
mulsd  -0x58(%rbp),%xmm4
movq   %xmm4,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm4
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
movsd  -0xb0(%rbp),%xmm4
ff
movsd  -0x98(%rbp),%xmm3
ff
mulsd  -0x58(%rbp),%xmm3
movq   %xmm3,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm3
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x140(%rbp)
ff
movsd  -0x28(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm2
movsd  -0xb0(%rbp),%xmm3
ff
movsd  -0x98(%rbp),%xmm0
ff
mulsd  -0x60(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm3,%xmm2
addsd  %xmm0,%xmm2
movsd  -0x30(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm3
movsd  -0xb0(%rbp),%xmm5
ff
movsd  -0x98(%rbp),%xmm4
ff
mulsd  -0x58(%rbp),%xmm4
movq   %xmm4,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm4
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x80(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm4
movsd  -0x48(%rbp),%xmm3
mulsd  -0x58(%rbp),%xmm3
movq   %xmm3,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm3
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x148(%rbp)
ff
movsd  -0x108(%rbp),%xmm0
ff
divsd  -0x100(%rbp),%xmm0
ff
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x110(%rbp),%xmm0
ff
divsd  -0x100(%rbp),%xmm0
ff
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x118(%rbp),%xmm0
ff
divsd  -0x100(%rbp),%xmm0
ff
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x120(%rbp),%xmm0
ff
divsd  -0x100(%rbp),%xmm0
ff
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x128(%rbp),%xmm0
ff
divsd  -0x100(%rbp),%xmm0
ff
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0x130(%rbp),%xmm0
ff
divsd  -0x100(%rbp),%xmm0
ff
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0x138(%rbp),%xmm0
ff
divsd  -0x100(%rbp),%xmm0
ff
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0x140(%rbp),%xmm0
ff
divsd  -0x100(%rbp),%xmm0
ff
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0x148(%rbp),%xmm0
ff
divsd  -0x100(%rbp),%xmm0
ff
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  -0xb8(%rbp),%xmm0
ff
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0xc0(%rbp),%xmm0
ff
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0xc8(%rbp),%xmm0
ff
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x20(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x18(%rax)
movsd  -0xd0(%rbp),%xmm0
ff
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x20(%rax)
movsd  -0xd8(%rbp),%xmm0
ff
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x28(%rax)
movsd  -0xe0(%rbp),%xmm0
ff
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x30(%rax)
mov    -0x20(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x38(%rax)
movsd  -0xe8(%rbp),%xmm0
ff
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x40(%rax)
movsd  -0xf0(%rbp),%xmm0
ff
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x48(%rax)
movsd  -0xf8(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x50(%rax)
mov    -0x20(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x58(%rax)
mov    -0x20(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x60(%rax)
mov    -0x20(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x68(%rax)
mov    -0x20(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x70(%rax)
mov    -0x20(%rbp),%rax
movsd  0x2ba(%rip),%xmm0
movsd  %xmm0,0x78(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xc8,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matVectToRot>:
sub    $0x28,%rsp
mov    (%rsi),%rax
mov    0x8(%rsi),%rcx
movsd  (%rax),%xmm12
movsd  0x8(%rax),%xmm6
movsd  0x10(%rax),%xmm14
movsd  (%rcx),%xmm15
movsd  0x8(%rcx),%xmm8
movsd  0x10(%rcx),%xmm4
mov    0x10(%rsi),%rax
movsd  (%rax),%xmm2
movsd  0x8(%rax),%xmm11
movsd  0x10(%rax),%xmm10
movapd %xmm11,%xmm0
mulsd  %xmm4,%xmm0
movapd %xmm8,%xmm1
mulsd  %xmm10,%xmm1
subsd  %xmm0,%xmm1
movapd %xmm2,%xmm3
mulsd  %xmm4,%xmm3
movapd %xmm15,%xmm13
mulsd  %xmm10,%xmm13
subsd  %xmm3,%xmm13
movapd %xmm13,%xmm3
mulsd  %xmm6,%xmm3
movapd %xmm12,%xmm5
mulsd  %xmm1,%xmm5
subsd  %xmm3,%xmm5
movapd %xmm2,%xmm3
mulsd  %xmm8,%xmm3
movapd %xmm15,%xmm9
mulsd  %xmm11,%xmm15
subsd  %xmm3,%xmm15
movapd %xmm14,-0x50(%rsp)
mulsd  %xmm15,%xmm14
addsd  %xmm5,%xmm14
mov    $0xffffffff,%eax
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm14
jne    11c3 <matVectToRot+0xc3>
jp     11c3 <matVectToRot+0xc3>
add    $0x28,%rsp
ret
mov    0x8(%rdi),%rax
mov    0x10(%rdi),%rcx
movapd %xmm2,-0x60(%rsp)
movsd  (%rcx),%xmm2
movapd 0xe23(%rip),%xmm7
xorpd  %xmm7,%xmm4
movapd %xmm4,-0x40(%rsp)
movapd %xmm2,%xmm5
mulsd  %xmm4,%xmm5
movsd  (%rax),%xmm4
movapd %xmm4,%xmm3
mulsd  %xmm10,%xmm3
addsd  %xmm5,%xmm3
mov    (%rdi),%rsi
xorpd  %xmm7,%xmm6
movsd  (%rsi),%xmm0
movapd %xmm0,-0x70(%rsp)
movapd %xmm0,%xmm5
xorpd  %xmm7,%xmm5
movapd %xmm6,-0x20(%rsp)
unpcklpd %xmm5,%xmm6
movapd %xmm1,%xmm5
unpcklpd %xmm3,%xmm5
unpcklpd %xmm13,%xmm3
mulpd  %xmm3,%xmm6
movapd %xmm0,%xmm3
unpcklpd %xmm12,%xmm3
mulpd  %xmm5,%xmm3
addpd  %xmm6,%xmm3
movapd %xmm8,%xmm5
movapd %xmm7,%xmm0
xorpd  %xmm7,%xmm5
movapd %xmm5,%xmm7
movapd %xmm5,-0x30(%rsp)
movapd %xmm4,%xmm5
xorpd  %xmm0,%xmm5
movapd %xmm7,%xmm6
unpcklpd %xmm5,%xmm6
movapd %xmm2,%xmm5
unpcklpd -0x60(%rsp),%xmm5
mulpd  %xmm5,%xmm6
movapd %xmm11,%xmm5
mulsd  %xmm4,%xmm5
movapd %xmm9,%xmm0
unpcklpd %xmm9,%xmm4
movapd %xmm11,%xmm7
unpcklpd %xmm2,%xmm7
mulpd  %xmm4,%xmm7
addpd  %xmm6,%xmm7
movapd -0x50(%rsp),%xmm4
unpcklpd %xmm4,%xmm4
movapd %xmm4,-0x50(%rsp)
mulpd  %xmm7,%xmm4
addpd  %xmm3,%xmm4
movapd %xmm4,0x10(%rsp)
mulsd  %xmm8,%xmm2
subsd  %xmm5,%xmm2
unpckhpd %xmm7,%xmm7
movapd -0x20(%rsp),%xmm9
mulsd  %xmm9,%xmm7
mulsd  %xmm12,%xmm2
addsd  %xmm7,%xmm2
movapd -0x70(%rsp),%xmm3
mulsd  %xmm15,%xmm3
addsd  %xmm2,%xmm3
movapd %xmm3,-0x70(%rsp)
movsd  0x8(%rcx),%xmm5
movapd %xmm5,%xmm2
mulsd  -0x40(%rsp),%xmm2
movsd  0x8(%rax),%xmm3
movapd %xmm3,%xmm4
mulsd  %xmm10,%xmm4
addsd  %xmm2,%xmm4
movapd %xmm0,%xmm7
movapd %xmm0,(%rsp)
movsd  0x8(%rsi),%xmm0
movapd %xmm0,%xmm2
movapd %xmm0,-0x80(%rsp)
movapd 0xccc(%rip),%xmm6
xorpd  %xmm6,%xmm2
movapd %xmm9,%xmm6
unpcklpd %xmm2,%xmm6
movapd %xmm1,%xmm2
unpcklpd %xmm4,%xmm2
unpcklpd %xmm13,%xmm4
mulpd  %xmm4,%xmm6
movapd %xmm0,%xmm4
unpcklpd %xmm12,%xmm4
movapd %xmm12,%xmm0
mulpd  %xmm2,%xmm4
addpd  %xmm6,%xmm4
movapd %xmm3,%xmm2
xorpd  0xc8c(%rip),%xmm2
movapd -0x30(%rsp),%xmm6
unpcklpd %xmm2,%xmm6
movapd %xmm5,%xmm2
unpcklpd -0x60(%rsp),%xmm2
mulpd  %xmm2,%xmm6
movapd %xmm11,%xmm2
mulsd  %xmm3,%xmm2
unpcklpd %xmm7,%xmm3
movapd %xmm11,%xmm7
unpcklpd %xmm5,%xmm7
mulpd  %xmm3,%xmm7
addpd  %xmm6,%xmm7
movapd -0x50(%rsp),%xmm6
movapd %xmm11,-0x10(%rsp)
movapd %xmm6,%xmm12
mulpd  %xmm7,%xmm12
addpd  %xmm4,%xmm12
mulsd  %xmm8,%xmm5
subsd  %xmm2,%xmm5
unpckhpd %xmm7,%xmm7
movapd %xmm9,%xmm3
mulsd  %xmm9,%xmm7
mulsd  %xmm0,%xmm5
movapd %xmm0,%xmm9
addsd  %xmm7,%xmm5
movapd -0x80(%rsp),%xmm2
mulsd  %xmm15,%xmm2
addsd  %xmm5,%xmm2
movapd %xmm2,-0x80(%rsp)
movsd  0x10(%rcx),%xmm11
movapd -0x40(%rsp),%xmm2
mulsd  %xmm11,%xmm2
movsd  0x10(%rax),%xmm5
mulsd  %xmm5,%xmm10
addsd  %xmm2,%xmm10
unpcklpd %xmm10,%xmm1
unpcklpd %xmm13,%xmm10
movsd  0x10(%rsi),%xmm0
movapd %xmm0,%xmm2
xorpd  0xbc6(%rip),%xmm2
movapd %xmm3,%xmm4
movapd %xmm3,%xmm13
unpcklpd %xmm2,%xmm4
mulpd  %xmm10,%xmm4
movapd %xmm0,%xmm3
movapd %xmm9,%xmm7
unpcklpd %xmm9,%xmm3
mulpd  %xmm1,%xmm3
addpd  %xmm4,%xmm3
movapd -0x10(%rsp),%xmm9
movapd %xmm9,%xmm1
unpcklpd %xmm11,%xmm1
mulsd  %xmm11,%xmm8
unpcklpd -0x60(%rsp),%xmm11
movapd 0xb79(%rip),%xmm4
xorpd  %xmm5,%xmm4
movapd -0x30(%rsp),%xmm2
unpcklpd %xmm4,%xmm2
mulpd  %xmm11,%xmm2
mulsd  %xmm5,%xmm9
unpcklpd (%rsp),%xmm5
mulpd  %xmm5,%xmm1
addpd  %xmm2,%xmm1
mulpd  %xmm1,%xmm6
addpd  %xmm3,%xmm6
subsd  %xmm9,%xmm8
unpckhpd %xmm1,%xmm1
mulsd  %xmm13,%xmm1
mulsd  %xmm7,%xmm8
addsd  %xmm1,%xmm8
mulsd  %xmm15,%xmm0
addsd  %xmm8,%xmm0
movapd %xmm14,%xmm1
unpcklpd %xmm14,%xmm1
movapd 0x10(%rsp),%xmm2
divpd  %xmm1,%xmm2
divpd  %xmm1,%xmm12
divpd  %xmm1,%xmm6
movapd -0x70(%rsp),%xmm1
divsd  %xmm14,%xmm1
movapd -0x80(%rsp),%xmm3
divsd  %xmm14,%xmm3
divsd  %xmm14,%xmm0
movupd %xmm2,(%rdx)
movsd  %xmm1,0x10(%rdx)
movq   $0x0,0x18(%rdx)
movupd %xmm12,0x20(%rdx)
movsd  %xmm3,0x30(%rdx)
movq   $0x0,0x38(%rdx)
movupd %xmm6,0x40(%rdx)
movsd  %xmm0,0x50(%rdx)
xorpd  %xmm0,%xmm0
movupd %xmm0,0x58(%rdx)
movupd %xmm0,0x68(%rdx)
movabs $0x3ff0000000000000,%rax
mov    %rax,0x78(%rdx)
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @matVectToRot(double** %0, double** %1, double* %2) {
%4 = alloca i32
%5 = alloca double**
%6 = alloca double**
%7 = alloca double*
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double
%25 = alloca double
%26 = alloca double
%27 = alloca double
%28 = alloca double
%29 = alloca double
%30 = alloca double
%31 = alloca double
%32 = alloca double
%33 = alloca double
%34 = alloca double
%35 = alloca double
%36 = alloca double
%37 = alloca double
%38 = alloca double
%39 = alloca double
%40 = alloca double
%41 = alloca double
%42 = alloca double
%43 = alloca double
%44 = alloca double
store double** %0, double*** %5
store double** %1, double*** %6
store double* %2, double** %7
%45 = load double**, double*** %6
%46 = getelementptr inbounds double*, double** %45, i64 0
%47 = load double*, double** %46
%48 = getelementptr inbounds double, double* %47, i64 0
%49 = load double, double* %48
store double %49, double* %8
%50 = load double**, double*** %6
%51 = getelementptr inbounds double*, double** %50, i64 0
%52 = load double*, double** %51
%53 = getelementptr inbounds double, double* %52, i64 1
%54 = load double, double* %53
store double %54, double* %9
%55 = load double**, double*** %6
%56 = getelementptr inbounds double*, double** %55, i64 0
%57 = load double*, double** %56
%58 = getelementptr inbounds double, double* %57, i64 2
%59 = load double, double* %58
store double %59, double* %10
%60 = load double**, double*** %6
%61 = getelementptr inbounds double*, double** %60, i64 1
%62 = load double*, double** %61
%63 = getelementptr inbounds double, double* %62, i64 0
%64 = load double, double* %63
store double %64, double* %11
%65 = load double**, double*** %6
%66 = getelementptr inbounds double*, double** %65, i64 1
%67 = load double*, double** %66
%68 = getelementptr inbounds double, double* %67, i64 1
%69 = load double, double* %68
store double %69, double* %12
%70 = load double**, double*** %6
%71 = getelementptr inbounds double*, double** %70, i64 1
%72 = load double*, double** %71
%73 = getelementptr inbounds double, double* %72, i64 2
%74 = load double, double* %73
store double %74, double* %13
%75 = load double**, double*** %6
%76 = getelementptr inbounds double*, double** %75, i64 2
%77 = load double*, double** %76
%78 = getelementptr inbounds double, double* %77, i64 0
%79 = load double, double* %78
store double %79, double* %14
%80 = load double**, double*** %6
%81 = getelementptr inbounds double*, double** %80, i64 2
%82 = load double*, double** %81
%83 = getelementptr inbounds double, double* %82, i64 1
%84 = load double, double* %83
store double %84, double* %15
%85 = load double**, double*** %6
%86 = getelementptr inbounds double*, double** %85, i64 2
%87 = load double*, double** %86
%88 = getelementptr inbounds double, double* %87, i64 2
%89 = load double, double* %88
store double %89, double* %16
%90 = load double**, double*** %5
%91 = getelementptr inbounds double*, double** %90, i64 0
%92 = load double*, double** %91
%93 = getelementptr inbounds double, double* %92, i64 0
%94 = load double, double* %93
store double %94, double* %17
%95 = load double**, double*** %5
%96 = getelementptr inbounds double*, double** %95, i64 0
%97 = load double*, double** %96
%98 = getelementptr inbounds double, double* %97, i64 1
%99 = load double, double* %98
store double %99, double* %18
%100 = load double**, double*** %5
%101 = getelementptr inbounds double*, double** %100, i64 0
%102 = load double*, double** %101
%103 = getelementptr inbounds double, double* %102, i64 2
%104 = load double, double* %103
store double %104, double* %19
%105 = load double**, double*** %5
%106 = getelementptr inbounds double*, double** %105, i64 1
%107 = load double*, double** %106
%108 = getelementptr inbounds double, double* %107, i64 0
%109 = load double, double* %108
store double %109, double* %20
%110 = load double**, double*** %5
%111 = getelementptr inbounds double*, double** %110, i64 1
%112 = load double*, double** %111
%113 = getelementptr inbounds double, double* %112, i64 1
%114 = load double, double* %113
store double %114, double* %21
%115 = load double**, double*** %5
%116 = getelementptr inbounds double*, double** %115, i64 1
%117 = load double*, double** %116
%118 = getelementptr inbounds double, double* %117, i64 2
%119 = load double, double* %118
store double %119, double* %22
%120 = load double**, double*** %5
%121 = getelementptr inbounds double*, double** %120, i64 2
%122 = load double*, double** %121
%123 = getelementptr inbounds double, double* %122, i64 0
%124 = load double, double* %123
store double %124, double* %23
%125 = load double**, double*** %5
%126 = getelementptr inbounds double*, double** %125, i64 2
%127 = load double*, double** %126
%128 = getelementptr inbounds double, double* %127, i64 1
%129 = load double, double* %128
store double %129, double* %24
%130 = load double**, double*** %5
%131 = getelementptr inbounds double*, double** %130, i64 2
%132 = load double*, double** %131
%133 = getelementptr inbounds double, double* %132, i64 2
%134 = load double, double* %133
store double %134, double* %25
%135 = load double, double* %8
%136 = load double, double* %12
%137 = load double, double* %16
%138 = load double, double* %13
%139 = load double, double* %15
%140 = fmul double %138, %139
%141 = fneg double %140
%142 = call double @llvm.fmuladd.f64(double %136, double %137, double %141)
%143 = load double, double* %9
%144 = load double, double* %11
%145 = load double, double* %16
%146 = load double, double* %13
%147 = load double, double* %14
%148 = fmul double %146, %147
%149 = fneg double %148
%150 = call double @llvm.fmuladd.f64(double %144, double %145, double %149)
%151 = fmul double %143, %150
%152 = fneg double %151
%153 = call double @llvm.fmuladd.f64(double %135, double %142, double %152)
%154 = load double, double* %10
%155 = load double, double* %11
%156 = load double, double* %15
%157 = load double, double* %12
%158 = load double, double* %14
%159 = fmul double %157, %158
%160 = fneg double %159
%161 = call double @llvm.fmuladd.f64(double %155, double %156, double %160)
%162 = call double @llvm.fmuladd.f64(double %154, double %161, double %153)
store double %162, double* %35
%163 = load double, double* %35
%164 = fcmp oeq double %163, 0.000000e+00
br i1 %164, label %165, label %166
165: ; preds = %3
store i32 -1, i32* %4
br label %487
166: ; preds = %3
%167 = load double, double* %17
%168 = load double, double* %12
%169 = load double, double* %16
%170 = load double, double* %13
%171 = load double, double* %15
%172 = fmul double %170, %171
%173 = fneg double %172
%174 = call double @llvm.fmuladd.f64(double %168, double %169, double %173)
%175 = load double, double* %9
%176 = load double, double* %20
%177 = load double, double* %16
%178 = load double, double* %13
%179 = load double, double* %23
%180 = fmul double %178, %179
%181 = fneg double %180
%182 = call double @llvm.fmuladd.f64(double %176, double %177, double %181)
%183 = fmul double %175, %182
%184 = fneg double %183
%185 = call double @llvm.fmuladd.f64(double %167, double %174, double %184)
%186 = load double, double* %10
%187 = load double, double* %20
%188 = load double, double* %15
%189 = load double, double* %12
%190 = load double, double* %23
%191 = fmul double %189, %190
%192 = fneg double %191
%193 = call double @llvm.fmuladd.f64(double %187, double %188, double %192)
%194 = call double @llvm.fmuladd.f64(double %186, double %193, double %185)
store double %194, double* %36
%195 = load double, double* %8
%196 = load double, double* %20
%197 = load double, double* %16
%198 = load double, double* %13
%199 = load double, double* %23
%200 = fmul double %198, %199
%201 = fneg double %200
%202 = call double @llvm.fmuladd.f64(double %196, double %197, double %201)
%203 = load double, double* %17
%204 = load double, double* %11
%205 = load double, double* %16
%206 = load double, double* %13
%207 = load double, double* %14
%208 = fmul double %206, %207
%209 = fneg double %208
%210 = call double @llvm.fmuladd.f64(double %204, double %205, double %209)
%211 = fmul double %203, %210
%212 = fneg double %211
%213 = call double @llvm.fmuladd.f64(double %195, double %202, double %212)
%214 = load double, double* %10
%215 = load double, double* %11
%216 = load double, double* %23
%217 = load double, double* %20
%218 = load double, double* %14
%219 = fmul double %217, %218
%220 = fneg double %219
%221 = call double @llvm.fmuladd.f64(double %215, double %216, double %220)
%222 = call double @llvm.fmuladd.f64(double %214, double %221, double %213)
store double %222, double* %37
%223 = load double, double* %8
%224 = load double, double* %12
%225 = load double, double* %23
%226 = load double, double* %20
%227 = load double, double* %15
%228 = fmul double %226, %227
%229 = fneg double %228
%230 = call double @llvm.fmuladd.f64(double %224, double %225, double %229)
%231 = load double, double* %9
%232 = load double, double* %11
%233 = load double, double* %23
%234 = load double, double* %20
%235 = load double, double* %14
%236 = fmul double %234, %235
%237 = fneg double %236
%238 = call double @llvm.fmuladd.f64(double %232, double %233, double %237)
%239 = fmul double %231, %238
%240 = fneg double %239
%241 = call double @llvm.fmuladd.f64(double %223, double %230, double %240)
%242 = load double, double* %17
%243 = load double, double* %11
%244 = load double, double* %15
%245 = load double, double* %12
%246 = load double, double* %14
%247 = fmul double %245, %246
%248 = fneg double %247
%249 = call double @llvm.fmuladd.f64(double %243, double %244, double %248)
%250 = call double @llvm.fmuladd.f64(double %242, double %249, double %241)
store double %250, double* %38
%251 = load double, double* %18
%252 = load double, double* %12
%253 = load double, double* %16
%254 = load double, double* %13
%255 = load double, double* %15
%256 = fmul double %254, %255
%257 = fneg double %256
%258 = call double @llvm.fmuladd.f64(double %252, double %253, double %257)
%259 = load double, double* %9
%260 = load double, double* %21
%261 = load double, double* %16
%262 = load double, double* %13
%263 = load double, double* %24
%264 = fmul double %262, %263
%265 = fneg double %264
%266 = call double @llvm.fmuladd.f64(double %260, double %261, double %265)
%267 = fmul double %259, %266
%268 = fneg double %267
%269 = call double @llvm.fmuladd.f64(double %251, double %258, double %268)
%270 = load double, double* %10
%271 = load double, double* %21
%272 = load double, double* %15
%273 = load double, double* %12
%274 = load double, double* %24
%275 = fmul double %273, %274
%276 = fneg double %275
%277 = call double @llvm.fmuladd.f64(double %271, double %272, double %276)
%278 = call double @llvm.fmuladd.f64(double %270, double %277, double %269)
store double %278, double* %39
%279 = load double, double* %8
%280 = load double, double* %21
%281 = load double, double* %16
%282 = load double, double* %13
%283 = load double, double* %24
%284 = fmul double %282, %283
%285 = fneg double %284
%286 = call double @llvm.fmuladd.f64(double %280, double %281, double %285)
%287 = load double, double* %18
%288 = load double, double* %11
%289 = load double, double* %16
%290 = load double, double* %13
%291 = load double, double* %14
%292 = fmul double %290, %291
%293 = fneg double %292
%294 = call double @llvm.fmuladd.f64(double %288, double %289, double %293)
%295 = fmul double %287, %294
%296 = fneg double %295
%297 = call double @llvm.fmuladd.f64(double %279, double %286, double %296)
%298 = load double, double* %10
%299 = load double, double* %11
%300 = load double, double* %24
%301 = load double, double* %21
%302 = load double, double* %14
%303 = fmul double %301, %302
%304 = fneg double %303
%305 = call double @llvm.fmuladd.f64(double %299, double %300, double %304)
%306 = call double @llvm.fmuladd.f64(double %298, double %305, double %297)
store double %306, double* %40
%307 = load double, double* %8
%308 = load double, double* %12
%309 = load double, double* %24
%310 = load double, double* %21
%311 = load double, double* %15
%312 = fmul double %310, %311
%313 = fneg double %312
%314 = call double @llvm.fmuladd.f64(double %308, double %309, double %313)
%315 = load double, double* %9
%316 = load double, double* %11
%317 = load double, double* %24
%318 = load double, double* %21
%319 = load double, double* %14
%320 = fmul double %318, %319
%321 = fneg double %320
%322 = call double @llvm.fmuladd.f64(double %316, double %317, double %321)
%323 = fmul double %315, %322
%324 = fneg double %323
%325 = call double @llvm.fmuladd.f64(double %307, double %314, double %324)
%326 = load double, double* %18
%327 = load double, double* %11
%328 = load double, double* %15
%329 = load double, double* %12
%330 = load double, double* %14
%331 = fmul double %329, %330
%332 = fneg double %331
%333 = call double @llvm.fmuladd.f64(double %327, double %328, double %332)
%334 = call double @llvm.fmuladd.f64(double %326, double %333, double %325)
store double %334, double* %41
%335 = load double, double* %19
%336 = load double, double* %12
%337 = load double, double* %16
%338 = load double, double* %13
%339 = load double, double* %15
%340 = fmul double %338, %339
%341 = fneg double %340
%342 = call double @llvm.fmuladd.f64(double %336, double %337, double %341)
%343 = load double, double* %9
%344 = load double, double* %22
%345 = load double, double* %16
%346 = load double, double* %13
%347 = load double, double* %25
%348 = fmul double %346, %347
%349 = fneg double %348
%350 = call double @llvm.fmuladd.f64(double %344, double %345, double %349)
%351 = fmul double %343, %350
%352 = fneg double %351
%353 = call double @llvm.fmuladd.f64(double %335, double %342, double %352)
%354 = load double, double* %10
%355 = load double, double* %22
%356 = load double, double* %15
%357 = load double, double* %12
%358 = load double, double* %25
%359 = fmul double %357, %358
%360 = fneg double %359
%361 = call double @llvm.fmuladd.f64(double %355, double %356, double %360)
%362 = call double @llvm.fmuladd.f64(double %354, double %361, double %353)
store double %362, double* %42
%363 = load double, double* %8
%364 = load double, double* %22
%365 = load double, double* %16
%366 = load double, double* %13
%367 = load double, double* %25
%368 = fmul double %366, %367
%369 = fneg double %368
%370 = call double @llvm.fmuladd.f64(double %364, double %365, double %369)
%371 = load double, double* %19
%372 = load double, double* %11
%373 = load double, double* %16
%374 = load double, double* %13
%375 = load double, double* %14
%376 = fmul double %374, %375
%377 = fneg double %376
%378 = call double @llvm.fmuladd.f64(double %372, double %373, double %377)
%379 = fmul double %371, %378
%380 = fneg double %379
%381 = call double @llvm.fmuladd.f64(double %363, double %370, double %380)
%382 = load double, double* %10
%383 = load double, double* %11
%384 = load double, double* %25
%385 = load double, double* %22
%386 = load double, double* %14
%387 = fmul double %385, %386
%388 = fneg double %387
%389 = call double @llvm.fmuladd.f64(double %383, double %384, double %388)
%390 = call double @llvm.fmuladd.f64(double %382, double %389, double %381)
store double %390, double* %43
%391 = load double, double* %8
%392 = load double, double* %12
%393 = load double, double* %25
%394 = load double, double* %22
%395 = load double, double* %15
%396 = fmul double %394, %395
%397 = fneg double %396
%398 = call double @llvm.fmuladd.f64(double %392, double %393, double %397)
%399 = load double, double* %9
%400 = load double, double* %11
%401 = load double, double* %25
%402 = load double, double* %22
%403 = load double, double* %14
%404 = fmul double %402, %403
%405 = fneg double %404
%406 = call double @llvm.fmuladd.f64(double %400, double %401, double %405)
%407 = fmul double %399, %406
%408 = fneg double %407
%409 = call double @llvm.fmuladd.f64(double %391, double %398, double %408)
%410 = load double, double* %19
%411 = load double, double* %11
%412 = load double, double* %15
%413 = load double, double* %12
%414 = load double, double* %14
%415 = fmul double %413, %414
%416 = fneg double %415
%417 = call double @llvm.fmuladd.f64(double %411, double %412, double %416)
%418 = call double @llvm.fmuladd.f64(double %410, double %417, double %409)
store double %418, double* %44
%419 = load double, double* %36
%420 = load double, double* %35
%421 = fdiv double %419, %420
store double %421, double* %26
%422 = load double, double* %37
%423 = load double, double* %35
%424 = fdiv double %422, %423
store double %424, double* %27
%425 = load double, double* %38
%426 = load double, double* %35
%427 = fdiv double %425, %426
store double %427, double* %28
%428 = load double, double* %39
%429 = load double, double* %35
%430 = fdiv double %428, %429
store double %430, double* %29
%431 = load double, double* %40
%432 = load double, double* %35
%433 = fdiv double %431, %432
store double %433, double* %30
%434 = load double, double* %41
%435 = load double, double* %35
%436 = fdiv double %434, %435
store double %436, double* %31
%437 = load double, double* %42
%438 = load double, double* %35
%439 = fdiv double %437, %438
store double %439, double* %32
%440 = load double, double* %43
%441 = load double, double* %35
%442 = fdiv double %440, %441
store double %442, double* %33
%443 = load double, double* %44
%444 = load double, double* %35
%445 = fdiv double %443, %444
store double %445, double* %34
%446 = load double, double* %26
%447 = load double*, double** %7
%448 = getelementptr inbounds double, double* %447, i64 0
store double %446, double* %448
%449 = load double, double* %27
%450 = load double*, double** %7
%451 = getelementptr inbounds double, double* %450, i64 1
store double %449, double* %451
%452 = load double, double* %28
%453 = load double*, double** %7
%454 = getelementptr inbounds double, double* %453, i64 2
store double %452, double* %454
%455 = load double*, double** %7
%456 = getelementptr inbounds double, double* %455, i64 3
store double 0.000000e+00, double* %456
%457 = load double, double* %29
%458 = load double*, double** %7
%459 = getelementptr inbounds double, double* %458, i64 4
store double %457, double* %459
%460 = load double, double* %30
%461 = load double*, double** %7
%462 = getelementptr inbounds double, double* %461, i64 5
store double %460, double* %462
%463 = load double, double* %31
%464 = load double*, double** %7
%465 = getelementptr inbounds double, double* %464, i64 6
store double %463, double* %465
%466 = load double*, double** %7
%467 = getelementptr inbounds double, double* %466, i64 7
store double 0.000000e+00, double* %467
%468 = load double, double* %32
%469 = load double*, double** %7
%470 = getelementptr inbounds double, double* %469, i64 8
store double %468, double* %470
%471 = load double, double* %33
%472 = load double*, double** %7
%473 = getelementptr inbounds double, double* %472, i64 9
store double %471, double* %473
%474 = load double, double* %34
%475 = load double*, double** %7
%476 = getelementptr inbounds double, double* %475, i64 10
store double %474, double* %476
%477 = load double*, double** %7
%478 = getelementptr inbounds double, double* %477, i64 11
store double 0.000000e+00, double* %478
%479 = load double*, double** %7
%480 = getelementptr inbounds double, double* %479, i64 12
store double 0.000000e+00, double* %480
%481 = load double*, double** %7
%482 = getelementptr inbounds double, double* %481, i64 13
store double 0.000000e+00, double* %482
%483 = load double*, double** %7
%484 = getelementptr inbounds double, double* %483, i64 14
store double 0.000000e+00, double* %484
%485 = load double*, double** %7
%486 = getelementptr inbounds double, double* %485, i64 15
store double 1.000000e+00, double* %486
store i32 0, i32* %4
br label %487
487: ; preds = %166, %165
%488 = load i32, i32* %4
ret i32 %488
}

LLVM IR (-O2):
define i32 @matVectToRot(double** nocapture %0, double** nocapture %1, double* nocapture writeonly %2) {
%4 = load double*, double** %1
%5 = load double, double* %4
%6 = getelementptr inbounds double, double* %4, i64 1
%7 = load double, double* %6
%8 = getelementptr inbounds double, double* %4, i64 2
%9 = load double, double* %8
%10 = getelementptr inbounds double*, double** %1, i64 1
%11 = load double*, double** %10
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %11, i64 1
%14 = load double, double* %13
%15 = getelementptr inbounds double, double* %11, i64 2
%16 = load double, double* %15
%17 = getelementptr inbounds double*, double** %1, i64 2
%18 = load double*, double** %17
%19 = load double, double* %18
%20 = getelementptr inbounds double, double* %18, i64 1
%21 = load double, double* %20
%22 = getelementptr inbounds double, double* %18, i64 2
%23 = load double, double* %22
%24 = load double*, double** %0
%25 = load double, double* %24
%26 = getelementptr inbounds double, double* %24, i64 1
%27 = load double, double* %26
%28 = getelementptr inbounds double, double* %24, i64 2
%29 = load double, double* %28
%30 = getelementptr inbounds double*, double** %0, i64 1
%31 = load double*, double** %30
%32 = load double, double* %31
%33 = getelementptr inbounds double, double* %31, i64 1
%34 = load double, double* %33
%35 = getelementptr inbounds double, double* %31, i64 2
%36 = load double, double* %35
%37 = getelementptr inbounds double*, double** %0, i64 2
%38 = load double*, double** %37
%39 = load double, double* %38
%40 = getelementptr inbounds double, double* %38, i64 1
%41 = load double, double* %40
%42 = getelementptr inbounds double, double* %38, i64 2
%43 = load double, double* %42
%44 = fneg double %16
%45 = fmul double %21, %44
%46 = tail call double @llvm.fmuladd.f64(double %14, double %23, double %45)
%47 = fmul double %19, %44
%48 = tail call double @llvm.fmuladd.f64(double %12, double %23, double %47)
%49 = fneg double %7
%50 = fmul double %48, %49
%51 = tail call double @llvm.fmuladd.f64(double %5, double %46, double %50)
%52 = fneg double %14
%53 = fmul double %19, %52
%54 = tail call double @llvm.fmuladd.f64(double %12, double %21, double %53)
%55 = tail call double @llvm.fmuladd.f64(double %9, double %54, double %51)
%56 = fcmp oeq double %55, 0.000000e+00
br i1 %56, label %166, label %57
57: ; preds = %3
%58 = fmul double %39, %44
%59 = tail call double @llvm.fmuladd.f64(double %32, double %23, double %58)
%60 = fneg double %25
%61 = insertelement <2 x double> poison, double %59, i64 0
%62 = insertelement <2 x double> %61, double %48, i64 1
%63 = insertelement <2 x double> poison, double %49, i64 0
%64 = insertelement <2 x double> %63, double %60, i64 1
%65 = fmul <2 x double> %62, %64
%66 = insertelement <2 x double> poison, double %25, i64 0
%67 = insertelement <2 x double> %66, double %5, i64 1
%68 = insertelement <2 x double> poison, double %46, i64 0
%69 = insertelement <2 x double> %68, double %59, i64 1
%70 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %67, <2 x double> %69, <2 x double> %65)
%71 = fneg double %32
%72 = insertelement <2 x double> poison, double %39, i64 0
%73 = insertelement <2 x double> %72, double %19, i64 1
%74 = insertelement <2 x double> poison, double %52, i64 0
%75 = insertelement <2 x double> %74, double %71, i64 1
%76 = fmul <2 x double> %73, %75
%77 = insertelement <2 x double> poison, double %32, i64 0
%78 = insertelement <2 x double> %77, double %12, i64 1
%79 = insertelement <2 x double> poison, double %21, i64 0
%80 = insertelement <2 x double> %79, double %39, i64 1
%81 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %78, <2 x double> %80, <2 x double> %76)
%82 = insertelement <2 x double> poison, double %9, i64 0
%83 = shufflevector <2 x double> %82, <2 x double> poison, <2 x i32> zeroinitializer
%84 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %83, <2 x double> %81, <2 x double> %70)
%85 = fmul double %21, %71
%86 = tail call double @llvm.fmuladd.f64(double %14, double %39, double %85)
%87 = extractelement <2 x double> %81, i64 1
%88 = fmul double %87, %49
%89 = tail call double @llvm.fmuladd.f64(double %5, double %86, double %88)
%90 = tail call double @llvm.fmuladd.f64(double %25, double %54, double %89)
%91 = fmul double %41, %44
%92 = tail call double @llvm.fmuladd.f64(double %34, double %23, double %91)
%93 = fneg double %27
%94 = insertelement <2 x double> poison, double %92, i64 0
%95 = insertelement <2 x double> %94, double %48, i64 1
%96 = insertelement <2 x double> %63, double %93, i64 1
%97 = fmul <2 x double> %95, %96
%98 = insertelement <2 x double> poison, double %27, i64 0
%99 = insertelement <2 x double> %98, double %5, i64 1
%100 = insertelement <2 x double> %68, double %92, i64 1
%101 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %99, <2 x double> %100, <2 x double> %97)
%102 = fneg double %34
%103 = insertelement <2 x double> poison, double %41, i64 0
%104 = insertelement <2 x double> %103, double %19, i64 1
%105 = insertelement <2 x double> %74, double %102, i64 1
%106 = fmul <2 x double> %104, %105
%107 = insertelement <2 x double> poison, double %34, i64 0
%108 = insertelement <2 x double> %107, double %12, i64 1
%109 = insertelement <2 x double> %79, double %41, i64 1
%110 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %108, <2 x double> %109, <2 x double> %106)
%111 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %83, <2 x double> %110, <2 x double> %101)
%112 = fmul double %21, %102
%113 = tail call double @llvm.fmuladd.f64(double %14, double %41, double %112)
%114 = extractelement <2 x double> %110, i64 1
%115 = fmul double %114, %49
%116 = tail call double @llvm.fmuladd.f64(double %5, double %113, double %115)
%117 = tail call double @llvm.fmuladd.f64(double %27, double %54, double %116)
%118 = fmul double %43, %44
%119 = tail call double @llvm.fmuladd.f64(double %36, double %23, double %118)
%120 = fneg double %29
%121 = insertelement <2 x double> poison, double %119, i64 0
%122 = insertelement <2 x double> %121, double %48, i64 1
%123 = insertelement <2 x double> %63, double %120, i64 1
%124 = fmul <2 x double> %122, %123
%125 = insertelement <2 x double> poison, double %29, i64 0
%126 = insertelement <2 x double> %125, double %5, i64 1
%127 = insertelement <2 x double> %68, double %119, i64 1
%128 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %126, <2 x double> %127, <2 x double> %124)
%129 = fneg double %36
%130 = insertelement <2 x double> poison, double %43, i64 0
%131 = insertelement <2 x double> %130, double %19, i64 1
%132 = insertelement <2 x double> %74, double %129, i64 1
%133 = fmul <2 x double> %131, %132
%134 = insertelement <2 x double> poison, double %36, i64 0
%135 = insertelement <2 x double> %134, double %12, i64 1
%136 = insertelement <2 x double> %79, double %43, i64 1
%137 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %135, <2 x double> %136, <2 x double> %133)
%138 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %83, <2 x double> %137, <2 x double> %128)
%139 = fmul double %21, %129
%140 = tail call double @llvm.fmuladd.f64(double %14, double %43, double %139)
%141 = extractelement <2 x double> %137, i64 1
%142 = fmul double %141, %49
%143 = tail call double @llvm.fmuladd.f64(double %5, double %140, double %142)
%144 = tail call double @llvm.fmuladd.f64(double %29, double %54, double %143)
%145 = insertelement <2 x double> poison, double %55, i64 0
%146 = shufflevector <2 x double> %145, <2 x double> poison, <2 x i32> zeroinitializer
%147 = fdiv <2 x double> %84, %146
%148 = fdiv double %90, %55
%149 = fdiv <2 x double> %111, %146
%150 = fdiv double %117, %55
%151 = fdiv <2 x double> %138, %146
%152 = fdiv double %144, %55
%153 = bitcast double* %2 to <2 x double>*
store <2 x double> %147, <2 x double>* %153
%154 = getelementptr inbounds double, double* %2, i64 2
store double %148, double* %154
%155 = getelementptr inbounds double, double* %2, i64 3
store double 0.000000e+00, double* %155
%156 = getelementptr inbounds double, double* %2, i64 4
%157 = bitcast double* %156 to <2 x double>*
store <2 x double> %149, <2 x double>* %157
%158 = getelementptr inbounds double, double* %2, i64 6
store double %150, double* %158
%159 = getelementptr inbounds double, double* %2, i64 7
store double 0.000000e+00, double* %159
%160 = getelementptr inbounds double, double* %2, i64 8
%161 = bitcast double* %160 to <2 x double>*
store <2 x double> %151, <2 x double>* %161
%162 = getelementptr inbounds double, double* %2, i64 10
store double %152, double* %162
%163 = getelementptr inbounds double, double* %2, i64 11
%164 = getelementptr inbounds double, double* %2, i64 15
%165 = bitcast double* %163 to i8*
store double 1.000000e+00, double* %164
br label %166
166: ; preds = %3, %57
%167 = phi i32 [ 0, %57 ], [ -1, %3 ]
ret i32 %167
}