void yuv2rgb(double *r, double *g, double *b, double y, double u, double v) {
  double trans[9] = {0.33060074687364, -0.06178943963832, 1.37599729167600,
                     0.63013437898936, 0.06261724756816,  -0.44364366862929,
                     1.21277796507073, 1.36240555895106,  0.43443947807711};
  *r = trans[0] * y + trans[1] * u + trans[2] * v;
  *g = trans[3] * y + trans[4] * u + trans[5] * v;
  *b = trans[6] * y + trans[7] * u + trans[8] * v;
}


x86 assembly (clang, -O0):
<yuv2rgb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
movsd  %xmm2,-0x30(%rbp)
lea    -0x80(%rbp),%rdi
lea    0xebf(%rip),%rsi
mov    $0x48,%edx
call   1030 <memcpy@plt>
movsd  -0x80(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x78(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x68(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x58(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x50(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yuv2rgb>:
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):
@__const.yuv2rgb.trans = [9 x double] [double 0x3FD5289008F6BFD3, double 0xBFAFA2DD8CF83137, double 0x3FF60415BC7220BD, double 0x3FE42A0F92BB06B9, double 0x3FB007AF16788538, double 0xBFDC64A869F5C6D9, double 0x3FF36789DE149C88, double 0x3FF5CC69C579559E, double 0x3FDBCDDB3D9BAE05]
define void @yuv2rgb(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 [9 x 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
%14 = bitcast [9 x double]* %13 to i8*
%15 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 0
%16 = load double, double* %15
%17 = load double, double* %10
%18 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 1
%19 = load double, double* %18
%20 = load double, double* %11
%21 = fmul double %19, %20
%22 = call double @llvm.fmuladd.f64(double %16, double %17, double %21)
%23 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 2
%24 = load double, double* %23
%25 = load double, double* %12
%26 = call double @llvm.fmuladd.f64(double %24, double %25, double %22)
%27 = load double*, double** %7
store double %26, double* %27
%28 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 3
%29 = load double, double* %28
%30 = load double, double* %10
%31 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 4
%32 = load double, double* %31
%33 = load double, double* %11
%34 = fmul double %32, %33
%35 = call double @llvm.fmuladd.f64(double %29, double %30, double %34)
%36 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 5
%37 = load double, double* %36
%38 = load double, double* %12
%39 = call double @llvm.fmuladd.f64(double %37, double %38, double %35)
%40 = load double*, double** %8
store double %39, double* %40
%41 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 6
%42 = load double, double* %41
%43 = load double, double* %10
%44 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 7
%45 = load double, double* %44
%46 = load double, double* %11
%47 = fmul double %45, %46
%48 = call double @llvm.fmuladd.f64(double %42, double %43, double %47)
%49 = getelementptr inbounds [9 x double], [9 x double]* %13, i64 0, i64 8
%50 = load double, double* %49
%51 = load double, double* %12
%52 = call double @llvm.fmuladd.f64(double %50, double %51, double %48)
%53 = load double*, double** %9
store double %52, double* %53
ret void
}

LLVM IR (-O2):
define void @yuv2rgb(double* nocapture writeonly %0, double* nocapture writeonly %1, double* nocapture writeonly %2, double %3, double %4, double %5) {
%7 = fmul double %4, 0xBFAFA2DD8CF83137
%8 = tail call double @llvm.fmuladd.f64(double %3, double 0x3FD5289008F6BFD3, double %7)
%9 = tail call double @llvm.fmuladd.f64(double %5, double 0x3FF60415BC7220BD, double %8)
store double %9, double* %0
%10 = fmul double %4, 0x3FB007AF16788538
%11 = tail call double @llvm.fmuladd.f64(double %3, double 0x3FE42A0F92BB06B9, double %10)
%12 = tail call double @llvm.fmuladd.f64(double %5, double 0xBFDC64A869F5C6D9, double %11)
store double %12, double* %1
%13 = fmul double %4, 0x3FF5CC69C579559E
%14 = tail call double @llvm.fmuladd.f64(double %3, double 0x3FF36789DE149C88, double %13)
%15 = tail call double @llvm.fmuladd.f64(double %5, double 0x3FDBCDDB3D9BAE05, double %14)
store double %15, double* %2
ret void
}