void mct_decode_real(float *__restrict__ c0, float *__restrict__ c1,
                     float *__restrict__ c2, int n) {
  int i;
  for (i = 0; i < n; ++i) {
    float y = c0[i];
    float u = c1[i];
    float v = c2[i];
    float r = y + (v * 1.402f);
    float g = y - (u * 0.34413f) - (v * (0.71414f));
    float b = y + (u * 1.772f);
    c0[i] = r;
    c1[i] = g;
    c2[i] = b;
  }
}


x86 assembly (clang, -O0):
<mct_decode_real>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    122c <mct_decode_real+0x12c>
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x24(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x28(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x24(%rbp),%xmm1
movss  -0x2c(%rbp),%xmm0
movss  0xe9e(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x24(%rbp),%xmm0
movss  -0x28(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
movss  0xe6e(%rip),%xmm2
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0x2c(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  0xe48(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x24(%rbp),%xmm1
movss  -0x28(%rbp),%xmm0
movss  0xe25(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x38(%rbp)
movss  -0x30(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
movss  -0x34(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
movss  -0x38(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    111a <mct_decode_real+0x1a>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mct_decode_real>:
test   %ecx,%ecx
jle    120e <mct_decode_real+0x10e>
mov    %ecx,%r8d
cmp    $0x4,%ecx
jae    1117 <mct_decode_real+0x17>
xor    %ecx,%ecx
jmp    1195 <mct_decode_real+0x95>
mov    %r8d,%ecx
and    $0xfffffffc,%ecx
lea    0x0(,%r8,4),%r9
and    $0xfffffffffffffff0,%r9
xor    %eax,%eax
movaps 0xecd(%rip),%xmm8
movaps 0xed6(%rip),%xmm1
movaps 0xedf(%rip),%xmm2
movaps 0xee8(%rip),%xmm3
nopl   0x0(%rax,%rax,1)
movups (%rdi,%rax,1),%xmm4
movups (%rsi,%rax,1),%xmm0
movups (%rdx,%rax,1),%xmm6
movaps %xmm6,%xmm7
mulps  %xmm8,%xmm7
addps  %xmm4,%xmm7
movaps %xmm0,%xmm5
mulps  %xmm1,%xmm5
addps  %xmm4,%xmm5
mulps  %xmm2,%xmm6
addps  %xmm5,%xmm6
mulps  %xmm3,%xmm0
addps  %xmm4,%xmm0
movups %xmm7,(%rdi,%rax,1)
movups %xmm6,(%rsi,%rax,1)
movups %xmm0,(%rdx,%rax,1)
add    $0x10,%rax
cmp    %rax,%r9
jne    1150 <mct_decode_real+0x50>
cmp    %r8,%rcx
je     120e <mct_decode_real+0x10e>
movss  0xea2(%rip),%xmm8
movss  0xe9e(%rip),%xmm1
movss  0xe9a(%rip),%xmm2
movss  0xe96(%rip),%xmm3
cs nopw 0x0(%rax,%rax,1)
movss  (%rdi,%rcx,4),%xmm4
movss  (%rsi,%rcx,4),%xmm0
movss  (%rdx,%rcx,4),%xmm6
movaps %xmm6,%xmm7
mulss  %xmm8,%xmm7
addss  %xmm4,%xmm7
movaps %xmm0,%xmm5
mulss  %xmm1,%xmm5
addss  %xmm4,%xmm5
mulss  %xmm2,%xmm6
addss  %xmm5,%xmm6
mulss  %xmm3,%xmm0
addss  %xmm4,%xmm0
movss  %xmm7,(%rdi,%rcx,4)
movss  %xmm6,(%rsi,%rcx,4)
movss  %xmm0,(%rdx,%rcx,4)
add    $0x1,%rcx
cmp    %rcx,%r8
jne    11c0 <mct_decode_real+0xc0>
ret

LLVM IR (-O0):
define void @mct_decode_real(float* noalias %0, float* noalias %1, float* noalias %2, i32 %3) {
%5 = alloca float*
%6 = alloca float*
%7 = alloca float*
%8 = alloca i32
%9 = alloca i32
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca float
store float* %0, float** %5
store float* %1, float** %6
store float* %2, float** %7
store i32 %3, i32* %8
store i32 0, i32* %9
br label %16
16: ; preds = %64, %4
%17 = load i32, i32* %9
%18 = load i32, i32* %8
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %67
20: ; preds = %16
%21 = load float*, float** %5
%22 = load i32, i32* %9
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds float, float* %21, i64 %23
%25 = load float, float* %24
store float %25, float* %10
%26 = load float*, float** %6
%27 = load i32, i32* %9
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds float, float* %26, i64 %28
%30 = load float, float* %29
store float %30, float* %11
%31 = load float*, float** %7
%32 = load i32, i32* %9
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds float, float* %31, i64 %33
%35 = load float, float* %34
store float %35, float* %12
%36 = load float, float* %10
%37 = load float, float* %12
%38 = call float @llvm.fmuladd.f32(float %37, float 0x3FF66E9780000000, float %36)
store float %38, float* %13
%39 = load float, float* %10
%40 = load float, float* %11
%41 = fneg float %40
%42 = call float @llvm.fmuladd.f32(float %41, float 0x3FD60639E0000000, float %39)
%43 = load float, float* %12
%44 = fneg float %43
%45 = call float @llvm.fmuladd.f32(float %44, float 0x3FE6DA3C20000000, float %42)
store float %45, float* %14
%46 = load float, float* %10
%47 = load float, float* %11
%48 = call float @llvm.fmuladd.f32(float %47, float 0x3FFC5A1CA0000000, float %46)
store float %48, float* %15
%49 = load float, float* %13
%50 = load float*, float** %5
%51 = load i32, i32* %9
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds float, float* %50, i64 %52
store float %49, float* %53
%54 = load float, float* %14
%55 = load float*, float** %6
%56 = load i32, i32* %9
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds float, float* %55, i64 %57
store float %54, float* %58
%59 = load float, float* %15
%60 = load float*, float** %7
%61 = load i32, i32* %9
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds float, float* %60, i64 %62
store float %59, float* %63
br label %64
64: ; preds = %20
%65 = load i32, i32* %9
%66 = add nsw i32 %65, 1
store i32 %66, i32* %9
br label %16
67: ; preds = %16
ret void
}

LLVM IR (-O2):
define void @mct_decode_real(float* noalias nocapture %0, float* noalias nocapture %1, float* noalias nocapture %2, i32 %3) {
%5 = icmp sgt i32 %3, 0
br i1 %5, label %6, label %53
6: ; preds = %4
%7 = zext i32 %3 to i64
%8 = icmp ult i32 %3, 4
br i1 %8, label %35, label %9
9: ; preds = %6
%10 = and i64 %7, 4294967292
br label %11
11: ; preds = %11, %9
%12 = phi i64 [ 0, %9 ], [ %31, %11 ]
%13 = getelementptr inbounds float, float* %0, i64 %12
%14 = bitcast float* %13 to <4 x float>*
%15 = load <4 x float>, <4 x float>* %14
%16 = getelementptr inbounds float, float* %1, i64 %12
%17 = bitcast float* %16 to <4 x float>*
%18 = load <4 x float>, <4 x float>* %17
%19 = getelementptr inbounds float, float* %2, i64 %12
%20 = bitcast float* %19 to <4 x float>*
%21 = load <4 x float>, <4 x float>* %20
%22 = call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %21, <4 x float> <float 0x3FF66E9780000000, float 0x3FF66E9780000000, float 0x3FF66E9780000000, float 0x3FF66E9780000000>, <4 x float> %15)
%23 = fneg <4 x float> %18
%24 = call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %23, <4 x float> <float 0x3FD60639E0000000, float 0x3FD60639E0000000, float 0x3FD60639E0000000, float 0x3FD60639E0000000>, <4 x float> %15)
%25 = fneg <4 x float> %21
%26 = call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %25, <4 x float> <float 0x3FE6DA3C20000000, float 0x3FE6DA3C20000000, float 0x3FE6DA3C20000000, float 0x3FE6DA3C20000000>, <4 x float> %24)
%27 = call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %18, <4 x float> <float 0x3FFC5A1CA0000000, float 0x3FFC5A1CA0000000, float 0x3FFC5A1CA0000000, float 0x3FFC5A1CA0000000>, <4 x float> %15)
%28 = bitcast float* %13 to <4 x float>*
store <4 x float> %22, <4 x float>* %28
%29 = bitcast float* %16 to <4 x float>*
store <4 x float> %26, <4 x float>* %29
%30 = bitcast float* %19 to <4 x float>*
store <4 x float> %27, <4 x float>* %30
%31 = add nuw i64 %12, 4
%32 = icmp eq i64 %31, %10
br i1 %32, label %33, label %11
33: ; preds = %11
%34 = icmp eq i64 %10, %7
br i1 %34, label %53, label %35
35: ; preds = %6, %33
%36 = phi i64 [ 0, %6 ], [ %10, %33 ]
br label %37
37: ; preds = %35, %37
%38 = phi i64 [ %51, %37 ], [ %36, %35 ]
%39 = getelementptr inbounds float, float* %0, i64 %38
%40 = load float, float* %39
%41 = getelementptr inbounds float, float* %1, i64 %38
%42 = load float, float* %41
%43 = getelementptr inbounds float, float* %2, i64 %38
%44 = load float, float* %43
%45 = tail call float @llvm.fmuladd.f32(float %44, float 0x3FF66E9780000000, float %40)
%46 = fneg float %42
%47 = tail call float @llvm.fmuladd.f32(float %46, float 0x3FD60639E0000000, float %40)
%48 = fneg float %44
%49 = tail call float @llvm.fmuladd.f32(float %48, float 0x3FE6DA3C20000000, float %47)
%50 = tail call float @llvm.fmuladd.f32(float %42, float 0x3FFC5A1CA0000000, float %40)
store float %45, float* %39
store float %49, float* %41
store float %50, float* %43
%51 = add nuw nsw i64 %38, 1
%52 = icmp eq i64 %51, %7
br i1 %52, label %53, label %37
53: ; preds = %37, %33, %4
ret void
}