#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 */
double sqrt(double);
int FFT(int dir, int m, double *x, double *y) {
  long nn, i, i1, j, k, i2, l, l1, l2;
  double c1, c2, tx, ty, t1, t2, u1, u2, z;
  nn = 1 << m;
  i2 = nn >> 1;
  j = 0;
  for (i = 0; i < nn - 1; i++) {
    if (i < j) {
      tx = x[i];
      ty = y[i];
      x[i] = x[j];
      y[i] = y[j];
      x[j] = tx;
      y[j] = ty;
    }
    k = i2;
    while (k <= j) {
      j -= k;
      k >>= 1;
    }
    j += k;
  }
  c1 = -1.0;
  c2 = 0.0;
  l2 = 1;
  for (l = 0; l < m; l++) {
    l1 = l2;
    l2 <<= 1;
    u1 = 1.0;
    u2 = 0.0;
    for (j = 0; j < l1; j++) {
      for (i = j; i < nn; i += l2) {
        i1 = i + l1;
        t1 = u1 * x[i1] - u2 * y[i1];
        t2 = u1 * y[i1] + u2 * x[i1];
        x[i1] = x[i] - t1;
        y[i1] = y[i] - t2;
        x[i] += t1;
        y[i] += t2;
      }
      z = u1 * c1 - u2 * c2;
      u2 = u1 * c2 + u2 * c1;
      u1 = z;
    }
    c2 = sqrt((1.0 - c1) / 2.0);
    if (dir == 1)
      c2 = -c2;
    c1 = sqrt((1.0 + c1) / 2.0);
  }
  if (dir == 1) {
    for (i = 0; i < nn; i++) {
      x[i] /= (double)nn;
      y[i] /= (double)nn;
    }
  }
  return (1);
}


x86 assembly (clang, -O0):
<FFT>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
sar    $0x1,%rax
mov    %rax,-0x48(%rbp)
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    $0x1,%rcx
cmp    %rcx,%rax
jge    1247 <FFT+0x137>
mov    -0x28(%rbp),%rax
cmp    -0x38(%rbp),%rax
jge    11f4 <FFT+0xe4>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
mov    -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x78(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x80(%rbp),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x38(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x48(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
cmp    -0x38(%rbp),%rax
jg     122a <FFT+0x11a>
mov    -0x40(%rbp),%rcx
mov    -0x38(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x40(%rbp),%rax
sar    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    11fc <FFT+0xec>
mov    -0x40(%rbp),%rax
add    -0x38(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1155 <FFT+0x45>
movsd  0xdb1(%rip),%xmm0
movsd  %xmm0,-0x68(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
movq   $0x1,-0x60(%rbp)
movq   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%rax
movslq -0x8(%rbp),%rcx
cmp    %rcx,%rax
jge    1506 <FFT+0x3f6>
mov    -0x60(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x60(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x60(%rbp)
movsd  0xd6f(%rip),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movq   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%rax
cmp    -0x58(%rbp),%rax
jge    1484 <FFT+0x374>
mov    -0x38(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
jge    13f8 <FFT+0x2e8>
mov    -0x28(%rbp),%rax
add    -0x58(%rbp),%rax
mov    %rax,-0x30(%rbp)
movsd  -0x98(%rbp),%xmm0
ff
mov    -0x10(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0xa0(%rbp),%xmm1
mov    -0x18(%rbp),%rax
mov    -0x30(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
mov    -0x18(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0xa0(%rbp),%xmm1
ff
mov    -0x10(%rbp),%rax
mov    -0x30(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  -0x88(%rbp),%xmm0
ff
mov    -0x10(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  -0x90(%rbp),%xmm0
ff
mov    -0x18(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x88(%rbp),%xmm0
ff
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x90(%rbp),%xmm0
ff
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x60(%rbp),%rax
add    -0x28(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    12ca <FFT+0x1ba>
movsd  -0x98(%rbp),%xmm0
ff
movsd  -0x68(%rbp),%xmm2
movsd  -0xa0(%rbp),%xmm1
ff
mulsd  -0x70(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movsd  -0x70(%rbp),%xmm2
movsd  -0xa0(%rbp),%xmm1
ff
mulsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    12b4 <FFT+0x1a4>
movsd  0xb7c(%rip),%xmm0
subsd  -0x68(%rbp),%xmm0
movsd  0xb77(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x70(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    14d2 <FFT+0x3c2>
movsd  -0x70(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0xb2e(%rip),%xmm0
addsd  -0x68(%rbp),%xmm0
movsd  0xb29(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x68(%rbp)
mov    -0x50(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x50(%rbp)
jmp    126c <FFT+0x15c>
cmpl   $0x1,-0x4(%rbp)
jne    1574 <FFT+0x464>
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
jge    156f <FFT+0x45f>
cvtsi2sdq -0x20(%rbp),%xmm1
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
cvtsi2sdq -0x20(%rbp),%xmm1
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1518 <FFT+0x408>
jmp    1574 <FFT+0x464>
mov    $0x1,%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FFT>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rcx,%r14
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %rdx,%rbx
mov    %edi,0xc(%rsp)
movslq %eax,%rbp
cmp    $0x2,%ebp
jl     11aa <FFT+0x9a>
lea    -0x1(%rbp),%r8
xor    %eax,%eax
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmp    %rdx,%rax
jge    1181 <FFT+0x71>
movsd  (%rbx,%rax,8),%xmm0
movsd  (%r14,%rax,8),%xmm1
movsd  (%rbx,%rdx,8),%xmm2
movsd  %xmm2,(%rbx,%rax,8)
movsd  (%r14,%rdx,8),%xmm2
movsd  %xmm2,(%r14,%rax,8)
movsd  %xmm0,(%rbx,%rdx,8)
movsd  %xmm1,(%r14,%rdx,8)
mov    %rbp,%rdi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rdx,%rsi
sar    %rdi
sub    %rdi,%rdx
jge    1190 <FFT+0x80>
add    %rdi,%rsi
add    $0x1,%rax
mov    %rsi,%rdx
cmp    %r8,%rax
jne    1150 <FFT+0x40>
mov    %ecx,0x8(%rsp)
test   %ecx,%ecx
jle    13b2 <FFT+0x2a2>
movslq 0x8(%rsp),%r13
movsd  0xe3c(%rip),%xmm12
xorpd  %xmm8,%xmm8
mov    $0x1,%eax
xor    %r15d,%r15d
movsd  0xe2e(%rip),%xmm9
movapd 0xe3d(%rip),%xmm10
movsd  0xe24(%rip),%xmm11
xorpd  %xmm7,%xmm7
jmp    124b <FFT+0x13b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movapd %xmm12,%xmm0
movapd %xmm7,0x10(%rsp)
call   1030 <sqrt@plt>
movapd 0x10(%rsp),%xmm7
movsd  0xdf1(%rip),%xmm11
movapd 0xdf8(%rip),%xmm10
movsd  0xdd7(%rip),%xmm9
xorpd  %xmm8,%xmm8
movapd %xmm0,%xmm12
add    $0x1,%r15
mov    %r12,%rax
cmp    %r13,%r15
je     13b2 <FFT+0x2a2>
lea    (%rax,%rax,1),%r12
test   %rax,%rax
jle    1320 <FFT+0x210>
xorpd  %xmm0,%xmm0
movapd %xmm9,%xmm1
xor    %ecx,%ecx
jmp    129f <FFT+0x18f>
cs nopw 0x0(%rax,%rax,1)
nop
mulsd  %xmm7,%xmm2
movapd %xmm1,%xmm3
mulsd  %xmm12,%xmm3
addsd  %xmm2,%xmm3
mulsd  %xmm12,%xmm0
mulsd  %xmm7,%xmm1
addsd  %xmm1,%xmm0
add    $0x1,%rcx
movapd %xmm3,%xmm1
cmp    %rax,%rcx
je     1320 <FFT+0x210>
movapd %xmm0,%xmm2
xorpd  %xmm10,%xmm2
cmp    %rbp,%rcx
jge    1270 <FFT+0x160>
mov    %rcx,%rdx
lea    (%rdx,%rax,1),%rsi
movsd  (%rbx,%rsi,8),%xmm3
movsd  (%r14,%rsi,8),%xmm4
movapd %xmm4,%xmm5
mulsd  %xmm2,%xmm5
movapd %xmm1,%xmm6
mulsd  %xmm3,%xmm6
addsd  %xmm5,%xmm6
mulsd  %xmm0,%xmm3
mulsd  %xmm1,%xmm4
addsd  %xmm3,%xmm4
movsd  (%rbx,%rdx,8),%xmm3
subsd  %xmm6,%xmm3
movsd  %xmm3,(%rbx,%rsi,8)
movsd  (%r14,%rdx,8),%xmm3
subsd  %xmm4,%xmm3
movsd  %xmm3,(%r14,%rsi,8)
addsd  (%rbx,%rdx,8),%xmm6
movsd  %xmm6,(%rbx,%rdx,8)
addsd  (%r14,%rdx,8),%xmm4
movsd  %xmm4,(%r14,%rdx,8)
add    %r12,%rdx
cmp    %rbp,%rdx
jl     12b0 <FFT+0x1a0>
jmp    1270 <FFT+0x160>
movapd %xmm9,%xmm0
subsd  %xmm12,%xmm0
mulsd  %xmm11,%xmm0
ucomisd %xmm8,%xmm0
jb     1350 <FFT+0x240>
xorps  %xmm7,%xmm7
sqrtsd %xmm0,%xmm7
cmpl   $0x1,0xc(%rsp)
je     138e <FFT+0x27e>
jmp    1393 <FFT+0x283>
cs nopw 0x0(%rax,%rax,1)
movsd  %xmm12,0x10(%rsp)
call   1030 <sqrt@plt>
movsd  0xcab(%rip),%xmm11
movapd 0xcb2(%rip),%xmm10
movsd  0xc91(%rip),%xmm9
movsd  0x10(%rsp),%xmm12
xorpd  %xmm8,%xmm8
movapd %xmm0,%xmm7
cmpl   $0x1,0xc(%rsp)
jne    1393 <FFT+0x283>
xorpd  %xmm10,%xmm7
addsd  %xmm9,%xmm12
mulsd  %xmm11,%xmm12
ucomisd %xmm8,%xmm12
jb     1200 <FFT+0xf0>
sqrtsd %xmm12,%xmm12
jmp    123b <FFT+0x12b>
cmpl   $0x1,0xc(%rsp)
jne    14d1 <FFT+0x3c1>
cmpl   $0x1f,0x8(%rsp)
je     14d1 <FFT+0x3c1>
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
cmp    $0x2,%rbp
mov    $0x1,%eax
cmovge %rbp,%rax
cmp    $0x2,%rax
jb     13f4 <FFT+0x2e4>
lea    (%r14,%rax,8),%rcx
cmp    %rbx,%rcx
jbe    13fb <FFT+0x2eb>
lea    (%rbx,%rax,8),%rcx
cmp    %r14,%rcx
jbe    13fb <FFT+0x2eb>
xor    %ecx,%ecx
jmp    14aa <FFT+0x39a>
movabs $0x7ffffffffffffffe,%rcx
ff ff 7f
and    %rax,%rcx
movapd %xmm0,%xmm1
unpcklpd %xmm0,%xmm1
lea    -0x2(%rcx),%rdx
mov    %rdx,%rsi
shr    %rsi
add    $0x1,%rsi
test   %rdx,%rdx
je     1482 <FFT+0x372>
mov    %rsi,%rdi
and    $0xfffffffffffffffe,%rdi
xor    %edx,%edx
nopl   0x0(%rax)
movupd (%rbx,%rdx,8),%xmm2
divpd  %xmm1,%xmm2
movupd %xmm2,(%rbx,%rdx,8)
movupd (%r14,%rdx,8),%xmm2
divpd  %xmm1,%xmm2
movupd %xmm2,(%r14,%rdx,8)
movupd 0x10(%rbx,%rdx,8),%xmm2
divpd  %xmm1,%xmm2
movupd %xmm2,0x10(%rbx,%rdx,8)
movupd 0x10(%r14,%rdx,8),%xmm2
divpd  %xmm1,%xmm2
movupd %xmm2,0x10(%r14,%rdx,8)
add    $0x4,%rdx
add    $0xfffffffffffffffe,%rdi
jne    1430 <FFT+0x320>
test   $0x1,%sil
jne    148a <FFT+0x37a>
jmp    14cc <FFT+0x3bc>
xor    %edx,%edx
test   $0x1,%sil
je     14cc <FFT+0x3bc>
movupd (%rbx,%rdx,8),%xmm2
divpd  %xmm1,%xmm2
movupd %xmm2,(%rbx,%rdx,8)
movupd (%r14,%rdx,8),%xmm2
divpd  %xmm1,%xmm2
movupd %xmm2,(%r14,%rdx,8)
jmp    14cc <FFT+0x3bc>
movsd  (%rbx,%rcx,8),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rbx,%rcx,8)
movsd  (%r14,%rcx,8),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%r14,%rcx,8)
add    $0x1,%rcx
cmp    %rcx,%rax
jne    14aa <FFT+0x39a>
mov    $0x1,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @FFT(i32 %0, i32 %1, double* %2, double* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca double*
%8 = alloca double*
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
%15 = alloca i64
%16 = alloca i64
%17 = alloca i64
%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
store i32 %0, i32* %5
store i32 %1, i32* %6
store double* %2, double** %7
store double* %3, double** %8
%27 = load i32, i32* %6
%28 = shl i32 1, %27
%29 = sext i32 %28 to i64
store i64 %29, i64* %9
%30 = load i64, i64* %9
%31 = ashr i64 %30, 1
store i64 %31, i64* %14
store i64 0, i64* %12
store i64 0, i64* %10
br label %32
32: ; preds = %88, %4
%33 = load i64, i64* %10
%34 = load i64, i64* %9
%35 = sub nsw i64 %34, 1
%36 = icmp slt i64 %33, %35
br i1 %36, label %37, label %91
37: ; preds = %32
%38 = load i64, i64* %10
%39 = load i64, i64* %12
%40 = icmp slt i64 %38, %39
br i1 %40, label %41, label %72
41: ; preds = %37
%42 = load double*, double** %7
%43 = load i64, i64* %10
%44 = getelementptr inbounds double, double* %42, i64 %43
%45 = load double, double* %44
store double %45, double* %20
%46 = load double*, double** %8
%47 = load i64, i64* %10
%48 = getelementptr inbounds double, double* %46, i64 %47
%49 = load double, double* %48
store double %49, double* %21
%50 = load double*, double** %7
%51 = load i64, i64* %12
%52 = getelementptr inbounds double, double* %50, i64 %51
%53 = load double, double* %52
%54 = load double*, double** %7
%55 = load i64, i64* %10
%56 = getelementptr inbounds double, double* %54, i64 %55
store double %53, double* %56
%57 = load double*, double** %8
%58 = load i64, i64* %12
%59 = getelementptr inbounds double, double* %57, i64 %58
%60 = load double, double* %59
%61 = load double*, double** %8
%62 = load i64, i64* %10
%63 = getelementptr inbounds double, double* %61, i64 %62
store double %60, double* %63
%64 = load double, double* %20
%65 = load double*, double** %7
%66 = load i64, i64* %12
%67 = getelementptr inbounds double, double* %65, i64 %66
store double %64, double* %67
%68 = load double, double* %21
%69 = load double*, double** %8
%70 = load i64, i64* %12
%71 = getelementptr inbounds double, double* %69, i64 %70
store double %68, double* %71
br label %72
72: ; preds = %41, %37
%73 = load i64, i64* %14
store i64 %73, i64* %13
br label %74
74: ; preds = %78, %72
%75 = load i64, i64* %13
%76 = load i64, i64* %12
%77 = icmp sle i64 %75, %76
br i1 %77, label %78, label %84
78: ; preds = %74
%79 = load i64, i64* %13
%80 = load i64, i64* %12
%81 = sub nsw i64 %80, %79
store i64 %81, i64* %12
%82 = load i64, i64* %13
%83 = ashr i64 %82, 1
store i64 %83, i64* %13
br label %74
84: ; preds = %74
%85 = load i64, i64* %13
%86 = load i64, i64* %12
%87 = add nsw i64 %86, %85
store i64 %87, i64* %12
br label %88
88: ; preds = %84
%89 = load i64, i64* %10
%90 = add nsw i64 %89, 1
store i64 %90, i64* %10
br label %32
91: ; preds = %32
store double -1.000000e+00, double* %18
store double 0.000000e+00, double* %19
store i64 1, i64* %17
store i64 0, i64* %15
br label %92
92: ; preds = %207, %91
%93 = load i64, i64* %15
%94 = load i32, i32* %6
%95 = sext i32 %94 to i64
%96 = icmp slt i64 %93, %95
br i1 %96, label %97, label %210
97: ; preds = %92
%98 = load i64, i64* %17
store i64 %98, i64* %16
%99 = load i64, i64* %17
%100 = shl i64 %99, 1
store i64 %100, i64* %17
store double 1.000000e+00, double* %24
store double 0.000000e+00, double* %25
store i64 0, i64* %12
br label %101
101: ; preds = %189, %97
%102 = load i64, i64* %12
%103 = load i64, i64* %16
%104 = icmp slt i64 %102, %103
br i1 %104, label %105, label %192
105: ; preds = %101
%106 = load i64, i64* %12
store i64 %106, i64* %10
br label %107
107: ; preds = %170, %105
%108 = load i64, i64* %10
%109 = load i64, i64* %9
%110 = icmp slt i64 %108, %109
br i1 %110, label %111, label %174
111: ; preds = %107
%112 = load i64, i64* %10
%113 = load i64, i64* %16
%114 = add nsw i64 %112, %113
store i64 %114, i64* %11
%115 = load double, double* %24
%116 = load double*, double** %7
%117 = load i64, i64* %11
%118 = getelementptr inbounds double, double* %116, i64 %117
%119 = load double, double* %118
%120 = load double, double* %25
%121 = load double*, double** %8
%122 = load i64, i64* %11
%123 = getelementptr inbounds double, double* %121, i64 %122
%124 = load double, double* %123
%125 = fmul double %120, %124
%126 = fneg double %125
%127 = call double @llvm.fmuladd.f64(double %115, double %119, double %126)
store double %127, double* %22
%128 = load double, double* %24
%129 = load double*, double** %8
%130 = load i64, i64* %11
%131 = getelementptr inbounds double, double* %129, i64 %130
%132 = load double, double* %131
%133 = load double, double* %25
%134 = load double*, double** %7
%135 = load i64, i64* %11
%136 = getelementptr inbounds double, double* %134, i64 %135
%137 = load double, double* %136
%138 = fmul double %133, %137
%139 = call double @llvm.fmuladd.f64(double %128, double %132, double %138)
store double %139, double* %23
%140 = load double*, double** %7
%141 = load i64, i64* %10
%142 = getelementptr inbounds double, double* %140, i64 %141
%143 = load double, double* %142
%144 = load double, double* %22
%145 = fsub double %143, %144
%146 = load double*, double** %7
%147 = load i64, i64* %11
%148 = getelementptr inbounds double, double* %146, i64 %147
store double %145, double* %148
%149 = load double*, double** %8
%150 = load i64, i64* %10
%151 = getelementptr inbounds double, double* %149, i64 %150
%152 = load double, double* %151
%153 = load double, double* %23
%154 = fsub double %152, %153
%155 = load double*, double** %8
%156 = load i64, i64* %11
%157 = getelementptr inbounds double, double* %155, i64 %156
store double %154, double* %157
%158 = load double, double* %22
%159 = load double*, double** %7
%160 = load i64, i64* %10
%161 = getelementptr inbounds double, double* %159, i64 %160
%162 = load double, double* %161
%163 = fadd double %162, %158
store double %163, double* %161
%164 = load double, double* %23
%165 = load double*, double** %8
%166 = load i64, i64* %10
%167 = getelementptr inbounds double, double* %165, i64 %166
%168 = load double, double* %167
%169 = fadd double %168, %164
store double %169, double* %167
br label %170
170: ; preds = %111
%171 = load i64, i64* %17
%172 = load i64, i64* %10
%173 = add nsw i64 %172, %171
store i64 %173, i64* %10
br label %107
174: ; preds = %107
%175 = load double, double* %24
%176 = load double, double* %18
%177 = load double, double* %25
%178 = load double, double* %19
%179 = fmul double %177, %178
%180 = fneg double %179
%181 = call double @llvm.fmuladd.f64(double %175, double %176, double %180)
store double %181, double* %26
%182 = load double, double* %24
%183 = load double, double* %19
%184 = load double, double* %25
%185 = load double, double* %18
%186 = fmul double %184, %185
%187 = call double @llvm.fmuladd.f64(double %182, double %183, double %186)
store double %187, double* %25
%188 = load double, double* %26
store double %188, double* %24
br label %189
189: ; preds = %174
%190 = load i64, i64* %12
%191 = add nsw i64 %190, 1
store i64 %191, i64* %12
br label %101
192: ; preds = %101
%193 = load double, double* %18
%194 = fsub double 1.000000e+00, %193
%195 = fdiv double %194, 2.000000e+00
%196 = call double @sqrt(double %195)
store double %196, double* %19
%197 = load i32, i32* %5
%198 = icmp eq i32 %197, 1
br i1 %198, label %199, label %202
199: ; preds = %192
%200 = load double, double* %19
%201 = fneg double %200
store double %201, double* %19
br label %202
202: ; preds = %199, %192
%203 = load double, double* %18
%204 = fadd double 1.000000e+00, %203
%205 = fdiv double %204, 2.000000e+00
%206 = call double @sqrt(double %205)
store double %206, double* %18
br label %207
207: ; preds = %202
%208 = load i64, i64* %15
%209 = add nsw i64 %208, 1
store i64 %209, i64* %15
br label %92
210: ; preds = %92
%211 = load i32, i32* %5
%212 = icmp eq i32 %211, 1
br i1 %212, label %213, label %237
213: ; preds = %210
store i64 0, i64* %10
br label %214
214: ; preds = %233, %213
%215 = load i64, i64* %10
%216 = load i64, i64* %9
%217 = icmp slt i64 %215, %216
br i1 %217, label %218, label %236
218: ; preds = %214
%219 = load i64, i64* %9
%220 = sitofp i64 %219 to double
%221 = load double*, double** %7
%222 = load i64, i64* %10
%223 = getelementptr inbounds double, double* %221, i64 %222
%224 = load double, double* %223
%225 = fdiv double %224, %220
store double %225, double* %223
%226 = load i64, i64* %9
%227 = sitofp i64 %226 to double
%228 = load double*, double** %8
%229 = load i64, i64* %10
%230 = getelementptr inbounds double, double* %228, i64 %229
%231 = load double, double* %230
%232 = fdiv double %231, %227
store double %232, double* %230
br label %233
233: ; preds = %218
%234 = load i64, i64* %10
%235 = add nsw i64 %234, 1
store i64 %235, i64* %10
br label %214
236: ; preds = %214
br label %237
237: ; preds = %236, %210
ret i32 1
}

LLVM IR (-O2):
define i32 @FFT(i32 %0, i32 %1, double* nocapture %2, double* nocapture %3) {
%5 = shl nuw i32 1, %1
%6 = sext i32 %5 to i64
%7 = add nsw i64 %6, -1
%8 = icmp sgt i32 %5, 1
br i1 %8, label %14, label %9
9: ; preds = %34, %4
%10 = sext i32 %1 to i64
%11 = icmp sgt i32 %1, 0
br i1 %11, label %12, label %92
12: ; preds = %9
%13 = icmp eq i32 %0, 1
br label %38
14: ; preds = %4, %34
%15 = phi i64 [ %36, %34 ], [ 0, %4 ]
%16 = phi i64 [ %35, %34 ], [ 0, %4 ]
%17 = icmp slt i64 %15, %16
br i1 %17, label %18, label %27
18: ; preds = %14
%19 = getelementptr inbounds double, double* %2, i64 %15
%20 = load double, double* %19
%21 = getelementptr inbounds double, double* %3, i64 %15
%22 = load double, double* %21
%23 = getelementptr inbounds double, double* %2, i64 %16
%24 = load double, double* %23
store double %24, double* %19
%25 = getelementptr inbounds double, double* %3, i64 %16
%26 = load double, double* %25
store double %26, double* %21
store double %20, double* %23
store double %22, double* %25
br label %27
27: ; preds = %18, %14
br label %28
28: ; preds = %27, %28
%29 = phi i64 [ %31, %28 ], [ %6, %27 ]
%30 = phi i64 [ %33, %28 ], [ %16, %27 ]
%31 = ashr i64 %29, 1
%32 = icmp slt i64 %30, %31
%33 = sub nsw i64 %30, %31
br i1 %32, label %34, label %28
34: ; preds = %28
%35 = add nsw i64 %30, %31
%36 = add nuw nsw i64 %15, 1
%37 = icmp eq i64 %36, %7
br i1 %37, label %9, label %14
38: ; preds = %12, %81
%39 = phi i64 [ 0, %12 ], [ %90, %81 ]
%40 = phi i64 [ 1, %12 ], [ %43, %81 ]
%41 = phi double [ 0.000000e+00, %12 ], [ %86, %81 ]
%42 = phi double [ -1.000000e+00, %12 ], [ %89, %81 ]
%43 = shl i64 %40, 1
%44 = icmp sgt i64 %40, 0
br i1 %44, label %45, label %81
45: ; preds = %38, %74
%46 = phi double [ %78, %74 ], [ 0.000000e+00, %38 ]
%47 = phi double [ %76, %74 ], [ 1.000000e+00, %38 ]
%48 = phi i64 [ %79, %74 ], [ 0, %38 ]
%49 = icmp slt i64 %48, %6
%50 = fneg double %46
br i1 %49, label %51, label %74
51: ; preds = %45, %51
%52 = phi i64 [ %72, %51 ], [ %48, %45 ]
%53 = add nsw i64 %52, %40
%54 = getelementptr inbounds double, double* %2, i64 %53
%55 = load double, double* %54
%56 = getelementptr inbounds double, double* %3, i64 %53
%57 = load double, double* %56
%58 = fmul double %57, %50
%59 = tail call double @llvm.fmuladd.f64(double %47, double %55, double %58)
%60 = fmul double %46, %55
%61 = tail call double @llvm.fmuladd.f64(double %47, double %57, double %60)
%62 = getelementptr inbounds double, double* %2, i64 %52
%63 = load double, double* %62
%64 = fsub double %63, %59
store double %64, double* %54
%65 = getelementptr inbounds double, double* %3, i64 %52
%66 = load double, double* %65
%67 = fsub double %66, %61
store double %67, double* %56
%68 = load double, double* %62
%69 = fadd double %59, %68
store double %69, double* %62
%70 = load double, double* %65
%71 = fadd double %61, %70
store double %71, double* %65
%72 = add nsw i64 %52, %43
%73 = icmp slt i64 %72, %6
br i1 %73, label %51, label %74
74: ; preds = %51, %45
%75 = fmul double %41, %50
%76 = tail call double @llvm.fmuladd.f64(double %47, double %42, double %75)
%77 = fmul double %42, %46
%78 = tail call double @llvm.fmuladd.f64(double %47, double %41, double %77)
%79 = add nuw nsw i64 %48, 1
%80 = icmp eq i64 %79, %40
br i1 %80, label %81, label %45
81: ; preds = %74, %38
%82 = fsub double 1.000000e+00, %42
%83 = fmul double %82, 5.000000e-01
%84 = tail call double @sqrt(double %83)
%85 = fneg double %84
%86 = select i1 %13, double %85, double %84
%87 = fadd double %42, 1.000000e+00
%88 = fmul double %87, 5.000000e-01
%89 = tail call double @sqrt(double %88)
%90 = add nuw nsw i64 %39, 1
%91 = icmp eq i64 %90, %10
br i1 %91, label %92, label %38
92: ; preds = %81, %9
%93 = icmp eq i32 %0, 1
%94 = icmp ne i32 %1, 31
%95 = and i1 %93, %94
br i1 %95, label %96, label %172
96: ; preds = %92
%97 = sitofp i32 %5 to double
%98 = call i64 @llvm.smax.i64(i64 %6, i64 1)
%99 = icmp ult i64 %98, 2
br i1 %99, label %160, label %100
100: ; preds = %96
%101 = getelementptr double, double* %2, i64 %98
%102 = getelementptr double, double* %3, i64 %98
%103 = icmp ugt double* %102, %2
%104 = icmp ugt double* %101, %3
%105 = and i1 %103, %104
br i1 %105, label %160, label %106
106: ; preds = %100
%107 = and i64 %98, 9223372036854775806
%108 = insertelement <2 x double> poison, double %97, i64 0
%109 = shufflevector <2 x double> %108, <2 x double> poison, <2 x i32> zeroinitializer
%110 = add nsw i64 %107, -2
%111 = lshr exact i64 %110, 1
%112 = add nuw i64 %111, 1
%113 = and i64 %112, 1
%114 = icmp eq i64 %110, 0
br i1 %114, label %144, label %115
115: ; preds = %106
%116 = and i64 %112, -2
br label %117
117: ; preds = %117, %115
%118 = phi i64 [ 0, %115 ], [ %141, %117 ]
%119 = phi i64 [ 0, %115 ], [ %142, %117 ]
%120 = getelementptr inbounds double, double* %2, i64 %118
%121 = bitcast double* %120 to <2 x double>*
%122 = load <2 x double>, <2 x double>* %121
%123 = fdiv <2 x double> %122, %109
%124 = bitcast double* %120 to <2 x double>*
store <2 x double> %123, <2 x double>* %124
%125 = getelementptr inbounds double, double* %3, i64 %118
%126 = bitcast double* %125 to <2 x double>*
%127 = load <2 x double>, <2 x double>* %126
%128 = fdiv <2 x double> %127, %109
%129 = bitcast double* %125 to <2 x double>*
store <2 x double> %128, <2 x double>* %129
%130 = or i64 %118, 2
%131 = getelementptr inbounds double, double* %2, i64 %130
%132 = bitcast double* %131 to <2 x double>*
%133 = load <2 x double>, <2 x double>* %132
%134 = fdiv <2 x double> %133, %109
%135 = bitcast double* %131 to <2 x double>*
store <2 x double> %134, <2 x double>* %135
%136 = getelementptr inbounds double, double* %3, i64 %130
%137 = bitcast double* %136 to <2 x double>*
%138 = load <2 x double>, <2 x double>* %137
%139 = fdiv <2 x double> %138, %109
%140 = bitcast double* %136 to <2 x double>*
store <2 x double> %139, <2 x double>* %140
%141 = add nuw i64 %118, 4
%142 = add nuw i64 %119, 2
%143 = icmp eq i64 %142, %116
br i1 %143, label %144, label %117
144: ; preds = %117, %106
%145 = phi i64 [ 0, %106 ], [ %141, %117 ]
%146 = icmp eq i64 %113, 0
br i1 %146, label %158, label %147
147: ; preds = %144
%148 = getelementptr inbounds double, double* %2, i64 %145
%149 = bitcast double* %148 to <2 x double>*
%150 = load <2 x double>, <2 x double>* %149
%151 = fdiv <2 x double> %150, %109
%152 = bitcast double* %148 to <2 x double>*
store <2 x double> %151, <2 x double>* %152
%153 = getelementptr inbounds double, double* %3, i64 %145
%154 = bitcast double* %153 to <2 x double>*
%155 = load <2 x double>, <2 x double>* %154
%156 = fdiv <2 x double> %155, %109
%157 = bitcast double* %153 to <2 x double>*
store <2 x double> %156, <2 x double>* %157
br label %158
158: ; preds = %144, %147
%159 = icmp eq i64 %98, %107
br i1 %159, label %172, label %160
160: ; preds = %100, %96, %158
%161 = phi i64 [ 0, %100 ], [ 0, %96 ], [ %107, %158 ]
br label %162
162: ; preds = %160, %162
%163 = phi i64 [ %170, %162 ], [ %161, %160 ]
%164 = getelementptr inbounds double, double* %2, i64 %163
%165 = load double, double* %164
%166 = fdiv double %165, %97
store double %166, double* %164
%167 = getelementptr inbounds double, double* %3, i64 %163
%168 = load double, double* %167
%169 = fdiv double %168, %97
store double %169, double* %167
%170 = add nuw nsw i64 %163, 1
%171 = icmp eq i64 %170, %98
br i1 %171, label %172, label %162
172: ; preds = %162, %158, %92
ret i32 1
}