#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 */
float cosf(float);
float sinf(float);
float sqrtf(float);
void vec4_GetRotationOperators(float t1[4], float t2[4], const float v[3],
                               float ang) {
  float sin_t2, cos_t2, module;
  ang /= 2.0f;
  sin_t2 = sinf(ang);
  cos_t2 = cosf(ang);
  t1[3] = cos_t2;
  t1[0] = v[0] * sin_t2;
  t1[1] = v[1] * sin_t2;
  t1[2] = v[2] * sin_t2;
  module = (sqrtf((t1)[0] * (t1)[0] + (t1)[1] * (t1)[1] + (t1)[2] * (t1)[2] +
                  (t1)[3] * (t1)[3]));
  t1[0] /= module;
  t1[1] /= module;
  t1[2] /= module;
  t1[3] /= module;
  t2[3] = t1[3];
  t2[0] = -t1[0];
  t2[1] = -t1[1];
  t2[2] = -t1[2];
}


x86 assembly (clang, -O0):
<vec4_GetRotationOperators>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  0xeaa(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
call   1030 <sinf@plt>
movss  %xmm0,-0x20(%rbp)
movss  -0x1c(%rbp),%xmm0
call   1040 <cosf@plt>
movss  %xmm0,-0x24(%rbp)
movss  -0x24(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0xc(%rax)
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
mulss  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movss  0x4(%rax),%xmm0
mulss  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x18(%rbp),%rax
movss  0x8(%rax),%xmm0
mulss  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x8(%rbp),%rax
mulss  0x4(%rax),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm2
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movss  0xc(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  0xc(%rax),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1050 <sqrtf@plt>
movss  %xmm0,-0x28(%rbp)
movss  -0x28(%rbp),%xmm1
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,(%rax)
movss  -0x28(%rbp),%xmm1
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,0x4(%rax)
movss  -0x28(%rbp),%xmm1
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,0x8(%rax)
movss  -0x28(%rbp),%xmm1
mov    -0x8(%rbp),%rax
movss  0xc(%rax),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,0xc(%rax)
mov    -0x8(%rbp),%rax
movss  0xc(%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0xc(%rax)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x8(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec4_GetRotationOperators>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
mulss  0xeb6(%rip),%xmm0
movss  %xmm0,0x8(%rsp)
call   1030 <sinf@plt>
movss  %xmm0,0xc(%rsp)
movss  0x8(%rsp),%xmm0
call   1040 <cosf@plt>
movss  %xmm0,0xc(%rbx)
movss  (%r15),%xmm1
movss  0xc(%rsp),%xmm3
mulss  %xmm3,%xmm1
movss  %xmm1,(%rbx)
movss  0x4(%r15),%xmm2
mulss  %xmm3,%xmm2
movss  %xmm2,0x4(%rbx)
mulss  0x8(%r15),%xmm3
movss  %xmm3,0x8(%rbx)
mulss  %xmm2,%xmm2
mulss  %xmm1,%xmm1
addss  %xmm2,%xmm1
mulss  %xmm3,%xmm3
addss  %xmm1,%xmm3
mulss  %xmm0,%xmm0
addss  %xmm3,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     11c2 <vec4_GetRotationOperators+0x92>
sqrtss %xmm0,%xmm0
jmp    11c7 <vec4_GetRotationOperators+0x97>
call   1050 <sqrtf@plt>
movups (%rbx),%xmm1
shufps $0x0,%xmm0,%xmm0
divps  %xmm0,%xmm1
movups %xmm1,(%rbx)
shufps $0xff,%xmm1,%xmm1
movss  %xmm1,0xc(%r14)
movss  (%rbx),%xmm0
movaps 0xe27(%rip),%xmm1
xorps  %xmm1,%xmm0
movss  %xmm0,(%r14)
movss  0x4(%rbx),%xmm0
xorps  %xmm1,%xmm0
movss  %xmm0,0x4(%r14)
movss  0x8(%rbx),%xmm0
xorps  %xmm1,%xmm0
movss  %xmm0,0x8(%r14)
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @vec4_GetRotationOperators(float* %0, float* %1, float* %2, float %3) {
%5 = alloca float*
%6 = alloca float*
%7 = alloca float*
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
store float* %0, float** %5
store float* %1, float** %6
store float* %2, float** %7
store float %3, float* %8
%12 = load float, float* %8
%13 = fdiv float %12, 2.000000e+00
store float %13, float* %8
%14 = load float, float* %8
%15 = call float @sinf(float %14)
store float %15, float* %9
%16 = load float, float* %8
%17 = call float @cosf(float %16)
store float %17, float* %10
%18 = load float, float* %10
%19 = load float*, float** %5
%20 = getelementptr inbounds float, float* %19, i64 3
store float %18, float* %20
%21 = load float*, float** %7
%22 = getelementptr inbounds float, float* %21, i64 0
%23 = load float, float* %22
%24 = load float, float* %9
%25 = fmul float %23, %24
%26 = load float*, float** %5
%27 = getelementptr inbounds float, float* %26, i64 0
store float %25, float* %27
%28 = load float*, float** %7
%29 = getelementptr inbounds float, float* %28, i64 1
%30 = load float, float* %29
%31 = load float, float* %9
%32 = fmul float %30, %31
%33 = load float*, float** %5
%34 = getelementptr inbounds float, float* %33, i64 1
store float %32, float* %34
%35 = load float*, float** %7
%36 = getelementptr inbounds float, float* %35, i64 2
%37 = load float, float* %36
%38 = load float, float* %9
%39 = fmul float %37, %38
%40 = load float*, float** %5
%41 = getelementptr inbounds float, float* %40, i64 2
store float %39, float* %41
%42 = load float*, float** %5
%43 = getelementptr inbounds float, float* %42, i64 0
%44 = load float, float* %43
%45 = load float*, float** %5
%46 = getelementptr inbounds float, float* %45, i64 0
%47 = load float, float* %46
%48 = load float*, float** %5
%49 = getelementptr inbounds float, float* %48, i64 1
%50 = load float, float* %49
%51 = load float*, float** %5
%52 = getelementptr inbounds float, float* %51, i64 1
%53 = load float, float* %52
%54 = fmul float %50, %53
%55 = call float @llvm.fmuladd.f32(float %44, float %47, float %54)
%56 = load float*, float** %5
%57 = getelementptr inbounds float, float* %56, i64 2
%58 = load float, float* %57
%59 = load float*, float** %5
%60 = getelementptr inbounds float, float* %59, i64 2
%61 = load float, float* %60
%62 = call float @llvm.fmuladd.f32(float %58, float %61, float %55)
%63 = load float*, float** %5
%64 = getelementptr inbounds float, float* %63, i64 3
%65 = load float, float* %64
%66 = load float*, float** %5
%67 = getelementptr inbounds float, float* %66, i64 3
%68 = load float, float* %67
%69 = call float @llvm.fmuladd.f32(float %65, float %68, float %62)
%70 = call float @sqrtf(float %69)
store float %70, float* %11
%71 = load float, float* %11
%72 = load float*, float** %5
%73 = getelementptr inbounds float, float* %72, i64 0
%74 = load float, float* %73
%75 = fdiv float %74, %71
store float %75, float* %73
%76 = load float, float* %11
%77 = load float*, float** %5
%78 = getelementptr inbounds float, float* %77, i64 1
%79 = load float, float* %78
%80 = fdiv float %79, %76
store float %80, float* %78
%81 = load float, float* %11
%82 = load float*, float** %5
%83 = getelementptr inbounds float, float* %82, i64 2
%84 = load float, float* %83
%85 = fdiv float %84, %81
store float %85, float* %83
%86 = load float, float* %11
%87 = load float*, float** %5
%88 = getelementptr inbounds float, float* %87, i64 3
%89 = load float, float* %88
%90 = fdiv float %89, %86
store float %90, float* %88
%91 = load float*, float** %5
%92 = getelementptr inbounds float, float* %91, i64 3
%93 = load float, float* %92
%94 = load float*, float** %6
%95 = getelementptr inbounds float, float* %94, i64 3
store float %93, float* %95
%96 = load float*, float** %5
%97 = getelementptr inbounds float, float* %96, i64 0
%98 = load float, float* %97
%99 = fneg float %98
%100 = load float*, float** %6
%101 = getelementptr inbounds float, float* %100, i64 0
store float %99, float* %101
%102 = load float*, float** %5
%103 = getelementptr inbounds float, float* %102, i64 1
%104 = load float, float* %103
%105 = fneg float %104
%106 = load float*, float** %6
%107 = getelementptr inbounds float, float* %106, i64 1
store float %105, float* %107
%108 = load float*, float** %5
%109 = getelementptr inbounds float, float* %108, i64 2
%110 = load float, float* %109
%111 = fneg float %110
%112 = load float*, float** %6
%113 = getelementptr inbounds float, float* %112, i64 2
store float %111, float* %113
ret void
}

LLVM IR (-O2):
define void @vec4_GetRotationOperators(float* nocapture %0, float* nocapture writeonly %1, float* nocapture %2, float %3) {
%5 = fmul float %3, 5.000000e-01
%6 = tail call float @sinf(float %5)
%7 = tail call float @cosf(float %5)
%8 = getelementptr inbounds float, float* %0, i64 3
store float %7, float* %8
%9 = load float, float* %2
%10 = fmul float %6, %9
store float %10, float* %0
%11 = getelementptr inbounds float, float* %2, i64 1
%12 = load float, float* %11
%13 = fmul float %6, %12
%14 = getelementptr inbounds float, float* %0, i64 1
store float %13, float* %14
%15 = getelementptr inbounds float, float* %2, i64 2
%16 = load float, float* %15
%17 = fmul float %6, %16
%18 = getelementptr inbounds float, float* %0, i64 2
store float %17, float* %18
%19 = fmul float %13, %13
%20 = tail call float @llvm.fmuladd.f32(float %10, float %10, float %19)
%21 = tail call float @llvm.fmuladd.f32(float %17, float %17, float %20)
%22 = tail call float @llvm.fmuladd.f32(float %7, float %7, float %21)
%23 = tail call float @sqrtf(float %22)
%24 = bitcast float* %0 to <4 x float>*
%25 = load <4 x float>, <4 x float>* %24
%26 = insertelement <4 x float> poison, float %23, i64 0
%27 = shufflevector <4 x float> %26, <4 x float> poison, <4 x i32> zeroinitializer
%28 = fdiv <4 x float> %25, %27
%29 = bitcast float* %0 to <4 x float>*
store <4 x float> %28, <4 x float>* %29
%30 = getelementptr inbounds float, float* %1, i64 3
%31 = extractelement <4 x float> %28, i64 3
store float %31, float* %30
%32 = load float, float* %0
%33 = fneg float %32
store float %33, float* %1
%34 = load float, float* %14
%35 = fneg float %34
%36 = getelementptr inbounds float, float* %1, i64 1
store float %35, float* %36
%37 = load float, float* %18
%38 = fneg float %37
%39 = getelementptr inbounds float, float* %1, i64 2
store float %38, float* %39
ret void
}