void rgb(double x0, double x1, double x2, double x3, double x4, double x5,
         double x6, double x7, double a, double b, double c, double d, double e,
         double f, double g, double *y0, double *y1, double *y2, double *y3,
         double *y4, double *y5, double *y6, double *y7) {
  double T1 = x0 + x7;
  double T2 = x1 + x6;
  double T3 = x2 + x5;
  double T4 = x3 + x4;
  double T5 = x0 - x7;
  double T6 = x1 - x6;
  double T7 = x2 - x5;
  double T8 = x3 - x4;
  *y0 = (T1 + T2 + T3 + T4) * g;
  *y2 = b * (T1 - T4) + e * (T2 - T3);
  *y4 = ((T1 + T4) - (T2 + T3)) * g;
  *y6 = e * (T1 - T4) - b * (T2 - T3);
  *y1 = a * T5 - c * T6 + d * T7 - f * T8;
  *y3 = c * T5 + f * T6 - a * T7 + d * T8;
  *y5 = d * T5 + a * T6 + f * T7 - c * T8;
  *y7 = f * T5 + d * T6 + c * T7 + a * T8;
}


x86 assembly (clang, -O0):
<rgb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x50(%rbp),%rax
mov    0x48(%rbp),%rax
movsd  0x40(%rbp),%xmm8
movsd  0x38(%rbp),%xmm8
movsd  0x30(%rbp),%xmm8
movsd  0x28(%rbp),%xmm8
movsd  0x20(%rbp),%xmm8
movsd  0x18(%rbp),%xmm8
movsd  0x10(%rbp),%xmm8
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  %xmm6,-0x38(%rbp)
movsd  %xmm7,-0x40(%rbp)
mov    %rdi,-0x48(%rbp)
mov    %rsi,-0x50(%rbp)
mov    %rdx,-0x58(%rbp)
mov    %rcx,-0x60(%rbp)
mov    %r8,-0x68(%rbp)
mov    %r9,-0x70(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x18(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x8(%rbp),%xmm0
subsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
addsd  -0x80(%rbp),%xmm0
addsd  -0x88(%rbp),%xmm0
ff
addsd  -0x90(%rbp),%xmm0
ff
mulsd  0x40(%rbp),%xmm0
mov    -0x48(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0x18(%rbp),%xmm0
movsd  -0x78(%rbp),%xmm2
subsd  -0x90(%rbp),%xmm2
ff
movsd  0x30(%rbp),%xmm1
movsd  -0x80(%rbp),%xmm3
subsd  -0x88(%rbp),%xmm3
ff
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x58(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x78(%rbp),%xmm0
addsd  -0x90(%rbp),%xmm0
ff
movsd  -0x80(%rbp),%xmm1
addsd  -0x88(%rbp),%xmm1
ff
subsd  %xmm1,%xmm0
mulsd  0x40(%rbp),%xmm0
mov    -0x68(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0x30(%rbp),%xmm0
movsd  -0x78(%rbp),%xmm2
subsd  -0x90(%rbp),%xmm2
ff
movsd  0x18(%rbp),%xmm1
movsd  -0x80(%rbp),%xmm3
subsd  -0x88(%rbp),%xmm3
ff
mulsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    0x48(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0x10(%rbp),%xmm0
movsd  -0x98(%rbp),%xmm2
ff
movsd  0x20(%rbp),%xmm1
mulsd  -0xa0(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0x28(%rbp),%xmm1
movsd  -0xa8(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0x38(%rbp),%xmm0
movsd  -0xb0(%rbp),%xmm2
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x50(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0x20(%rbp),%xmm0
movsd  -0x98(%rbp),%xmm2
ff
movsd  0x38(%rbp),%xmm1
mulsd  -0xa0(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0x10(%rbp),%xmm1
movsd  -0xa8(%rbp),%xmm2
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0x28(%rbp),%xmm0
movsd  -0xb0(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x60(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0x28(%rbp),%xmm0
movsd  -0x98(%rbp),%xmm2
ff
movsd  0x10(%rbp),%xmm1
mulsd  -0xa0(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0x38(%rbp),%xmm1
movsd  -0xa8(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0x20(%rbp),%xmm0
movsd  -0xb0(%rbp),%xmm2
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x70(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0x38(%rbp),%xmm0
movsd  -0x98(%rbp),%xmm2
ff
movsd  0x28(%rbp),%xmm1
mulsd  -0xa0(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0x20(%rbp),%xmm1
movsd  -0xa8(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rbp),%xmm0
movsd  -0xb0(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    0x50(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgb>:
movsd  0x10(%rsp),%xmm10
movsd  0x28(%rsp),%xmm8
movsd  0x38(%rsp),%xmm9
movapd %xmm0,%xmm11
addsd  %xmm7,%xmm11
movapd %xmm1,%xmm12
addsd  %xmm6,%xmm12
movapd %xmm2,%xmm13
addsd  %xmm5,%xmm13
subsd  %xmm7,%xmm0
movapd %xmm3,%xmm7
addsd  %xmm4,%xmm7
subsd  %xmm6,%xmm1
subsd  %xmm5,%xmm2
subsd  %xmm4,%xmm3
movapd %xmm12,%xmm4
addsd  %xmm11,%xmm4
addsd  %xmm13,%xmm4
addsd  %xmm7,%xmm4
mulsd  %xmm9,%xmm4
movsd  %xmm4,(%rdi)
movapd %xmm11,%xmm6
subsd  %xmm7,%xmm6
movapd %xmm12,%xmm4
subsd  %xmm13,%xmm4
movapd %xmm4,%xmm5
mulsd  %xmm8,%xmm5
mulsd  %xmm10,%xmm4
mulsd  %xmm6,%xmm10
addsd  %xmm5,%xmm10
movsd  %xmm10,(%rdx)
movsd  0x30(%rsp),%xmm10
addsd  %xmm11,%xmm7
movsd  0x20(%rsp),%xmm14
addsd  %xmm12,%xmm13
movsd  0x8(%rsp),%xmm12
subsd  %xmm13,%xmm7
movsd  0x18(%rsp),%xmm11
mov    0x40(%rsp),%rax
mulsd  %xmm9,%xmm7
movsd  %xmm7,(%r8)
mulsd  %xmm8,%xmm6
subsd  %xmm4,%xmm6
movsd  %xmm6,(%rax)
movapd %xmm1,%xmm4
mulsd  %xmm11,%xmm4
movapd %xmm1,%xmm8
mulsd  %xmm12,%xmm8
movapd %xmm12,%xmm6
mulsd  %xmm0,%xmm6
subsd  %xmm4,%xmm6
movapd %xmm14,%xmm4
mulsd  %xmm2,%xmm4
addsd  %xmm6,%xmm4
movapd %xmm10,%xmm6
mulsd  %xmm3,%xmm6
movapd %xmm14,%xmm5
mulsd  %xmm3,%xmm5
movapd %xmm11,%xmm7
mulsd  %xmm3,%xmm7
mulsd  %xmm12,%xmm3
subsd  %xmm6,%xmm4
movsd  %xmm4,(%rsi)
movapd %xmm1,%xmm4
mulsd  %xmm10,%xmm4
mulsd  %xmm2,%xmm12
movapd %xmm10,%xmm6
mulsd  %xmm2,%xmm6
mulsd  %xmm11,%xmm2
mulsd  %xmm0,%xmm11
addsd  %xmm4,%xmm11
subsd  %xmm12,%xmm11
addsd  %xmm11,%xmm5
movsd  %xmm5,(%rcx)
mulsd  %xmm14,%xmm1
mulsd  %xmm0,%xmm14
addsd  %xmm8,%xmm14
addsd  %xmm14,%xmm6
subsd  %xmm7,%xmm6
movsd  %xmm6,(%r9)
mulsd  %xmm10,%xmm0
addsd  %xmm1,%xmm0
addsd  %xmm0,%xmm2
addsd  %xmm2,%xmm3
mov    0x48(%rsp),%rax
movsd  %xmm3,(%rax)
ret

LLVM IR (-O0):
define void @rgb(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8, double %9, double %10, double %11, double %12, double %13, double %14, double* %15, double* %16, double* %17, double* %18, double* %19, double* %20, double* %21, double* %22) {
%24 = alloca double
%25 = alloca double
%26 = alloca double
%27 = alloca double
%28 = alloca double
%29 = alloca double
%30 = alloca double
%31 = alloca double
%32 = alloca double
%33 = alloca double
%34 = alloca double
%35 = alloca double
%36 = alloca double
%37 = alloca double
%38 = alloca double
%39 = alloca double*
%40 = alloca double*
%41 = alloca double*
%42 = alloca double*
%43 = alloca double*
%44 = alloca double*
%45 = alloca double*
%46 = alloca double*
%47 = alloca double
%48 = alloca double
%49 = alloca double
%50 = alloca double
%51 = alloca double
%52 = alloca double
%53 = alloca double
%54 = alloca double
store double %0, double* %24
store double %1, double* %25
store double %2, double* %26
store double %3, double* %27
store double %4, double* %28
store double %5, double* %29
store double %6, double* %30
store double %7, double* %31
store double %8, double* %32
store double %9, double* %33
store double %10, double* %34
store double %11, double* %35
store double %12, double* %36
store double %13, double* %37
store double %14, double* %38
store double* %15, double** %39
store double* %16, double** %40
store double* %17, double** %41
store double* %18, double** %42
store double* %19, double** %43
store double* %20, double** %44
store double* %21, double** %45
store double* %22, double** %46
%55 = load double, double* %24
%56 = load double, double* %31
%57 = fadd double %55, %56
store double %57, double* %47
%58 = load double, double* %25
%59 = load double, double* %30
%60 = fadd double %58, %59
store double %60, double* %48
%61 = load double, double* %26
%62 = load double, double* %29
%63 = fadd double %61, %62
store double %63, double* %49
%64 = load double, double* %27
%65 = load double, double* %28
%66 = fadd double %64, %65
store double %66, double* %50
%67 = load double, double* %24
%68 = load double, double* %31
%69 = fsub double %67, %68
store double %69, double* %51
%70 = load double, double* %25
%71 = load double, double* %30
%72 = fsub double %70, %71
store double %72, double* %52
%73 = load double, double* %26
%74 = load double, double* %29
%75 = fsub double %73, %74
store double %75, double* %53
%76 = load double, double* %27
%77 = load double, double* %28
%78 = fsub double %76, %77
store double %78, double* %54
%79 = load double, double* %47
%80 = load double, double* %48
%81 = fadd double %79, %80
%82 = load double, double* %49
%83 = fadd double %81, %82
%84 = load double, double* %50
%85 = fadd double %83, %84
%86 = load double, double* %38
%87 = fmul double %85, %86
%88 = load double*, double** %39
store double %87, double* %88
%89 = load double, double* %33
%90 = load double, double* %47
%91 = load double, double* %50
%92 = fsub double %90, %91
%93 = load double, double* %36
%94 = load double, double* %48
%95 = load double, double* %49
%96 = fsub double %94, %95
%97 = fmul double %93, %96
%98 = call double @llvm.fmuladd.f64(double %89, double %92, double %97)
%99 = load double*, double** %41
store double %98, double* %99
%100 = load double, double* %47
%101 = load double, double* %50
%102 = fadd double %100, %101
%103 = load double, double* %48
%104 = load double, double* %49
%105 = fadd double %103, %104
%106 = fsub double %102, %105
%107 = load double, double* %38
%108 = fmul double %106, %107
%109 = load double*, double** %43
store double %108, double* %109
%110 = load double, double* %36
%111 = load double, double* %47
%112 = load double, double* %50
%113 = fsub double %111, %112
%114 = load double, double* %33
%115 = load double, double* %48
%116 = load double, double* %49
%117 = fsub double %115, %116
%118 = fmul double %114, %117
%119 = fneg double %118
%120 = call double @llvm.fmuladd.f64(double %110, double %113, double %119)
%121 = load double*, double** %45
store double %120, double* %121
%122 = load double, double* %32
%123 = load double, double* %51
%124 = load double, double* %34
%125 = load double, double* %52
%126 = fmul double %124, %125
%127 = fneg double %126
%128 = call double @llvm.fmuladd.f64(double %122, double %123, double %127)
%129 = load double, double* %35
%130 = load double, double* %53
%131 = call double @llvm.fmuladd.f64(double %129, double %130, double %128)
%132 = load double, double* %37
%133 = load double, double* %54
%134 = fneg double %132
%135 = call double @llvm.fmuladd.f64(double %134, double %133, double %131)
%136 = load double*, double** %40
store double %135, double* %136
%137 = load double, double* %34
%138 = load double, double* %51
%139 = load double, double* %37
%140 = load double, double* %52
%141 = fmul double %139, %140
%142 = call double @llvm.fmuladd.f64(double %137, double %138, double %141)
%143 = load double, double* %32
%144 = load double, double* %53
%145 = fneg double %143
%146 = call double @llvm.fmuladd.f64(double %145, double %144, double %142)
%147 = load double, double* %35
%148 = load double, double* %54
%149 = call double @llvm.fmuladd.f64(double %147, double %148, double %146)
%150 = load double*, double** %42
store double %149, double* %150
%151 = load double, double* %35
%152 = load double, double* %51
%153 = load double, double* %32
%154 = load double, double* %52
%155 = fmul double %153, %154
%156 = call double @llvm.fmuladd.f64(double %151, double %152, double %155)
%157 = load double, double* %37
%158 = load double, double* %53
%159 = call double @llvm.fmuladd.f64(double %157, double %158, double %156)
%160 = load double, double* %34
%161 = load double, double* %54
%162 = fneg double %160
%163 = call double @llvm.fmuladd.f64(double %162, double %161, double %159)
%164 = load double*, double** %44
store double %163, double* %164
%165 = load double, double* %37
%166 = load double, double* %51
%167 = load double, double* %35
%168 = load double, double* %52
%169 = fmul double %167, %168
%170 = call double @llvm.fmuladd.f64(double %165, double %166, double %169)
%171 = load double, double* %34
%172 = load double, double* %53
%173 = call double @llvm.fmuladd.f64(double %171, double %172, double %170)
%174 = load double, double* %32
%175 = load double, double* %54
%176 = call double @llvm.fmuladd.f64(double %174, double %175, double %173)
%177 = load double*, double** %46
store double %176, double* %177
ret void
}

LLVM IR (-O2):
define void @rgb(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8, double %9, double %10, double %11, double %12, double %13, double %14, double* nocapture writeonly %15, double* nocapture writeonly %16, double* nocapture writeonly %17, double* nocapture writeonly %18, double* nocapture writeonly %19, double* nocapture writeonly %20, double* nocapture writeonly %21, double* nocapture writeonly %22) {
%24 = fadd double %0, %7
%25 = fadd double %1, %6
%26 = fadd double %2, %5
%27 = fadd double %3, %4
%28 = fsub double %0, %7
%29 = fsub double %1, %6
%30 = fsub double %2, %5
%31 = fsub double %3, %4
%32 = fadd double %25, %24
%33 = fadd double %26, %32
%34 = fadd double %27, %33
%35 = fmul double %34, %14
store double %35, double* %15
%36 = fsub double %24, %27
%37 = fsub double %25, %26
%38 = fmul double %37, %12
%39 = tail call double @llvm.fmuladd.f64(double %9, double %36, double %38)
store double %39, double* %17
%40 = fadd double %27, %24
%41 = fadd double %26, %25
%42 = fsub double %40, %41
%43 = fmul double %42, %14
store double %43, double* %19
%44 = fneg double %37
%45 = fmul double %44, %9
%46 = tail call double @llvm.fmuladd.f64(double %12, double %36, double %45)
store double %46, double* %21
%47 = fneg double %29
%48 = fmul double %47, %10
%49 = tail call double @llvm.fmuladd.f64(double %8, double %28, double %48)
%50 = tail call double @llvm.fmuladd.f64(double %11, double %30, double %49)
%51 = fneg double %13
%52 = tail call double @llvm.fmuladd.f64(double %51, double %31, double %50)
store double %52, double* %16
%53 = fmul double %29, %13
%54 = tail call double @llvm.fmuladd.f64(double %10, double %28, double %53)
%55 = fneg double %8
%56 = tail call double @llvm.fmuladd.f64(double %55, double %30, double %54)
%57 = tail call double @llvm.fmuladd.f64(double %11, double %31, double %56)
store double %57, double* %18
%58 = fmul double %29, %8
%59 = tail call double @llvm.fmuladd.f64(double %11, double %28, double %58)
%60 = tail call double @llvm.fmuladd.f64(double %13, double %30, double %59)
%61 = fneg double %10
%62 = tail call double @llvm.fmuladd.f64(double %61, double %31, double %60)
store double %62, double* %20
%63 = fmul double %29, %11
%64 = tail call double @llvm.fmuladd.f64(double %13, double %28, double %63)
%65 = tail call double @llvm.fmuladd.f64(double %10, double %30, double %64)
%66 = tail call double @llvm.fmuladd.f64(double %8, double %31, double %65)
store double %66, double* %22
ret void
}