#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);
void quat_setAxisAngle(float *dst, float *axis, float rad) {
  rad = rad * 0.5;
  float s = sinf(rad);
  dst[0] = s * axis[0];
  dst[1] = s * axis[1];
  dst[2] = s * axis[2];
  dst[3] = cosf(rad);
}


x86 assembly (clang, -O0):
<quat_setAxisAngle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeba(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
call   1030 <sinf@plt>
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mulss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mulss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
movss  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mulss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
movss  -0x14(%rbp),%xmm0
call   1040 <cosf@plt>
mov    -0x8(%rbp),%rax
movss  %xmm0,0xc(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quat_setAxisAngle>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mulss  0xece(%rip),%xmm0
movss  %xmm0,0x4(%rsp)
call   1030 <sinf@plt>
movss  (%r14),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,(%rbx)
movss  0x4(%r14),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0x4(%rbx)
mulss  0x8(%r14),%xmm0
movss  %xmm0,0x8(%rbx)
movss  0x4(%rsp),%xmm0
call   1040 <cosf@plt>
movss  %xmm0,0xc(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @quat_setAxisAngle(float* %0, float* %1, float %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float
%7 = alloca float
store float* %0, float** %4
store float* %1, float** %5
store float %2, float* %6
%8 = load float, float* %6
%9 = fpext float %8 to double
%10 = fmul double %9, 5.000000e-01
%11 = fptrunc double %10 to float
store float %11, float* %6
%12 = load float, float* %6
%13 = call float @sinf(float %12)
store float %13, float* %7
%14 = load float, float* %7
%15 = load float*, float** %5
%16 = getelementptr inbounds float, float* %15, i64 0
%17 = load float, float* %16
%18 = fmul float %14, %17
%19 = load float*, float** %4
%20 = getelementptr inbounds float, float* %19, i64 0
store float %18, float* %20
%21 = load float, float* %7
%22 = load float*, float** %5
%23 = getelementptr inbounds float, float* %22, i64 1
%24 = load float, float* %23
%25 = fmul float %21, %24
%26 = load float*, float** %4
%27 = getelementptr inbounds float, float* %26, i64 1
store float %25, float* %27
%28 = load float, float* %7
%29 = load float*, float** %5
%30 = getelementptr inbounds float, float* %29, i64 2
%31 = load float, float* %30
%32 = fmul float %28, %31
%33 = load float*, float** %4
%34 = getelementptr inbounds float, float* %33, i64 2
store float %32, float* %34
%35 = load float, float* %6
%36 = call float @cosf(float %35)
%37 = load float*, float** %4
%38 = getelementptr inbounds float, float* %37, i64 3
store float %36, float* %38
ret void
}

LLVM IR (-O2):
define void @quat_setAxisAngle(float* nocapture writeonly %0, float* nocapture %1, float %2) {
%4 = fmul float %2, 5.000000e-01
%5 = tail call float @sinf(float %4)
%6 = load float, float* %1
%7 = fmul float %5, %6
store float %7, float* %0
%8 = getelementptr inbounds float, float* %1, i64 1
%9 = load float, float* %8
%10 = fmul float %5, %9
%11 = getelementptr inbounds float, float* %0, i64 1
store float %10, float* %11
%12 = getelementptr inbounds float, float* %1, i64 2
%13 = load float, float* %12
%14 = fmul float %5, %13
%15 = getelementptr inbounds float, float* %0, i64 2
store float %14, float* %15
%16 = tail call float @cosf(float %4)
%17 = getelementptr inbounds float, float* %0, i64 3
store float %16, float* %17
ret void
}