void Lut_Lab2Lut16(double *out, double *in) {
  out[0] = in[0] * 65280.0 / (100.0 * 65535.0);
  out[1] = (in[1] + 128.0) * 65280.0 / (255.0 * 65535.0);
  out[2] = (in[2] + 128.0) * 65280.0 / (255.0 * 65535.0);
}


x86 assembly (clang, -O0):
<Lut_Lab2Lut16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  0xef0(%rip),%xmm0
mulsd  (%rax),%xmm0
movsd  0xef4(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0xed4(%rip),%xmm0
addsd  0x8(%rax),%xmm0
movsd  0xebf(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeab(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0xea2(%rip),%xmm0
addsd  0x10(%rax),%xmm0
movsd  0xe8d(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe79(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Lut_Lab2Lut16>:
movsd  0xef8(%rip),%xmm0
movsd  (%rsi),%xmm1
mulsd  %xmm0,%xmm1
divsd  0xef0(%rip),%xmm1
movsd  %xmm1,(%rdi)
movsd  0xeec(%rip),%xmm1
movsd  0x8(%rsi),%xmm2
addsd  %xmm1,%xmm2
mulsd  %xmm0,%xmm2
movsd  0xedf(%rip),%xmm3
divsd  %xmm3,%xmm2
movsd  %xmm2,0x8(%rdi)
addsd  0x10(%rsi),%xmm1
mulsd  %xmm0,%xmm1
divsd  %xmm3,%xmm1
movsd  %xmm1,0x10(%rdi)
ret

LLVM IR (-O0):
define void @Lut_Lab2Lut16(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = fmul double %7, 6.528000e+04
%9 = fdiv double %8, 6.553500e+06
%10 = load double*, double** %3
%11 = getelementptr inbounds double, double* %10, i64 0
store double %9, double* %11
%12 = load double*, double** %4
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = fadd double %14, 1.280000e+02
%16 = fmul double %15, 6.528000e+04
%17 = fdiv double %16, 0x416FDFE020000000
%18 = load double*, double** %3
%19 = getelementptr inbounds double, double* %18, i64 1
store double %17, double* %19
%20 = load double*, double** %4
%21 = getelementptr inbounds double, double* %20, i64 2
%22 = load double, double* %21
%23 = fadd double %22, 1.280000e+02
%24 = fmul double %23, 6.528000e+04
%25 = fdiv double %24, 0x416FDFE020000000
%26 = load double*, double** %3
%27 = getelementptr inbounds double, double* %26, i64 2
store double %25, double* %27
ret void
}

LLVM IR (-O2):
define void @Lut_Lab2Lut16(double* nocapture writeonly %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = fmul double %3, 6.528000e+04
%5 = fdiv double %4, 6.553500e+06
store double %5, double* %0
%6 = getelementptr inbounds double, double* %1, i64 1
%7 = load double, double* %6
%8 = fadd double %7, 1.280000e+02
%9 = fmul double %8, 6.528000e+04
%10 = fdiv double %9, 0x416FDFE020000000
%11 = getelementptr inbounds double, double* %0, i64 1
store double %10, double* %11
%12 = getelementptr inbounds double, double* %1, i64 2
%13 = load double, double* %12
%14 = fadd double %13, 1.280000e+02
%15 = fmul double %14, 6.528000e+04
%16 = fdiv double %15, 0x416FDFE020000000
%17 = getelementptr inbounds double, double* %0, i64 2
store double %16, double* %17
ret void
}