void cat02_to_hpe(double *rh, double *gh, double *bh, double r, double g,
                  double b) {
  *rh = (0.7409792 * r) + (0.2180250 * g) + (0.0410058 * b);
  *gh = (0.2853532 * r) + (0.6242014 * g) + (0.0904454 * b);
  *bh = (-0.0096280 * r) - (0.0056980 * g) + (1.0153260 * b);
}


x86 assembly (clang, -O0):
<cat02_to_hpe>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
movsd  %xmm2,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  0xf14(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  0xeff(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
movsd  0xee2(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x20(%rbp),%xmm1
movsd  0xebd(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  0xea8(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
movsd  0xe8b(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x20(%rbp),%xmm1
movsd  0xe66(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe3a(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
movsd  0xe1d(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cat02_to_hpe>:
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 @cat02_to_hpe(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
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
%13 = load double, double* %10
%14 = load double, double* %11
%15 = fmul double 2.180250e-01, %14
%16 = call double @llvm.fmuladd.f64(double 0x3FE7B61A02E08510, double %13, double %15)
%17 = load double, double* %12
%18 = call double @llvm.fmuladd.f64(double 4.100580e-02, double %17, double %16)
%19 = load double*, double** %7
store double %18, double* %19
%20 = load double, double* %10
%21 = load double, double* %11
%22 = fmul double 0x3FE3F97536E3C1DC, %21
%23 = call double @llvm.fmuladd.f64(double 0x3FD2433A1173C5CA, double %20, double %22)
%24 = load double, double* %12
%25 = call double @llvm.fmuladd.f64(double 0x3FB7276E0312D9F7, double %24, double %23)
%26 = load double*, double** %8
store double %25, double* %26
%27 = load double, double* %10
%28 = load double, double* %11
%29 = fmul double 5.698000e-03, %28
%30 = fneg double %29
%31 = call double @llvm.fmuladd.f64(double 0xBF83B7D84901D191, double %27, double %30)
%32 = load double, double* %12
%33 = call double @llvm.fmuladd.f64(double 0x3FF03EC679CC74B8, double %32, double %31)
%34 = load double*, double** %9
store double %33, double* %34
ret void
}

LLVM IR (-O2):
define void @cat02_to_hpe(double* nocapture writeonly %0, double* nocapture writeonly %1, double* nocapture writeonly %2, double %3, double %4, double %5) {
%7 = fmul double %4, 2.180250e-01
%8 = tail call double @llvm.fmuladd.f64(double %3, double 0x3FE7B61A02E08510, double %7)
%9 = tail call double @llvm.fmuladd.f64(double %5, double 4.100580e-02, double %8)
store double %9, double* %0
%10 = fmul double %4, 0x3FE3F97536E3C1DC
%11 = tail call double @llvm.fmuladd.f64(double %3, double 0x3FD2433A1173C5CA, double %10)
%12 = tail call double @llvm.fmuladd.f64(double %5, double 0x3FB7276E0312D9F7, double %11)
store double %12, double* %1
%13 = fmul double %4, -5.698000e-03
%14 = tail call double @llvm.fmuladd.f64(double %3, double 0xBF83B7D84901D191, double %13)
%15 = tail call double @llvm.fmuladd.f64(double %5, double 0x3FF03EC679CC74B8, double %14)
store double %15, double* %2
ret void
}