void mdct_butterfly_8(double *x) {
  double r0 = x[6] + x[2];
  double r1 = x[6] - x[2];
  double r2 = x[4] + x[0];
  double r3 = x[4] - x[0];
  x[6] = r0 + r2;
  x[4] = r0 - r2;
  r0 = x[5] - x[1];
  r2 = x[7] - x[3];
  x[0] = r1 + r0;
  x[2] = r1 - r0;
  r0 = x[5] + x[1];
  r1 = x[7] + x[3];
  x[3] = r2 + r3;
  x[1] = r2 - r3;
  x[7] = r1 + r0;
  x[5] = r1 - r0;
}


x86 assembly (clang, -O0):
<mdct_butterfly_8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x30(%rax),%xmm0
mov    -0x8(%rbp),%rax
addsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x30(%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x20(%rax),%xmm0
mov    -0x8(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x20(%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x30(%rax)
movsd  -0x10(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x20(%rax)
mov    -0x8(%rbp),%rax
movsd  0x28(%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x38(%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x18(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x8(%rbp),%rax
movsd  0x28(%rax),%xmm0
mov    -0x8(%rbp),%rax
addsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x38(%rax),%xmm0
mov    -0x8(%rbp),%rax
addsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x20(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x18(%rax)
movsd  -0x20(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x18(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x38(%rax)
movsd  -0x18(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x28(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mdct_butterfly_8>:
movupd (%rdi),%xmm0
movupd 0x10(%rdi),%xmm1
movupd 0x20(%rdi),%xmm2
movupd 0x30(%rdi),%xmm3
movapd %xmm2,%xmm4
addpd  %xmm0,%xmm4
movapd %xmm3,%xmm5
addpd  %xmm1,%xmm5
subpd  %xmm0,%xmm2
shufpd $0x1,%xmm2,%xmm2
subpd  %xmm1,%xmm3
movapd %xmm3,%xmm0
subpd  %xmm2,%xmm0
addpd  %xmm2,%xmm3
movapd %xmm3,%xmm1
movsd  %xmm0,%xmm1
movupd %xmm1,0x10(%rdi)
shufpd $0x2,%xmm0,%xmm3
movupd %xmm3,(%rdi)
movapd %xmm4,%xmm0
addpd  %xmm5,%xmm0
movupd %xmm0,0x30(%rdi)
subpd  %xmm4,%xmm5
movupd %xmm5,0x20(%rdi)
ret

LLVM IR (-O0):
define void @mdct_butterfly_8(double* %0) {
%2 = alloca double*
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double* %0, double** %2
%7 = load double*, double** %2
%8 = getelementptr inbounds double, double* %7, i64 6
%9 = load double, double* %8
%10 = load double*, double** %2
%11 = getelementptr inbounds double, double* %10, i64 2
%12 = load double, double* %11
%13 = fadd double %9, %12
store double %13, double* %3
%14 = load double*, double** %2
%15 = getelementptr inbounds double, double* %14, i64 6
%16 = load double, double* %15
%17 = load double*, double** %2
%18 = getelementptr inbounds double, double* %17, i64 2
%19 = load double, double* %18
%20 = fsub double %16, %19
store double %20, double* %4
%21 = load double*, double** %2
%22 = getelementptr inbounds double, double* %21, i64 4
%23 = load double, double* %22
%24 = load double*, double** %2
%25 = getelementptr inbounds double, double* %24, i64 0
%26 = load double, double* %25
%27 = fadd double %23, %26
store double %27, double* %5
%28 = load double*, double** %2
%29 = getelementptr inbounds double, double* %28, i64 4
%30 = load double, double* %29
%31 = load double*, double** %2
%32 = getelementptr inbounds double, double* %31, i64 0
%33 = load double, double* %32
%34 = fsub double %30, %33
store double %34, double* %6
%35 = load double, double* %3
%36 = load double, double* %5
%37 = fadd double %35, %36
%38 = load double*, double** %2
%39 = getelementptr inbounds double, double* %38, i64 6
store double %37, double* %39
%40 = load double, double* %3
%41 = load double, double* %5
%42 = fsub double %40, %41
%43 = load double*, double** %2
%44 = getelementptr inbounds double, double* %43, i64 4
store double %42, double* %44
%45 = load double*, double** %2
%46 = getelementptr inbounds double, double* %45, i64 5
%47 = load double, double* %46
%48 = load double*, double** %2
%49 = getelementptr inbounds double, double* %48, i64 1
%50 = load double, double* %49
%51 = fsub double %47, %50
store double %51, double* %3
%52 = load double*, double** %2
%53 = getelementptr inbounds double, double* %52, i64 7
%54 = load double, double* %53
%55 = load double*, double** %2
%56 = getelementptr inbounds double, double* %55, i64 3
%57 = load double, double* %56
%58 = fsub double %54, %57
store double %58, double* %5
%59 = load double, double* %4
%60 = load double, double* %3
%61 = fadd double %59, %60
%62 = load double*, double** %2
%63 = getelementptr inbounds double, double* %62, i64 0
store double %61, double* %63
%64 = load double, double* %4
%65 = load double, double* %3
%66 = fsub double %64, %65
%67 = load double*, double** %2
%68 = getelementptr inbounds double, double* %67, i64 2
store double %66, double* %68
%69 = load double*, double** %2
%70 = getelementptr inbounds double, double* %69, i64 5
%71 = load double, double* %70
%72 = load double*, double** %2
%73 = getelementptr inbounds double, double* %72, i64 1
%74 = load double, double* %73
%75 = fadd double %71, %74
store double %75, double* %3
%76 = load double*, double** %2
%77 = getelementptr inbounds double, double* %76, i64 7
%78 = load double, double* %77
%79 = load double*, double** %2
%80 = getelementptr inbounds double, double* %79, i64 3
%81 = load double, double* %80
%82 = fadd double %78, %81
store double %82, double* %4
%83 = load double, double* %5
%84 = load double, double* %6
%85 = fadd double %83, %84
%86 = load double*, double** %2
%87 = getelementptr inbounds double, double* %86, i64 3
store double %85, double* %87
%88 = load double, double* %5
%89 = load double, double* %6
%90 = fsub double %88, %89
%91 = load double*, double** %2
%92 = getelementptr inbounds double, double* %91, i64 1
store double %90, double* %92
%93 = load double, double* %4
%94 = load double, double* %3
%95 = fadd double %93, %94
%96 = load double*, double** %2
%97 = getelementptr inbounds double, double* %96, i64 7
store double %95, double* %97
%98 = load double, double* %4
%99 = load double, double* %3
%100 = fsub double %98, %99
%101 = load double*, double** %2
%102 = getelementptr inbounds double, double* %101, i64 5
store double %100, double* %102
ret void
}

LLVM IR (-O2):
define void @mdct_butterfly_8(double* nocapture %0) {
%2 = getelementptr inbounds double, double* %0, i64 6
%3 = getelementptr inbounds double, double* %0, i64 2
%4 = bitcast double* %2 to <2 x double>*
%5 = load <2 x double>, <2 x double>* %4
%6 = bitcast double* %3 to <2 x double>*
%7 = load <2 x double>, <2 x double>* %6
%8 = getelementptr inbounds double, double* %0, i64 4
%9 = bitcast double* %8 to <2 x double>*
%10 = load <2 x double>, <2 x double>* %9
%11 = bitcast double* %0 to <2 x double>*
%12 = load <2 x double>, <2 x double>* %11
%13 = fadd <2 x double> %10, %12
%14 = fadd <2 x double> %5, %7
%15 = fsub <2 x double> %10, %12
%16 = shufflevector <2 x double> %15, <2 x double> poison, <2 x i32> <i32 1, i32 0>
%17 = fsub <2 x double> %5, %7
%18 = fsub <2 x double> %17, %16
%19 = fadd <2 x double> %17, %16
%20 = shufflevector <2 x double> %18, <2 x double> %19, <2 x i32> <i32 0, i32 3>
%21 = bitcast double* %3 to <2 x double>*
store <2 x double> %20, <2 x double>* %21
%22 = shufflevector <2 x double> %19, <2 x double> %18, <2 x i32> <i32 0, i32 3>
%23 = bitcast double* %0 to <2 x double>*
store <2 x double> %22, <2 x double>* %23
%24 = fadd <2 x double> %13, %14
%25 = bitcast double* %2 to <2 x double>*
store <2 x double> %24, <2 x double>* %25
%26 = fsub <2 x double> %14, %13
%27 = bitcast double* %8 to <2 x double>*
store <2 x double> %26, <2 x double>* %27
ret void
}