void(libclut_model_linear_to_ciexyz)(double r, double g, double b, double *X,
                                     double *Y, double *Z) {
  do {
    double r__ = (r), g__ = (g), b__ = (b);
    *(X) = (0.4124564 * r__) + (0.3575761 * g__) + (0.1804375 * b__);
    *(Y) = (0.2126729 * r__) + (0.7151522 * g__) + (0.0721750 * b__);
    *(Z) = (0.0193339 * r__) + (0.1191920 * g__) + (0.9503041 * b__);
  } while (0);
}


x86 assembly (clang, -O0):
<libclut_model_linear_to_ciexyz>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x28(%rbp)
mov    %rdx,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x38(%rbp),%xmm1
movsd  0xef6(%rip),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  0xee1(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
movsd  0xec4(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x38(%rbp),%xmm1
movsd  0xe9f(%rip),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  0xe8a(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
movsd  0xe6d(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x38(%rbp),%xmm1
movsd  0xe48(%rip),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  0xe33(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
movsd  0xe16(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<libclut_model_linear_to_ciexyz>:
movsd  0xef8(%rip),%xmm3
mulsd  %xmm1,%xmm3
movsd  0xef4(%rip),%xmm4
mulsd  %xmm0,%xmm4
addsd  %xmm3,%xmm4
movsd  0xeec(%rip),%xmm3
mulsd  %xmm2,%xmm3
addsd  %xmm4,%xmm3
movsd  %xmm3,(%rdi)
movsd  0xee0(%rip),%xmm3
mulsd  %xmm1,%xmm3
movsd  0xedc(%rip),%xmm4
mulsd  %xmm0,%xmm4
addsd  %xmm3,%xmm4
movsd  0xed4(%rip),%xmm3
mulsd  %xmm2,%xmm3
addsd  %xmm4,%xmm3
mulsd  0xecc(%rip),%xmm1
movsd  %xmm3,(%rsi)
mulsd  0xec8(%rip),%xmm0
addsd  %xmm1,%xmm0
mulsd  0xec4(%rip),%xmm2
addsd  %xmm0,%xmm2
movsd  %xmm2,(%rdx)
ret

LLVM IR (-O0):
define void @libclut_model_linear_to_ciexyz(double %0, double %1, double %2, double* %3, double* %4, double* %5) {
%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
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double* %3, double** %10
store double* %4, double** %11
store double* %5, double** %12
br label %16
16: ; preds = %6
%17 = load double, double* %7
store double %17, double* %13
%18 = load double, double* %8
store double %18, double* %14
%19 = load double, double* %9
store double %19, double* %15
%20 = load double, double* %13
%21 = load double, double* %14
%22 = fmul double 0x3FD6E286DDD532CD, %21
%23 = call double @llvm.fmuladd.f64(double 0x3FDA65AF8741A841, double %20, double %22)
%24 = load double, double* %15
%25 = call double @llvm.fmuladd.f64(double 0x3FC7189374BC6A7F, double %24, double %23)
%26 = load double*, double** %10
store double %25, double* %26
%27 = load double, double* %13
%28 = load double, double* %14
%29 = fmul double 0x3FE6E286DDD532CD, %28
%30 = call double @llvm.fmuladd.f64(double 0x3FCB38DD971F6BD6, double %27, double %29)
%31 = load double, double* %15
%32 = call double @llvm.fmuladd.f64(double 7.217500e-02, double %31, double %30)
%33 = load double*, double** %11
store double %32, double* %33
%34 = load double, double* %13
%35 = load double, double* %14
%36 = fmul double 1.191920e-01, %35
%37 = call double @llvm.fmuladd.f64(double 1.933390e-02, double %34, double %36)
%38 = load double, double* %15
%39 = call double @llvm.fmuladd.f64(double 0x3FEE68E424D8269D, double %38, double %37)
%40 = load double*, double** %12
store double %39, double* %40
br label %41
41: ; preds = %16
ret void
}

LLVM IR (-O2):
define void @libclut_model_linear_to_ciexyz(double %0, double %1, double %2, double* nocapture writeonly %3, double* nocapture writeonly %4, double* nocapture writeonly %5) {
%7 = fmul double %1, 0x3FD6E286DDD532CD
%8 = tail call double @llvm.fmuladd.f64(double %0, double 0x3FDA65AF8741A841, double %7)
%9 = tail call double @llvm.fmuladd.f64(double %2, double 0x3FC7189374BC6A7F, double %8)
store double %9, double* %3
%10 = fmul double %1, 0x3FE6E286DDD532CD
%11 = tail call double @llvm.fmuladd.f64(double %0, double 0x3FCB38DD971F6BD6, double %10)
%12 = tail call double @llvm.fmuladd.f64(double %2, double 7.217500e-02, double %11)
store double %12, double* %4
%13 = fmul double %1, 1.191920e-01
%14 = tail call double @llvm.fmuladd.f64(double %0, double 1.933390e-02, double %13)
%15 = tail call double @llvm.fmuladd.f64(double %2, double 0x3FEE68E424D8269D, double %14)
store double %15, double* %5
ret void
}