void glmVectorFromColorf(float vector[3], const float color[3]) {
  vector[0] = (color[0] - 0.5) * 2.0;
  vector[1] = (color[1] - 0.5) * 2.0;
  vector[2] = (color[2] - 0.5) * 2.0;
}


x86 assembly (clang, -O0):
<glmVectorFromColorf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee8(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xed4(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeb7(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xea3(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe85(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xe71(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmVectorFromColorf>:
movss  (%rsi),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xef0(%rip),%xmm1
addsd  %xmm1,%xmm0
addsd  %xmm0,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  %xmm1,%xmm0
addsd  %xmm0,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x4(%rdi)
movss  0x8(%rsi),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  %xmm1,%xmm0
addsd  %xmm0,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x8(%rdi)
ret

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

LLVM IR (-O2):
define void @glmVectorFromColorf(float* nocapture writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = fpext float %3 to double
%5 = fadd double %4, -5.000000e-01
%6 = fmul double %5, 2.000000e+00
%7 = fptrunc double %6 to float
store float %7, float* %0
%8 = getelementptr inbounds float, float* %1, i64 1
%9 = load float, float* %8
%10 = fpext float %9 to double
%11 = fadd double %10, -5.000000e-01
%12 = fmul double %11, 2.000000e+00
%13 = fptrunc double %12 to float
%14 = getelementptr inbounds float, float* %0, i64 1
store float %13, float* %14
%15 = getelementptr inbounds float, float* %1, i64 2
%16 = load float, float* %15
%17 = fpext float %16 to double
%18 = fadd double %17, -5.000000e-01
%19 = fmul double %18, 2.000000e+00
%20 = fptrunc double %19 to float
%21 = getelementptr inbounds float, float* %0, i64 2
store float %20, float* %21
ret void
}