#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, double, double, double, double,
                          double, ...);
void btrfly(int j, double wk1r, double wk1i, double wk2r, double wk2i,
            double wk3r, double wk3i, double *a, double *b, double *c,
            double *d) {
  double x0r = a[j] + b[j];
  double x0i = a[j + 1] + b[j + 1];
  double x1r = a[j] - b[j];
  double x1i = a[j + 1] - b[j + 1];
  double x2r = c[j] + d[j];
  double x2i = c[j + 1] + d[j + 1];
  double x3r = c[j] - d[j];
  double x3i = c[j + 1] - d[j + 1];
  printf("    a={%g,%g}, b={%g,%g}, c={%g,%g}, d={%g,%g}\n", a[j], a[j + 1],
         b[j], b[j + 1], c[j], c[j + 1], d[j], d[j + 1]);
  printf("      wk1=%g + %gi\n"
         "      wk2=%g + %gi\n"
         "      wk3=%g + %gi\n",
         wk1r, wk1i, wk2r, wk2i, wk3r, wk3i);
  a[j] = x0r + x2r;
  a[j + 1] = x0i + x2i;
  x0r -= x2r;
  x0i -= x2i;
  c[j] = wk2r * x0r - wk2i * x0i;
  c[j + 1] = wk2r * x0i + wk2i * x0r;
  x0r = x1r - x3i;
  x0i = x1i + x3r;
  b[j] = wk1r * x0r - wk1i * x0i;
  b[j + 1] = wk1r * x0i + wk1i * x0r;
  x0r = x1r + x3i;
  x0i = x1i - x3r;
  d[j] = wk3r * x0r - wk3i * x0i;
  d[j + 1] = wk3r * x0i + wk3i * x0r;
  printf("    a={%g,%g}, b={%g,%g}, c={%g,%g}, d={%g,%g}\n\n", a[j], a[j + 1],
         b[j], b[j + 1], c[j], c[j + 1], d[j], d[j + 1]);
}


x86 assembly (clang, -O0):
<btrfly>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  %xmm4,-0x30(%rbp)
movsd  %xmm5,-0x38(%rbp)
mov    %rsi,-0x40(%rbp)
mov    %rdx,-0x48(%rbp)
mov    %rcx,-0x50(%rbp)
mov    %r8,-0x58(%rbp)
mov    -0x40(%rbp),%rax
movslq -0x4(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x48(%rbp),%rax
movslq -0x4(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x40(%rbp),%rax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x48(%rbp),%rax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x40(%rbp),%rax
movslq -0x4(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x48(%rbp),%rax
movslq -0x4(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x40(%rbp),%rax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x48(%rbp),%rax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x50(%rbp),%rax
movslq -0x4(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x58(%rbp),%rax
movslq -0x4(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x50(%rbp),%rax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x58(%rbp),%rax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x50(%rbp),%rax
movslq -0x4(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x58(%rbp),%rax
movslq -0x4(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x50(%rbp),%rax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x58(%rbp),%rax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0x40(%rbp),%rax
movslq -0x4(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x40(%rbp),%rax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x48(%rbp),%rax
movslq -0x4(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x48(%rbp),%rax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm3
mov    -0x50(%rbp),%rax
movslq -0x4(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm4
mov    -0x50(%rbp),%rax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm5
mov    -0x58(%rbp),%rax
movslq -0x4(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm6
mov    -0x58(%rbp),%rax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm7
lea    0xd08(%rip),%rdi
mov    $0x8,%al
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm3
movsd  -0x30(%rbp),%xmm4
movsd  -0x38(%rbp),%xmm5
lea    0xd0c(%rip),%rdi
mov    $0x6,%al
call   1030 <printf@plt>
movsd  -0x60(%rbp),%xmm0
addsd  -0x80(%rbp),%xmm0
mov    -0x40(%rbp),%rax
movslq -0x4(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x68(%rbp),%xmm0
addsd  -0x88(%rbp),%xmm0
ff
mov    -0x40(%rbp),%rax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x80(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x88(%rbp),%xmm1
ff
movsd  -0x68(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm1
mulsd  -0x68(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x50(%rbp),%rax
movslq -0x4(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x20(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm1
mulsd  -0x60(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x50(%rbp),%rax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x70(%rbp),%xmm0
subsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x60(%rbp)
movsd  -0x78(%rbp),%xmm0
addsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0x68(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  -0x68(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x48(%rbp),%rax
movslq -0x4(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x10(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  -0x60(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x48(%rbp),%rax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x70(%rbp),%xmm0
addsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x60(%rbp)
movsd  -0x78(%rbp),%xmm0
subsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0x68(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm1
mulsd  -0x68(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x58(%rbp),%rax
movslq -0x4(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x30(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm1
mulsd  -0x60(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x58(%rbp),%rax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%rax
movslq -0x4(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x40(%rbp),%rax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x48(%rbp),%rax
movslq -0x4(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x48(%rbp),%rax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm3
mov    -0x50(%rbp),%rax
movslq -0x4(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm4
mov    -0x50(%rbp),%rax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm5
mov    -0x58(%rbp),%rax
movslq -0x4(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm6
mov    -0x58(%rbp),%rax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm7
lea    0xacb(%rip),%rdi
mov    $0x8,%al
call   1030 <printf@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<btrfly>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xa0,%rsp
mov    %r8,%r15
mov    %rcx,%r14
mov    %rdx,%r12
mov    %rsi,%r13
movaps %xmm5,0x40(%rsp)
movaps %xmm4,0x50(%rsp)
movaps %xmm3,(%rsp)
movaps %xmm2,0x10(%rsp)
movaps %xmm1,0x20(%rsp)
movaps %xmm0,0x30(%rsp)
movslq %edi,%rbx
movupd (%rsi,%rbx,8),%xmm0
movupd (%rdx,%rbx,8),%xmm2
movapd %xmm0,%xmm1
addpd  %xmm2,%xmm1
movapd %xmm1,0x70(%rsp)
movapd %xmm0,%xmm1
subpd  %xmm2,%xmm1
movapd %xmm1,0x90(%rsp)
movupd (%rcx,%rbx,8),%xmm4
movupd (%r8,%rbx,8),%xmm6
movapd %xmm4,%xmm1
addpd  %xmm6,%xmm1
movapd %xmm1,0x60(%rsp)
movapd %xmm4,%xmm1
subpd  %xmm6,%xmm1
shufpd $0x1,%xmm1,%xmm1
movapd %xmm1,0x80(%rsp)
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
movapd %xmm2,%xmm3
unpckhpd %xmm2,%xmm3
movapd %xmm4,%xmm5
unpckhpd %xmm4,%xmm5
movapd %xmm6,%xmm7
unpckhpd %xmm6,%xmm7
lea    0xe45(%rip),%rdi
mov    $0x8,%al
call   1030 <printf@plt>
lea    0xe67(%rip),%rdi
movaps 0x30(%rsp),%xmm0
movaps 0x20(%rsp),%xmm1
movaps 0x10(%rsp),%xmm2
movaps (%rsp),%xmm3
movaps 0x50(%rsp),%xmm4
movaps 0x40(%rsp),%xmm5
mov    $0x6,%al
call   1030 <printf@plt>
movapd 0x70(%rsp),%xmm2
movapd %xmm2,%xmm0
movapd 0x60(%rsp),%xmm1
addpd  %xmm1,%xmm0
movupd %xmm0,0x0(%r13,%rbx,8)
subpd  %xmm1,%xmm2
movapd %xmm2,%xmm1
unpckhpd %xmm2,%xmm1
movapd 0xdd4(%rip),%xmm0
xorpd  %xmm0,%xmm1
unpcklpd %xmm2,%xmm1
movapd %xmm2,%xmm3
movapd (%rsp),%xmm2
unpcklpd %xmm2,%xmm2
mulpd  %xmm1,%xmm2
movapd 0x10(%rsp),%xmm1
unpcklpd %xmm1,%xmm1
mulpd  %xmm3,%xmm1
addpd  %xmm2,%xmm1
movupd %xmm1,(%r14,%rbx,8)
movapd 0x90(%rsp),%xmm2
movapd %xmm2,%xmm1
movapd 0x80(%rsp),%xmm4
subpd  %xmm4,%xmm1
addpd  %xmm2,%xmm4
movapd %xmm4,%xmm2
movsd  %xmm1,%xmm2
movapd %xmm4,%xmm3
movapd %xmm4,%xmm5
unpckhpd %xmm4,%xmm3
xorpd  %xmm0,%xmm3
unpcklpd %xmm1,%xmm3
movapd 0x20(%rsp),%xmm4
unpcklpd %xmm4,%xmm4
mulpd  %xmm3,%xmm4
movapd 0x30(%rsp),%xmm3
unpcklpd %xmm3,%xmm3
mulpd  %xmm2,%xmm3
addpd  %xmm4,%xmm3
movupd %xmm3,(%r12,%rbx,8)
movapd %xmm1,%xmm2
movsd  %xmm5,%xmm2
unpckhpd %xmm1,%xmm1
xorpd  %xmm0,%xmm1
unpcklpd %xmm5,%xmm1
movapd 0x40(%rsp),%xmm0
unpcklpd %xmm0,%xmm0
mulpd  %xmm1,%xmm0
movapd 0x50(%rsp),%xmm6
unpcklpd %xmm6,%xmm6
mulpd  %xmm2,%xmm6
addpd  %xmm0,%xmm6
movupd %xmm6,(%r15,%rbx,8)
movsd  0x0(%r13,%rbx,8),%xmm0
movsd  0x8(%r13,%rbx,8),%xmm1
movsd  (%r12,%rbx,8),%xmm2
movsd  0x8(%r12,%rbx,8),%xmm3
movsd  (%r14,%rbx,8),%xmm4
movsd  0x8(%r14,%rbx,8),%xmm5
movapd %xmm6,%xmm7
unpckhpd %xmm6,%xmm7
lea    0xd4c(%rip),%rdi
mov    $0x8,%al
add    $0xa0,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [48 x i8] c" a={%g,%g}, b={%g,%g}, c={%g,%g}, d={%g,%g}\0A\00"
@.str.1 = [58 x i8] c" wk1=%g + %gi\0A wk2=%g + %gi\0A wk3=%g + %gi\0A\00"
@.str.2 = [49 x i8] c" a={%g,%g}, b={%g,%g}, c={%g,%g}, d={%g,%g}\0A\0A\00"
define void @btrfly(i32 %0, double %1, double %2, double %3, double %4, double %5, double %6, double* %7, double* %8, double* %9, double* %10) {
%12 = alloca i32
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double*
%20 = alloca double*
%21 = alloca double*
%22 = alloca double*
%23 = alloca double
%24 = alloca double
%25 = alloca double
%26 = alloca double
%27 = alloca double
%28 = alloca double
%29 = alloca double
%30 = alloca double
store i32 %0, i32* %12
store double %1, double* %13
store double %2, double* %14
store double %3, double* %15
store double %4, double* %16
store double %5, double* %17
store double %6, double* %18
store double* %7, double** %19
store double* %8, double** %20
store double* %9, double** %21
store double* %10, double** %22
%31 = load double*, double** %19
%32 = load i32, i32* %12
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds double, double* %31, i64 %33
%35 = load double, double* %34
%36 = load double*, double** %20
%37 = load i32, i32* %12
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds double, double* %36, i64 %38
%40 = load double, double* %39
%41 = fadd double %35, %40
store double %41, double* %23
%42 = load double*, double** %19
%43 = load i32, i32* %12
%44 = add nsw i32 %43, 1
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds double, double* %42, i64 %45
%47 = load double, double* %46
%48 = load double*, double** %20
%49 = load i32, i32* %12
%50 = add nsw i32 %49, 1
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds double, double* %48, i64 %51
%53 = load double, double* %52
%54 = fadd double %47, %53
store double %54, double* %24
%55 = load double*, double** %19
%56 = load i32, i32* %12
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds double, double* %55, i64 %57
%59 = load double, double* %58
%60 = load double*, double** %20
%61 = load i32, i32* %12
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds double, double* %60, i64 %62
%64 = load double, double* %63
%65 = fsub double %59, %64
store double %65, double* %25
%66 = load double*, double** %19
%67 = load i32, i32* %12
%68 = add nsw i32 %67, 1
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds double, double* %66, i64 %69
%71 = load double, double* %70
%72 = load double*, double** %20
%73 = load i32, i32* %12
%74 = add nsw i32 %73, 1
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds double, double* %72, i64 %75
%77 = load double, double* %76
%78 = fsub double %71, %77
store double %78, double* %26
%79 = load double*, double** %21
%80 = load i32, i32* %12
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds double, double* %79, i64 %81
%83 = load double, double* %82
%84 = load double*, double** %22
%85 = load i32, i32* %12
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds double, double* %84, i64 %86
%88 = load double, double* %87
%89 = fadd double %83, %88
store double %89, double* %27
%90 = load double*, double** %21
%91 = load i32, i32* %12
%92 = add nsw i32 %91, 1
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds double, double* %90, i64 %93
%95 = load double, double* %94
%96 = load double*, double** %22
%97 = load i32, i32* %12
%98 = add nsw i32 %97, 1
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds double, double* %96, i64 %99
%101 = load double, double* %100
%102 = fadd double %95, %101
store double %102, double* %28
%103 = load double*, double** %21
%104 = load i32, i32* %12
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds double, double* %103, i64 %105
%107 = load double, double* %106
%108 = load double*, double** %22
%109 = load i32, i32* %12
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds double, double* %108, i64 %110
%112 = load double, double* %111
%113 = fsub double %107, %112
store double %113, double* %29
%114 = load double*, double** %21
%115 = load i32, i32* %12
%116 = add nsw i32 %115, 1
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds double, double* %114, i64 %117
%119 = load double, double* %118
%120 = load double*, double** %22
%121 = load i32, i32* %12
%122 = add nsw i32 %121, 1
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds double, double* %120, i64 %123
%125 = load double, double* %124
%126 = fsub double %119, %125
store double %126, double* %30
%127 = load double*, double** %19
%128 = load i32, i32* %12
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds double, double* %127, i64 %129
%131 = load double, double* %130
%132 = load double*, double** %19
%133 = load i32, i32* %12
%134 = add nsw i32 %133, 1
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds double, double* %132, i64 %135
%137 = load double, double* %136
%138 = load double*, double** %20
%139 = load i32, i32* %12
%140 = sext i32 %139 to i64
%141 = getelementptr inbounds double, double* %138, i64 %140
%142 = load double, double* %141
%143 = load double*, double** %20
%144 = load i32, i32* %12
%145 = add nsw i32 %144, 1
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds double, double* %143, i64 %146
%148 = load double, double* %147
%149 = load double*, double** %21
%150 = load i32, i32* %12
%151 = sext i32 %150 to i64
%152 = getelementptr inbounds double, double* %149, i64 %151
%153 = load double, double* %152
%154 = load double*, double** %21
%155 = load i32, i32* %12
%156 = add nsw i32 %155, 1
%157 = sext i32 %156 to i64
%158 = getelementptr inbounds double, double* %154, i64 %157
%159 = load double, double* %158
%160 = load double*, double** %22
%161 = load i32, i32* %12
%162 = sext i32 %161 to i64
%163 = getelementptr inbounds double, double* %160, i64 %162
%164 = load double, double* %163
%165 = load double*, double** %22
%166 = load i32, i32* %12
%167 = add nsw i32 %166, 1
%168 = sext i32 %167 to i64
%169 = getelementptr inbounds double, double* %165, i64 %168
%170 = load double, double* %169
%171 = call i32 (i8*, double, double, double, double, double, double, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), double %131, double %137, double %142, double %148, double %153, double %159, double %164, double %170)
%172 = load double, double* %13
%173 = load double, double* %14
%174 = load double, double* %15
%175 = load double, double* %16
%176 = load double, double* %17
%177 = load double, double* %18
%178 = call i32 (i8*, double, double, double, double, double, double, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0), double %172, double %173, double %174, double %175, double %176, double %177)
%179 = load double, double* %23
%180 = load double, double* %27
%181 = fadd double %179, %180
%182 = load double*, double** %19
%183 = load i32, i32* %12
%184 = sext i32 %183 to i64
%185 = getelementptr inbounds double, double* %182, i64 %184
store double %181, double* %185
%186 = load double, double* %24
%187 = load double, double* %28
%188 = fadd double %186, %187
%189 = load double*, double** %19
%190 = load i32, i32* %12
%191 = add nsw i32 %190, 1
%192 = sext i32 %191 to i64
%193 = getelementptr inbounds double, double* %189, i64 %192
store double %188, double* %193
%194 = load double, double* %27
%195 = load double, double* %23
%196 = fsub double %195, %194
store double %196, double* %23
%197 = load double, double* %28
%198 = load double, double* %24
%199 = fsub double %198, %197
store double %199, double* %24
%200 = load double, double* %15
%201 = load double, double* %23
%202 = load double, double* %16
%203 = load double, double* %24
%204 = fmul double %202, %203
%205 = fneg double %204
%206 = call double @llvm.fmuladd.f64(double %200, double %201, double %205)
%207 = load double*, double** %21
%208 = load i32, i32* %12
%209 = sext i32 %208 to i64
%210 = getelementptr inbounds double, double* %207, i64 %209
store double %206, double* %210
%211 = load double, double* %15
%212 = load double, double* %24
%213 = load double, double* %16
%214 = load double, double* %23
%215 = fmul double %213, %214
%216 = call double @llvm.fmuladd.f64(double %211, double %212, double %215)
%217 = load double*, double** %21
%218 = load i32, i32* %12
%219 = add nsw i32 %218, 1
%220 = sext i32 %219 to i64
%221 = getelementptr inbounds double, double* %217, i64 %220
store double %216, double* %221
%222 = load double, double* %25
%223 = load double, double* %30
%224 = fsub double %222, %223
store double %224, double* %23
%225 = load double, double* %26
%226 = load double, double* %29
%227 = fadd double %225, %226
store double %227, double* %24
%228 = load double, double* %13
%229 = load double, double* %23
%230 = load double, double* %14
%231 = load double, double* %24
%232 = fmul double %230, %231
%233 = fneg double %232
%234 = call double @llvm.fmuladd.f64(double %228, double %229, double %233)
%235 = load double*, double** %20
%236 = load i32, i32* %12
%237 = sext i32 %236 to i64
%238 = getelementptr inbounds double, double* %235, i64 %237
store double %234, double* %238
%239 = load double, double* %13
%240 = load double, double* %24
%241 = load double, double* %14
%242 = load double, double* %23
%243 = fmul double %241, %242
%244 = call double @llvm.fmuladd.f64(double %239, double %240, double %243)
%245 = load double*, double** %20
%246 = load i32, i32* %12
%247 = add nsw i32 %246, 1
%248 = sext i32 %247 to i64
%249 = getelementptr inbounds double, double* %245, i64 %248
store double %244, double* %249
%250 = load double, double* %25
%251 = load double, double* %30
%252 = fadd double %250, %251
store double %252, double* %23
%253 = load double, double* %26
%254 = load double, double* %29
%255 = fsub double %253, %254
store double %255, double* %24
%256 = load double, double* %17
%257 = load double, double* %23
%258 = load double, double* %18
%259 = load double, double* %24
%260 = fmul double %258, %259
%261 = fneg double %260
%262 = call double @llvm.fmuladd.f64(double %256, double %257, double %261)
%263 = load double*, double** %22
%264 = load i32, i32* %12
%265 = sext i32 %264 to i64
%266 = getelementptr inbounds double, double* %263, i64 %265
store double %262, double* %266
%267 = load double, double* %17
%268 = load double, double* %24
%269 = load double, double* %18
%270 = load double, double* %23
%271 = fmul double %269, %270
%272 = call double @llvm.fmuladd.f64(double %267, double %268, double %271)
%273 = load double*, double** %22
%274 = load i32, i32* %12
%275 = add nsw i32 %274, 1
%276 = sext i32 %275 to i64
%277 = getelementptr inbounds double, double* %273, i64 %276
store double %272, double* %277
%278 = load double*, double** %19
%279 = load i32, i32* %12
%280 = sext i32 %279 to i64
%281 = getelementptr inbounds double, double* %278, i64 %280
%282 = load double, double* %281
%283 = load double*, double** %19
%284 = load i32, i32* %12
%285 = add nsw i32 %284, 1
%286 = sext i32 %285 to i64
%287 = getelementptr inbounds double, double* %283, i64 %286
%288 = load double, double* %287
%289 = load double*, double** %20
%290 = load i32, i32* %12
%291 = sext i32 %290 to i64
%292 = getelementptr inbounds double, double* %289, i64 %291
%293 = load double, double* %292
%294 = load double*, double** %20
%295 = load i32, i32* %12
%296 = add nsw i32 %295, 1
%297 = sext i32 %296 to i64
%298 = getelementptr inbounds double, double* %294, i64 %297
%299 = load double, double* %298
%300 = load double*, double** %21
%301 = load i32, i32* %12
%302 = sext i32 %301 to i64
%303 = getelementptr inbounds double, double* %300, i64 %302
%304 = load double, double* %303
%305 = load double*, double** %21
%306 = load i32, i32* %12
%307 = add nsw i32 %306, 1
%308 = sext i32 %307 to i64
%309 = getelementptr inbounds double, double* %305, i64 %308
%310 = load double, double* %309
%311 = load double*, double** %22
%312 = load i32, i32* %12
%313 = sext i32 %312 to i64
%314 = getelementptr inbounds double, double* %311, i64 %313
%315 = load double, double* %314
%316 = load double*, double** %22
%317 = load i32, i32* %12
%318 = add nsw i32 %317, 1
%319 = sext i32 %318 to i64
%320 = getelementptr inbounds double, double* %316, i64 %319
%321 = load double, double* %320
%322 = call i32 (i8*, double, double, double, double, double, double, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0), double %282, double %288, double %293, double %299, double %304, double %310, double %315, double %321)
ret void
}

LLVM IR (-O2):
@.str = [48 x i8] c" a={%g,%g}, b={%g,%g}, c={%g,%g}, d={%g,%g}\0A\00"
@.str.1 = [58 x i8] c" wk1=%g + %gi\0A wk2=%g + %gi\0A wk3=%g + %gi\0A\00"
@.str.2 = [49 x i8] c" a={%g,%g}, b={%g,%g}, c={%g,%g}, d={%g,%g}\0A\0A\00"
define void @btrfly(i32 %0, double %1, double %2, double %3, double %4, double %5, double %6, double* nocapture %7, double* nocapture %8, double* nocapture %9, double* nocapture %10) {
%12 = sext i32 %0 to i64
%13 = getelementptr inbounds double, double* %7, i64 %12
%14 = getelementptr inbounds double, double* %8, i64 %12
%15 = add nsw i32 %0, 1
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds double, double* %7, i64 %16
%18 = bitcast double* %13 to <2 x double>*
%19 = load <2 x double>, <2 x double>* %18
%20 = getelementptr inbounds double, double* %8, i64 %16
%21 = bitcast double* %14 to <2 x double>*
%22 = load <2 x double>, <2 x double>* %21
%23 = fadd <2 x double> %19, %22
%24 = fsub <2 x double> %19, %22
%25 = getelementptr inbounds double, double* %9, i64 %12
%26 = getelementptr inbounds double, double* %10, i64 %12
%27 = getelementptr inbounds double, double* %9, i64 %16
%28 = bitcast double* %25 to <2 x double>*
%29 = load <2 x double>, <2 x double>* %28
%30 = bitcast double* %26 to <2 x double>*
%31 = load <2 x double>, <2 x double>* %30
%32 = fadd <2 x double> %29, %31
%33 = fsub <2 x double> %29, %31
%34 = shufflevector <2 x double> %33, <2 x double> poison, <2 x i32> <i32 1, i32 0>
%35 = extractelement <2 x double> %19, i64 0
%36 = extractelement <2 x double> %19, i64 1
%37 = extractelement <2 x double> %22, i64 0
%38 = extractelement <2 x double> %22, i64 1
%39 = extractelement <2 x double> %29, i64 0
%40 = extractelement <2 x double> %29, i64 1
%41 = extractelement <2 x double> %31, i64 0
%42 = extractelement <2 x double> %31, i64 1
%43 = tail call i32 (i8*, double, double, double, double, double, double, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), double %35, double %36, double %37, double %38, double %39, double %40, double %41, double %42)
%44 = tail call i32 (i8*, double, double, double, double, double, double, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0), double %1, double %2, double %3, double %4, double %5, double %6)
%45 = fadd <2 x double> %23, %32
%46 = bitcast double* %13 to <2 x double>*
store <2 x double> %45, <2 x double>* %46
%47 = fsub <2 x double> %23, %32
%48 = extractelement <2 x double> %47, i64 1
%49 = fneg double %48
%50 = insertelement <2 x double> poison, double %49, i64 0
%51 = shufflevector <2 x double> %50, <2 x double> %47, <2 x i32> <i32 0, i32 2>
%52 = insertelement <2 x double> poison, double %4, i64 0
%53 = shufflevector <2 x double> %52, <2 x double> poison, <2 x i32> zeroinitializer
%54 = fmul <2 x double> %51, %53
%55 = insertelement <2 x double> poison, double %3, i64 0
%56 = shufflevector <2 x double> %55, <2 x double> poison, <2 x i32> zeroinitializer
%57 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %56, <2 x double> %47, <2 x double> %54)
%58 = bitcast double* %25 to <2 x double>*
store <2 x double> %57, <2 x double>* %58
%59 = fsub <2 x double> %24, %34
%60 = fadd <2 x double> %24, %34
%61 = shufflevector <2 x double> %59, <2 x double> %60, <2 x i32> <i32 0, i32 3>
%62 = extractelement <2 x double> %60, i64 1
%63 = fneg double %62
%64 = insertelement <2 x double> poison, double %63, i64 0
%65 = shufflevector <2 x double> %64, <2 x double> %59, <2 x i32> <i32 0, i32 2>
%66 = insertelement <2 x double> poison, double %2, i64 0
%67 = shufflevector <2 x double> %66, <2 x double> poison, <2 x i32> zeroinitializer
%68 = fmul <2 x double> %65, %67
%69 = insertelement <2 x double> poison, double %1, i64 0
%70 = shufflevector <2 x double> %69, <2 x double> poison, <2 x i32> zeroinitializer
%71 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %70, <2 x double> %61, <2 x double> %68)
%72 = bitcast double* %14 to <2 x double>*
store <2 x double> %71, <2 x double>* %72
%73 = shufflevector <2 x double> %60, <2 x double> %59, <2 x i32> <i32 0, i32 3>
%74 = extractelement <2 x double> %59, i64 1
%75 = fneg double %74
%76 = insertelement <2 x double> poison, double %75, i64 0
%77 = shufflevector <2 x double> %76, <2 x double> %60, <2 x i32> <i32 0, i32 2>
%78 = insertelement <2 x double> poison, double %6, i64 0
%79 = shufflevector <2 x double> %78, <2 x double> poison, <2 x i32> zeroinitializer
%80 = fmul <2 x double> %77, %79
%81 = insertelement <2 x double> poison, double %5, i64 0
%82 = shufflevector <2 x double> %81, <2 x double> poison, <2 x i32> zeroinitializer
%83 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %82, <2 x double> %73, <2 x double> %80)
%84 = bitcast double* %26 to <2 x double>*
store <2 x double> %83, <2 x double>* %84
%85 = load double, double* %13
%86 = load double, double* %17
%87 = load double, double* %14
%88 = load double, double* %20
%89 = load double, double* %25
%90 = load double, double* %27
%91 = extractelement <2 x double> %83, i64 0
%92 = extractelement <2 x double> %83, i64 1
%93 = tail call i32 (i8*, double, double, double, double, double, double, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0), double %85, double %86, double %87, double %88, double %89, double %90, double %91, double %92)
ret void
}