#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*/ btrfly(int, double, double, double, double, double, double,
                          double *, double *, double *, double *);
int /*<<< orphan*/ cft1st(int, double *, double *);
int /*<<< orphan*/ cftmd1(int, int, double *, double *);
int /*<<< orphan*/ cftmd2(int, int, double *, double *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ resetA(double *);
void dfft(int n, int logn, double *a, double *w) {
  int i, l, j;
  double *v, *b, *c, *d;
  printf("w[] =");
  for (i = 0; i < n / 4; i++) {
    printf(" %g", w[i]);
  }
  printf("\n");
  printf("cft1st();\n", n);
  cft1st(n, a, w);
  i = 4;
  l = 8;
  for (; i <= logn / 2; i += 2, l *= 4) {
    printf("cftmd1(n=%d, l=%d, a, w)\n", n, l, a, w);
    cftmd1(n, l, a, w);
  }
  for (; i <= logn - 1; i += 2, l *= 4) {
    printf("i=%d  cftmd2(n=%d, l=%d, a, w)\n", i, n, l, a, w);
    cftmd2(n, l, a, w);
  }
  v = w + 1;
  b = a + l;
  c = a + l + l;
  d = a + l + l + l;
  if ((l << 2) == n) {
    printf("l << 2 == n\n");
#pragma mta use 100 streams
#pragma mta assert no dependence
    for (j = 0; j < l; j += 2) {
      resetA(a);
      btrfly(j, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, a, b, c, d);
    }
  } else {
    printf("l << 2 != n\n");
#pragma mta use 100 streams
#pragma mta assert no dependence
    for (j = 0; j < l; j += 2) {
      double x0r = a[j];
      double x0i = a[j + 1];
      double x1r = b[j];
      double x1i = b[j + 1];
      a[j] = x0r + x1r;
      a[j + 1] = x0i + x1i;
      b[j] = x0r - x1r;
      b[j + 1] = x0i - x1i;
    }
  }
}


x86 assembly (clang, -O0):
<dfft>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x6c(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x6c(%rbp),%eax
cmp    %ecx,%eax
jge    11d2 <dfft+0x72>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xe51(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    118b <dfft+0x2b>
lea    0xe5c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xe28(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1070 <cft1st@plt>
movl   $0x4,-0x1c(%rbp)
movl   $0x8,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x70(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x70(%rbp),%eax
cmp    %ecx,%eax
jg     1273 <dfft+0x113>
mov    -0x4(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xddb(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1080 <cftmd1@plt>
mov    -0x1c(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x20(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0x20(%rbp)
jmp    120f <dfft+0xaf>
jmp    1278 <dfft+0x118>
mov    -0x1c(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     12d2 <dfft+0x172>
mov    -0x1c(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0x20(%rbp),%ecx
mov    -0x10(%rbp),%r8
mov    -0x18(%rbp),%r9
lea    0xd96(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1050 <cftmd2@plt>
mov    -0x1c(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x20(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0x20(%rbp)
jmp    1278 <dfft+0x118>
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x48(%rbp)
mov    -0x20(%rbp),%eax
shl    $0x2,%eax
cmp    -0x4(%rbp),%eax
jne    13b3 <dfft+0x253>
lea    0xd09(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    13ae <dfft+0x24e>
mov    -0x10(%rbp),%rdi
call   1040 <resetA@plt>
mov    -0x24(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x38(%rbp),%rdx
mov    -0x40(%rbp),%rcx
mov    -0x48(%rbp),%r8
movsd  0xc74(%rip),%xmm4
xorps  %xmm5,%xmm5
movaps %xmm4,%xmm0
movaps %xmm5,%xmm1
movaps %xmm4,%xmm2
movaps %xmm5,%xmm3
call   1030 <btrfly@plt>
mov    -0x24(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x24(%rbp)
jmp    135c <dfft+0x1fc>
jmp    149f <dfft+0x33f>
lea    0xcaa(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    149a <dfft+0x33a>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x38(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x38(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x50(%rbp),%xmm0
addsd  -0x60(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x58(%rbp),%xmm0
addsd  -0x68(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x50(%rbp),%xmm0
subsd  -0x60(%rbp),%xmm0
mov    -0x38(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x58(%rbp),%xmm0
subsd  -0x68(%rbp),%xmm0
mov    -0x38(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x24(%rbp)
jmp    13c8 <dfft+0x268>
jmp    149f <dfft+0x33f>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dfft>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r13
mov    %rdx,%r14
mov    %esi,0x4(%rsp)
mov    %edi,%r12d
lea    0xe69(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
cmp    $0x4,%r12d
jl     11da <dfft+0x5a>
mov    %r12d,%ebp
shr    $0x2,%ebp
xor    %ebx,%ebx
lea    0xe53(%rip),%r15
nopl   0x0(%rax,%rax,1)
movsd  0x0(%r13,%rbx,8),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1080 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    11c0 <dfft+0x40>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe61(%rip),%rdi
call   1050 <puts@plt>
mov    %r12d,%edi
mov    %r14,%rsi
mov    %r13,%rdx
call   1090 <cft1st@plt>
mov    0x4(%rsp),%eax
cmp    $0x8,%eax
jge    1213 <dfft+0x93>
mov    $0x4,%ebx
mov    $0x8,%ebp
jmp    1264 <dfft+0xe4>
mov    %eax,%r15d
shr    $0x1f,%r15d
add    %eax,%r15d
sar    %r15d
mov    $0x8,%ebp
mov    $0x4,%ebx
nopw   0x0(%rax,%rax,1)
lea    0xddb(%rip),%rdi
mov    %r12d,%esi
mov    %ebp,%edx
mov    %r14,%rcx
mov    %r13,%r8
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r12d,%edi
mov    %ebp,%esi
mov    %r14,%rdx
mov    %r13,%rcx
call   10a0 <cftmd1@plt>
add    $0x2,%ebx
shl    $0x2,%ebp
cmp    %r15d,%ebx
jle    1230 <dfft+0xb0>
cmp    0x4(%rsp),%ebx
jge    12b3 <dfft+0x133>
lea    0xdbb(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %ebx,%esi
mov    %r12d,%edx
mov    %ebp,%ecx
mov    %r14,%r8
mov    %r13,%r9
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r12d,%edi
mov    %ebp,%esi
mov    %r14,%rdx
mov    %r13,%rcx
call   1070 <cftmd2@plt>
add    $0x2,%ebx
shl    $0x2,%ebp
cmp    0x4(%rsp),%ebx
jl     1280 <dfft+0x100>
mov    %ebp,%r13d
lea    (%r14,%r13,8),%r15
shl    $0x2,%ebp
cmp    %r12d,%ebp
jne    1332 <dfft+0x1b2>
lea    0xd99(%rip),%rdi
call   1050 <puts@plt>
test   %r13,%r13
je     13b1 <dfft+0x231>
lea    (%r15,%r13,8),%rbp
lea    0x0(,%r13,8),%r12
add    %rbp,%r12
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1060 <resetA@plt>
xorpd  %xmm1,%xmm1
xorpd  %xmm3,%xmm3
xorpd  %xmm5,%xmm5
mov    %ebx,%edi
movsd  0xcf2(%rip),%xmm0
movaps %xmm0,%xmm2
movaps %xmm0,%xmm4
mov    %r14,%rsi
mov    %r15,%rdx
mov    %rbp,%rcx
mov    %r12,%r8
call   1040 <btrfly@plt>
add    $0x2,%ebx
cmp    %r13d,%ebx
jb     12f0 <dfft+0x170>
jmp    13b1 <dfft+0x231>
lea    0xd1d(%rip),%rdi
call   1050 <puts@plt>
test   %r13,%r13
je     13b1 <dfft+0x231>
lea    -0x1(%r13),%rdi
cmp    $0x2,%rdi
jae    13c0 <dfft+0x240>
xor    %edx,%edx
lea    (%r14,%r13,8),%rax
add    $0x8,%rax
nopw   0x0(%rax,%rax,1)
movsd  (%r14,%rdx,8),%xmm0
movsd  0x8(%r14,%rdx,8),%xmm1
movsd  -0x8(%rax,%rdx,8),%xmm2
movsd  (%rax,%rdx,8),%xmm3
movapd %xmm0,%xmm4
addsd  %xmm2,%xmm4
movsd  %xmm4,(%r14,%rdx,8)
movapd %xmm1,%xmm4
addsd  %xmm3,%xmm4
movsd  %xmm4,0x8(%r14,%rdx,8)
subsd  %xmm2,%xmm0
movsd  %xmm0,-0x8(%rax,%rdx,8)
subsd  %xmm3,%xmm1
movsd  %xmm1,(%rax,%rdx,8)
add    $0x2,%rdx
cmp    %r13,%rdx
jb     1360 <dfft+0x1e0>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %rdi,%rcx
shr    %rcx
mov    $0x10,%edx
mov    %rcx,%rax
mul    %rdx
seto   %bl
lea    (%r15,%rax,1),%rsi
xor    %edx,%edx
cmp    %r15,%rsi
jb     134f <dfft+0x1cf>
test   %bl,%bl
jne    134f <dfft+0x1cf>
lea    (%r14,%r13,8),%rsi
add    $0x8,%rsi
add    %r15,%rax
add    $0x8,%rax
cmp    %rsi,%rax
jb     134f <dfft+0x1cf>
test   %bl,%bl
jne    134f <dfft+0x1cf>
and    $0xfffffffffffffffe,%rdi
lea    -0x8(,%r13,8),%rdx
ff
or     $0x8,%rdx
add    %r14,%rdx
lea    0x8(%r14),%rbp
lea    (%r14,%rdi,8),%rbx
add    $0x10,%rbx
add    %r13,%rdi
lea    (%r14,%rdi,8),%r11
add    $0x8,%r11
lea    (%r14,%rdi,8),%rdi
add    $0x10,%rdi
cmp    %r14,%rbx
seta   0x4(%rsp)
cmp    %rdx,%rbp
setb   0x3(%rsp)
cmp    %r14,%r11
seta   %al
cmp    %rdx,%r15
setb   0x2(%rsp)
cmp    %r14,%rdi
seta   %r12b
cmp    %rdx,%rsi
setb   0x1(%rsp)
cmp    %r11,%rbp
setb   %r10b
cmp    %rbx,%r15
setb   (%rsp)
cmp    %rdi,%rbp
setb   %r8b
cmp    %rbx,%rsi
setb   %bpl
cmp    %rdi,%r15
setb   %r9b
cmp    %r11,%rsi
setb   %sil
xor    %edx,%edx
mov    0x3(%rsp),%bl
test   %bl,0x4(%rsp)
jne    134f <dfft+0x1cf>
and    0x2(%rsp),%al
jne    134f <dfft+0x1cf>
and    0x1(%rsp),%r12b
jne    134f <dfft+0x1cf>
and    (%rsp),%r10b
jne    134f <dfft+0x1cf>
and    %bpl,%r8b
jne    134f <dfft+0x1cf>
and    %sil,%r9b
jne    134f <dfft+0x1cf>
add    $0x1,%rcx
mov    %rcx,%rax
and    $0xfffffffffffffffe,%rax
lea    (%rax,%rax,1),%rdx
mov    %rax,%rsi
mov    %r14,%rdi
nopw   0x0(%rax,%rax,1)
movupd (%rdi),%xmm0
movupd 0x10(%rdi),%xmm1
movapd %xmm0,%xmm2
unpcklpd %xmm1,%xmm2
unpckhpd %xmm1,%xmm0
movupd (%rdi,%r13,8),%xmm1
movupd 0x10(%rdi,%r13,8),%xmm3
movapd %xmm1,%xmm4
unpcklpd %xmm3,%xmm4
unpckhpd %xmm3,%xmm1
movapd %xmm2,%xmm3
addpd  %xmm4,%xmm3
movapd %xmm0,%xmm5
addpd  %xmm1,%xmm5
movapd %xmm3,%xmm6
unpckhpd %xmm5,%xmm6
unpcklpd %xmm5,%xmm3
movupd %xmm3,(%rdi)
movupd %xmm6,0x10(%rdi)
subpd  %xmm4,%xmm2
subpd  %xmm1,%xmm0
movapd %xmm2,%xmm1
unpcklpd %xmm0,%xmm1
movhlps %xmm2,%xmm0
movups %xmm0,0x10(%rdi,%r13,8)
movupd %xmm1,(%rdi,%r13,8)
add    $0x20,%rdi
add    $0xfffffffffffffffe,%rsi
jne    14f0 <dfft+0x370>
cmp    %rax,%rcx
jne    134f <dfft+0x1cf>
jmp    13b1 <dfft+0x231>

LLVM IR (-O0):
@.str = [6 x i8] c"w[] =\00"
@.str.1 = [4 x i8] c" %g\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [11 x i8] c"cft1st();\0A\00"
@.str.4 = [26 x i8] c"cftmd1(n=%d, l=%d, a, w)\0A\00"
@.str.5 = [32 x i8] c"i=%d cftmd2(n=%d, l=%d, a, w)\0A\00"
@.str.6 = [13 x i8] c"l << 2 == n\0A\00"
@.str.7 = [13 x i8] c"l << 2 != n\0A\00"
define void @dfft(i32 %0, i32 %1, double* %2, double* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca double*
%8 = alloca double*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
%14 = alloca double*
%15 = alloca double*
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
store i32 %0, i32* %5
store i32 %1, i32* %6
store double* %2, double** %7
store double* %3, double** %8
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %9
br label %21
21: ; preds = %33, %4
%22 = load i32, i32* %9
%23 = load i32, i32* %5
%24 = sdiv i32 %23, 4
%25 = icmp slt i32 %22, %24
br i1 %25, label %26, label %36
26: ; preds = %21
%27 = load double*, double** %8
%28 = load i32, i32* %9
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds double, double* %27, i64 %29
%31 = load double, double* %30
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %31)
br label %33
33: ; preds = %26
%34 = load i32, i32* %9
%35 = add nsw i32 %34, 1
store i32 %35, i32* %9
br label %21
36: ; preds = %21
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%38 = load i32, i32* %5
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %38)
%40 = load i32, i32* %5
%41 = load double*, double** %7
%42 = load double*, double** %8
%43 = call i32 @cft1st(i32 %40, double* %41, double* %42)
store i32 4, i32* %9
store i32 8, i32* %10
br label %44
44: ; preds = %60, %36
%45 = load i32, i32* %9
%46 = load i32, i32* %6
%47 = sdiv i32 %46, 2
%48 = icmp sle i32 %45, %47
br i1 %48, label %49, label %65
49: ; preds = %44
%50 = load i32, i32* %5
%51 = load i32, i32* %10
%52 = load double*, double** %7
%53 = load double*, double** %8
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i32 %50, i32 %51, double* %52, double* %53)
%55 = load i32, i32* %5
%56 = load i32, i32* %10
%57 = load double*, double** %7
%58 = load double*, double** %8
%59 = call i32 @cftmd1(i32 %55, i32 %56, double* %57, double* %58)
br label %60
60: ; preds = %49
%61 = load i32, i32* %9
%62 = add nsw i32 %61, 2
store i32 %62, i32* %9
%63 = load i32, i32* %10
%64 = mul nsw i32 %63, 4
store i32 %64, i32* %10
br label %44
65: ; preds = %44
br label %66
66: ; preds = %83, %65
%67 = load i32, i32* %9
%68 = load i32, i32* %6
%69 = sub nsw i32 %68, 1
%70 = icmp sle i32 %67, %69
br i1 %70, label %71, label %88
71: ; preds = %66
%72 = load i32, i32* %9
%73 = load i32, i32* %5
%74 = load i32, i32* %10
%75 = load double*, double** %7
%76 = load double*, double** %8
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0), i32 %72, i32 %73, i32 %74, double* %75, double* %76)
%78 = load i32, i32* %5
%79 = load i32, i32* %10
%80 = load double*, double** %7
%81 = load double*, double** %8
%82 = call i32 @cftmd2(i32 %78, i32 %79, double* %80, double* %81)
br label %83
83: ; preds = %71
%84 = load i32, i32* %9
%85 = add nsw i32 %84, 2
store i32 %85, i32* %9
%86 = load i32, i32* %10
%87 = mul nsw i32 %86, 4
store i32 %87, i32* %10
br label %66
88: ; preds = %66
%89 = load double*, double** %8
%90 = getelementptr inbounds double, double* %89, i64 1
store double* %90, double** %12
%91 = load double*, double** %7
%92 = load i32, i32* %10
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds double, double* %91, i64 %93
store double* %94, double** %13
%95 = load double*, double** %7
%96 = load i32, i32* %10
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds double, double* %95, i64 %97
%99 = load i32, i32* %10
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds double, double* %98, i64 %100
store double* %101, double** %14
%102 = load double*, double** %7
%103 = load i32, i32* %10
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds double, double* %102, i64 %104
%106 = load i32, i32* %10
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds double, double* %105, i64 %107
%109 = load i32, i32* %10
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds double, double* %108, i64 %110
store double* %111, double** %15
%112 = load i32, i32* %10
%113 = shl i32 %112, 2
%114 = load i32, i32* %5
%115 = icmp eq i32 %113, %114
br i1 %115, label %116, label %135
116: ; preds = %88
%117 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %11
br label %118
118: ; preds = %131, %116
%119 = load i32, i32* %11
%120 = load i32, i32* %10
%121 = icmp slt i32 %119, %120
br i1 %121, label %122, label %134
122: ; preds = %118
%123 = load double*, double** %7
%124 = call i32 @resetA(double* %123)
%125 = load i32, i32* %11
%126 = load double*, double** %7
%127 = load double*, double** %13
%128 = load double*, double** %14
%129 = load double*, double** %15
%130 = call i32 @btrfly(i32 %125, double 1.000000e+00, double 0.000000e+00, double 1.000000e+00, double 0.000000e+00, double 1.000000e+00, double 0.000000e+00, double* %126, double* %127, double* %128, double* %129)
br label %131
131: ; preds = %122
%132 = load i32, i32* %11
%133 = add nsw i32 %132, 2
store i32 %133, i32* %11
br label %118
134: ; preds = %118
br label %198
135: ; preds = %88
%136 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
store i32 0, i32* %11
br label %137
137: ; preds = %194, %135
%138 = load i32, i32* %11
%139 = load i32, i32* %10
%140 = icmp slt i32 %138, %139
br i1 %140, label %141, label %197
141: ; preds = %137
%142 = load double*, double** %7
%143 = load i32, i32* %11
%144 = sext i32 %143 to i64
%145 = getelementptr inbounds double, double* %142, i64 %144
%146 = load double, double* %145
store double %146, double* %16
%147 = load double*, double** %7
%148 = load i32, i32* %11
%149 = add nsw i32 %148, 1
%150 = sext i32 %149 to i64
%151 = getelementptr inbounds double, double* %147, i64 %150
%152 = load double, double* %151
store double %152, double* %17
%153 = load double*, double** %13
%154 = load i32, i32* %11
%155 = sext i32 %154 to i64
%156 = getelementptr inbounds double, double* %153, i64 %155
%157 = load double, double* %156
store double %157, double* %18
%158 = load double*, double** %13
%159 = load i32, i32* %11
%160 = add nsw i32 %159, 1
%161 = sext i32 %160 to i64
%162 = getelementptr inbounds double, double* %158, i64 %161
%163 = load double, double* %162
store double %163, double* %19
%164 = load double, double* %16
%165 = load double, double* %18
%166 = fadd double %164, %165
%167 = load double*, double** %7
%168 = load i32, i32* %11
%169 = sext i32 %168 to i64
%170 = getelementptr inbounds double, double* %167, i64 %169
store double %166, double* %170
%171 = load double, double* %17
%172 = load double, double* %19
%173 = fadd double %171, %172
%174 = load double*, double** %7
%175 = load i32, i32* %11
%176 = add nsw i32 %175, 1
%177 = sext i32 %176 to i64
%178 = getelementptr inbounds double, double* %174, i64 %177
store double %173, double* %178
%179 = load double, double* %16
%180 = load double, double* %18
%181 = fsub double %179, %180
%182 = load double*, double** %13
%183 = load i32, i32* %11
%184 = sext i32 %183 to i64
%185 = getelementptr inbounds double, double* %182, i64 %184
store double %181, double* %185
%186 = load double, double* %17
%187 = load double, double* %19
%188 = fsub double %186, %187
%189 = load double*, double** %13
%190 = load i32, i32* %11
%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
br label %194
194: ; preds = %141
%195 = load i32, i32* %11
%196 = add nsw i32 %195, 2
store i32 %196, i32* %11
br label %137
197: ; preds = %137
br label %198
198: ; preds = %197, %134
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"w[] =\00"
@.str.1 = [4 x i8] c" %g\00"
@.str.4 = [26 x i8] c"cftmd1(n=%d, l=%d, a, w)\0A\00"
@.str.5 = [32 x i8] c"i=%d cftmd2(n=%d, l=%d, a, w)\0A\00"
@str = [10 x i8] c"cft1st();\00"
@str.8 = [12 x i8] c"l << 2 != n\00"
@str.9 = [12 x i8] c"l << 2 == n\00"
define void @dfft(i32 %0, i32 %1, double* %2, double* %3) {
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = icmp sgt i32 %0, 3
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = lshr i32 %0, 2
%9 = zext i32 %8 to i64
br label %10
10: ; preds = %7, %10
%11 = phi i64 [ 0, %7 ], [ %15, %10 ]
%12 = getelementptr inbounds double, double* %3, i64 %11
%13 = load double, double* %12
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %13)
%15 = add nuw nsw i64 %11, 1
%16 = icmp eq i64 %15, %9
br i1 %16, label %17, label %10
17: ; preds = %10, %4
%18 = tail call i32 @putchar(i32 10)
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%20 = tail call i32 @cft1st(i32 %0, double* %2, double* %3)
%21 = sdiv i32 %1, 2
%22 = icmp slt i32 %1, 8
br i1 %22, label %23, label %27
23: ; preds = %27, %17
%24 = phi i32 [ 8, %17 ], [ %33, %27 ]
%25 = phi i32 [ 4, %17 ], [ %32, %27 ]
%26 = icmp slt i32 %25, %1
br i1 %26, label %35, label %43
27: ; preds = %17, %27
%28 = phi i32 [ %32, %27 ], [ 4, %17 ]
%29 = phi i32 [ %33, %27 ], [ 8, %17 ]
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i32 %0, i32 %29, double* %2, double* %3)
%31 = tail call i32 @cftmd1(i32 %0, i32 %29, double* %2, double* %3)
%32 = add nuw nsw i32 %28, 2
%33 = shl nsw i32 %29, 2
%34 = icmp sgt i32 %32, %21
br i1 %34, label %23, label %27
35: ; preds = %23, %35
%36 = phi i32 [ %40, %35 ], [ %25, %23 ]
%37 = phi i32 [ %41, %35 ], [ %24, %23 ]
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0), i32 %36, i32 %0, i32 %37, double* %2, double* %3)
%39 = tail call i32 @cftmd2(i32 %0, i32 %37, double* %2, double* %3)
%40 = add nuw nsw i32 %36, 2
%41 = shl nsw i32 %37, 2
%42 = icmp slt i32 %40, %1
br i1 %42, label %35, label %43
43: ; preds = %35, %23
%44 = phi i32 [ %24, %23 ], [ %41, %35 ]
%45 = zext i32 %44 to i64
%46 = getelementptr double, double* %2, i64 %45
%47 = bitcast double* %46 to i8*
%48 = getelementptr inbounds double, double* %46, i64 %45
%49 = getelementptr inbounds double, double* %48, i64 %45
%50 = shl i32 %44, 2
%51 = icmp eq i32 %50, %0
br i1 %51, label %52, label %61
52: ; preds = %43
%53 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.9, i64 0, i64 0))
%54 = icmp eq i32 %44, 0
br i1 %54, label %179, label %55
55: ; preds = %52, %55
%56 = phi i32 [ %59, %55 ], [ 0, %52 ]
%57 = tail call i32 @resetA(double* %2)
%58 = tail call i32 @btrfly(i32 %56, double 1.000000e+00, double 0.000000e+00, double 1.000000e+00, double 0.000000e+00, double 1.000000e+00, double 0.000000e+00, double* %2, double* %46, double* %48, double* %49)
%59 = add nuw nsw i32 %56, 2
%60 = icmp ult i32 %59, %44
br i1 %60, label %55, label %179
61: ; preds = %43
%62 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.8, i64 0, i64 0))
%63 = icmp eq i32 %44, 0
br i1 %63, label %179, label %64
64: ; preds = %61
%65 = add nsw i64 %45, -1
%66 = lshr i64 %65, 1
%67 = add nuw i64 %66, 1
%68 = icmp ult i64 %65, 2
br i1 %68, label %160, label %69
69: ; preds = %64
%70 = add nsw i64 %45, -1
%71 = lshr i64 %70, 1
%72 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %71, i64 16)
%73 = extractvalue { i64, i1 } %72, 0
%74 = extractvalue { i64, i1 } %72, 1
%75 = getelementptr i8, i8* %47, i64 %73
%76 = icmp ult i8* %75, %47
%77 = or i1 %76, %74
%78 = add nuw nsw i64 %45, 1
%79 = getelementptr double, double* %2, i64 %78
%80 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %71, i64 16)
%81 = extractvalue { i64, i1 } %80, 0
%82 = extractvalue { i64, i1 } %80, 1
%83 = bitcast double* %79 to i8*
%84 = getelementptr i8, i8* %83, i64 %81
%85 = icmp ult i8* %84, %83
%86 = or i1 %85, %82
%87 = or i1 %77, %86
br i1 %87, label %160, label %88
88: ; preds = %69
%89 = add nsw i64 %45, -1
%90 = and i64 %89, -2
%91 = or i64 %89, 1
%92 = getelementptr double, double* %2, i64 %91
%93 = getelementptr double, double* %2, i64 1
%94 = add nsw i64 %90, 2
%95 = getelementptr double, double* %2, i64 %94
%96 = add nsw i64 %90, %45
%97 = add nsw i64 %96, 1
%98 = getelementptr double, double* %2, i64 %97
%99 = add nuw nsw i64 %45, 1
%100 = getelementptr double, double* %2, i64 %99
%101 = add nsw i64 %90, %45
%102 = add nsw i64 %101, 2
%103 = getelementptr double, double* %2, i64 %102
%104 = icmp ugt double* %95, %2
%105 = icmp ult double* %93, %92
%106 = and i1 %104, %105
%107 = icmp ugt double* %98, %2
%108 = icmp ult double* %46, %92
%109 = and i1 %107, %108
%110 = or i1 %106, %109
%111 = icmp ugt double* %103, %2
%112 = icmp ult double* %100, %92
%113 = and i1 %111, %112
%114 = or i1 %110, %113
%115 = icmp ult double* %93, %98
%116 = icmp ult double* %46, %95
%117 = and i1 %115, %116
%118 = or i1 %114, %117
%119 = icmp ult double* %93, %103
%120 = icmp ult double* %100, %95
%121 = and i1 %119, %120
%122 = or i1 %118, %121
%123 = icmp ult double* %46, %103
%124 = icmp ult double* %100, %98
%125 = and i1 %123, %124
%126 = or i1 %122, %125
br i1 %126, label %160, label %127
127: ; preds = %88
%128 = and i64 %67, -2
%129 = shl i64 %128, 1
%130 = getelementptr inbounds double, double* %2, i64 -1
%131 = getelementptr inbounds double, double* %46, i64 -1
br label %132
132: ; preds = %132, %127
%133 = phi i64 [ 0, %127 ], [ %156, %132 ]
%134 = shl i64 %133, 1
%135 = getelementptr inbounds double, double* %2, i64 %134
%136 = bitcast double* %135 to <4 x double>*
%137 = load <4 x double>, <4 x double>* %136
%138 = shufflevector <4 x double> %137, <4 x double> poison, <2 x i32> <i32 0, i32 2>
%139 = shufflevector <4 x double> %137, <4 x double> poison, <2 x i32> <i32 1, i32 3>
%140 = or i64 %134, 1
%141 = getelementptr inbounds double, double* %46, i64 %134
%142 = bitcast double* %141 to <4 x double>*
%143 = load <4 x double>, <4 x double>* %142
%144 = shufflevector <4 x double> %143, <4 x double> poison, <2 x i32> <i32 0, i32 2>
%145 = shufflevector <4 x double> %143, <4 x double> poison, <2 x i32> <i32 1, i32 3>
%146 = fadd <2 x double> %138, %144
%147 = fadd <2 x double> %139, %145
%148 = getelementptr inbounds double, double* %130, i64 %140
%149 = bitcast double* %148 to <4 x double>*
%150 = shufflevector <2 x double> %146, <2 x double> %147, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
store <4 x double> %150, <4 x double>* %149
%151 = fsub <2 x double> %138, %144
%152 = fsub <2 x double> %139, %145
%153 = getelementptr inbounds double, double* %131, i64 %140
%154 = bitcast double* %153 to <4 x double>*
%155 = shufflevector <2 x double> %151, <2 x double> %152, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
store <4 x double> %155, <4 x double>* %154
%156 = add nuw i64 %133, 2
%157 = icmp eq i64 %156, %128
br i1 %157, label %158, label %132
158: ; preds = %132
%159 = icmp eq i64 %67, %128
br i1 %159, label %179, label %160
160: ; preds = %88, %69, %64, %158
%161 = phi i64 [ 0, %88 ], [ 0, %69 ], [ 0, %64 ], [ %129, %158 ]
br label %162
162: ; preds = %160, %162
%163 = phi i64 [ %177, %162 ], [ %161, %160 ]
%164 = getelementptr inbounds double, double* %2, i64 %163
%165 = load double, double* %164
%166 = or i64 %163, 1
%167 = getelementptr inbounds double, double* %2, i64 %166
%168 = load double, double* %167
%169 = getelementptr inbounds double, double* %46, i64 %163
%170 = load double, double* %169
%171 = getelementptr inbounds double, double* %46, i64 %166
%172 = load double, double* %171
%173 = fadd double %165, %170
store double %173, double* %164
%174 = fadd double %168, %172
store double %174, double* %167
%175 = fsub double %165, %170
store double %175, double* %169
%176 = fsub double %168, %172
store double %176, double* %171
%177 = add nuw nsw i64 %163, 2
%178 = icmp ult i64 %177, %45
br i1 %178, label %162, label %179
179: ; preds = %162, %55, %158, %61, %52
ret void
}