void HoSepia(int R, int G, int B, double *HR, double *HG, double *HB) {
  double incR, incG, incB;
  *HR = R * 0.393 + G * 0.769 + B * 0.189;
  *HG = R * 0.349 + G * 0.686 + B * 0.168;
  *HB = R * 0.272 + G * 0.534 + B * 0.131;
  return;
}


x86 assembly (clang, -O0):
<HoSepia>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xf15(%rip),%xmm2
mulsd  %xmm2,%xmm0
movsd  0xf01(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  0xee4(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
cvtsi2sdl -0x4(%rbp),%xmm1
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xeba(%rip),%xmm2
mulsd  %xmm2,%xmm0
movsd  0xea6(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  0xe89(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
cvtsi2sdl -0x4(%rbp),%xmm1
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xe5f(%rip),%xmm2
mulsd  %xmm2,%xmm0
movsd  0xe4b(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  0xe2e(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<HoSepia>:
cvtsi2sd %edi,%xmm0
cvtsi2sd %esi,%xmm1
movsd  0xef0(%rip),%xmm2
mulsd  %xmm1,%xmm2
movsd  0xeec(%rip),%xmm3
mulsd  %xmm0,%xmm3
addsd  %xmm2,%xmm3
xorps  %xmm2,%xmm2
cvtsi2sd %edx,%xmm2
movsd  0xedd(%rip),%xmm4
mulsd  %xmm2,%xmm4
addsd  %xmm3,%xmm4
movsd  %xmm4,(%rcx)
movsd  0xed1(%rip),%xmm3
mulsd  %xmm1,%xmm3
movsd  0xecd(%rip),%xmm4
mulsd  %xmm0,%xmm4
addsd  %xmm3,%xmm4
movsd  0xec5(%rip),%xmm3
mulsd  %xmm2,%xmm3
addsd  %xmm4,%xmm3
mulsd  0xebd(%rip),%xmm1
movsd  %xmm3,(%r8)
mulsd  0xeb8(%rip),%xmm0
addsd  %xmm1,%xmm0
mulsd  0xeb4(%rip),%xmm2
addsd  %xmm0,%xmm2
movsd  %xmm2,(%r9)
ret

LLVM IR (-O0):
define void @HoSepia(i32 %0, i32 %1, i32 %2, double* %3, double* %4, double* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca double
%14 = alloca double
%15 = alloca double
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store double* %3, double** %10
store double* %4, double** %11
store double* %5, double** %12
%16 = load i32, i32* %7
%17 = sitofp i32 %16 to double
%18 = load i32, i32* %8
%19 = sitofp i32 %18 to double
%20 = fmul double %19, 7.690000e-01
%21 = call double @llvm.fmuladd.f64(double %17, double 3.930000e-01, double %20)
%22 = load i32, i32* %9
%23 = sitofp i32 %22 to double
%24 = call double @llvm.fmuladd.f64(double %23, double 1.890000e-01, double %21)
%25 = load double*, double** %10
store double %24, double* %25
%26 = load i32, i32* %7
%27 = sitofp i32 %26 to double
%28 = load i32, i32* %8
%29 = sitofp i32 %28 to double
%30 = fmul double %29, 6.860000e-01
%31 = call double @llvm.fmuladd.f64(double %27, double 3.490000e-01, double %30)
%32 = load i32, i32* %9
%33 = sitofp i32 %32 to double
%34 = call double @llvm.fmuladd.f64(double %33, double 1.680000e-01, double %31)
%35 = load double*, double** %11
store double %34, double* %35
%36 = load i32, i32* %7
%37 = sitofp i32 %36 to double
%38 = load i32, i32* %8
%39 = sitofp i32 %38 to double
%40 = fmul double %39, 5.340000e-01
%41 = call double @llvm.fmuladd.f64(double %37, double 2.720000e-01, double %40)
%42 = load i32, i32* %9
%43 = sitofp i32 %42 to double
%44 = call double @llvm.fmuladd.f64(double %43, double 1.310000e-01, double %41)
%45 = load double*, double** %12
store double %44, double* %45
ret void
}

LLVM IR (-O2):
define void @HoSepia(i32 %0, i32 %1, i32 %2, double* nocapture writeonly %3, double* nocapture writeonly %4, double* nocapture writeonly %5) {
%7 = sitofp i32 %0 to double
%8 = sitofp i32 %1 to double
%9 = fmul double %8, 7.690000e-01
%10 = tail call double @llvm.fmuladd.f64(double %7, double 3.930000e-01, double %9)
%11 = sitofp i32 %2 to double
%12 = tail call double @llvm.fmuladd.f64(double %11, double 1.890000e-01, double %10)
store double %12, double* %3
%13 = fmul double %8, 6.860000e-01
%14 = tail call double @llvm.fmuladd.f64(double %7, double 3.490000e-01, double %13)
%15 = tail call double @llvm.fmuladd.f64(double %11, double 1.680000e-01, double %14)
store double %15, double* %4
%16 = fmul double %8, 5.340000e-01
%17 = tail call double @llvm.fmuladd.f64(double %7, double 2.720000e-01, double %16)
%18 = tail call double @llvm.fmuladd.f64(double %11, double 1.310000e-01, double %17)
store double %18, double* %5
ret void
}