void cftb040(double *a) {
  double x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i;
  x0r = a[0] + a[4];
  x0i = a[1] + a[5];
  x1r = a[0] - a[4];
  x1i = a[1] - a[5];
  x2r = a[2] + a[6];
  x2i = a[3] + a[7];
  x3r = a[2] - a[6];
  x3i = a[3] - a[7];
  a[0] = x0r + x2r;
  a[1] = x0i + x2i;
  a[4] = x0r - x2r;
  a[5] = x0i - x2i;
  a[2] = x1r + x3i;
  a[3] = x1i - x3r;
  a[6] = x1r - x3i;
  a[7] = x1i + x3r;
}


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

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

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

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