#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 sin(double);
void fft_1d(double *data, int nn, int isign) {
  int n, mmax, m, j, istep, i;
  double wtemp, wr, wi, wpr, wpi, theta, tempr, tempi;
  data = data - 1;
  n = nn << 1;
  j = 1;
  for (i = 1; i < n; i += 2) {
    if (j > i) {
      tempr = (data[j]);
      (data[j]) = (data[i]);
      (data[i]) = tempr;
      tempr = (data[j + 1]);
      (data[j + 1]) = (data[i + 1]);
      (data[i + 1]) = tempr;
    }
    m = n >> 1;
    while (m >= 2 && j > m) {
      j -= m;
      m = m >> 1;
    }
    j += m;
  }
  mmax = 2;
  while (n > mmax) {
    istep = 2 * mmax;
    theta = (2 * 3.14159265358979323846264338327950288419716939937510) /
            (isign * mmax);
    wtemp = sin(0.5 * theta);
    wpr = -2.0 * wtemp * wtemp;
    wpi = sin(theta);
    wr = 1.0;
    wi = 0.0;
    for (m = 1; m < mmax; m += 2) {
      for (i = m; i <= n; i += istep) {
        j = i + mmax;
        tempr = (double)(wr * data[j] - wi * data[j + 1]);
        tempi = (double)(wr * data[j + 1] + wi * data[j]);
        data[j] = data[i] - tempr;
        data[j + 1] = data[i + 1] - tempi;
        data[i] += tempr;
        data[i + 1] += tempi;
      }
      wtemp = wr;
      wr += wr * wpr - wi * wpi;
      wi += wi * wpr + wtemp * wpi;
    }
    mmax = istep;
  }
  if (isign == 1) {
    n = nn << 1;
    for (i = 1; i <= n; i++)
      data[i] = data[i] / nn;
  }
}


x86 assembly (clang, -O0):
<fft_1d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x14(%rbp)
movl   $0x1,-0x20(%rbp)
movl   $0x1,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1251 <fft_1d+0x141>
mov    -0x20(%rbp),%eax
cmp    -0x28(%rbp),%eax
jle    11ed <fft_1d+0xdd>
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x60(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x28(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x60(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x28(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x1c(%rbp)
xor    %eax,%eax
cmpl   $0x2,-0x1c(%rbp)
mov    %al,-0x69(%rbp)
jl     1211 <fft_1d+0x101>
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
setg   %al
mov    %al,-0x69(%rbp)
mov    -0x69(%rbp),%al
test   $0x1,%al
jne    1221 <fft_1d+0x111>
jmp    123a <fft_1d+0x12a>
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11f6 <fft_1d+0xe6>
mov    -0x1c(%rbp),%eax
add    -0x20(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x28(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x28(%rbp)
jmp    1145 <fft_1d+0x35>
movl   $0x2,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jle    149b <fft_1d+0x38b>
mov    -0x18(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%eax
imul   -0x18(%rbp),%eax
cvtsi2sd %eax,%xmm1
movsd  0xd98(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xd7f(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  0xd60(%rip),%xmm0
mulsd  -0x30(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x58(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  0xd32(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1490 <fft_1d+0x380>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     1415 <fft_1d+0x305>
mov    -0x28(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x20(%rbp)
movsd  -0x38(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x40(%rbp),%xmm1
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%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,-0x60(%rbp)
movsd  -0x38(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x40(%rbp),%xmm1
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  -0x60(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
mov    -0x28(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  -0x68(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x60(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x28(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x68(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x28(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
jmp    12f4 <fft_1d+0x1e4>
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
mulsd  -0x50(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm1
mulsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x1c(%rbp)
jmp    12e2 <fft_1d+0x1d2>
mov    -0x24(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1258 <fft_1d+0x148>
cmpl   $0x1,-0x10(%rbp)
jne    14f7 <fft_1d+0x3e7>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x14(%rbp)
movl   $0x1,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     14f2 <fft_1d+0x3e2>
mov    -0x8(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    14b5 <fft_1d+0x3a5>
jmp    14f7 <fft_1d+0x3e7>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fft_1d>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %edx,%r15d
mov    %rdi,%rbx
mov    %rsi,0x8(%rsp)
lea    (%rsi,%rsi,1),%r12d
cmp    $0x2,%r12d
jl     1336 <fft_1d+0x226>
mov    %r12d,%ebp
mov    $0x1,%ecx
mov    $0x1,%eax
jmp    115d <fft_1d+0x4d>
cs nopw 0x0(%rax,%rax,1)
add    %esi,%edx
add    $0x2,%rax
mov    %edx,%ecx
cmp    %rbp,%rax
jae    11b3 <fft_1d+0xa3>
movslq %ecx,%rdx
cmp    %rdx,%rax
jge    1191 <fft_1d+0x81>
movsd  -0x8(%rbx,%rdx,8),%xmm0
movsd  -0x8(%rbx,%rax,8),%xmm1
movsd  %xmm1,-0x8(%rbx,%rdx,8)
movsd  %xmm0,-0x8(%rbx,%rax,8)
movsd  (%rbx,%rdx,8),%xmm0
movsd  (%rbx,%rax,8),%xmm1
movsd  %xmm1,(%rbx,%rdx,8)
movsd  %xmm0,(%rbx,%rax,8)
mov    %r12d,%edx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %edx,%edi
mov    %ecx,%esi
sar    %edx
cmp    $0x4,%edi
jl     1150 <fft_1d+0x40>
mov    %esi,%ecx
sub    %edx,%ecx
jg     11a0 <fft_1d+0x90>
jmp    1150 <fft_1d+0x40>
cmp    $0x3,%r12d
jl     1336 <fft_1d+0x226>
mov    $0x2,%r13d
xorpd  %xmm0,%xmm0
movhpd 0xe49(%rip),%xmm0
movapd %xmm0,0x20(%rsp)
jmp    11e9 <fft_1d+0xd9>
nopw   0x0(%rax,%rax,1)
cmp    %r13d,%r12d
jle    1336 <fft_1d+0x226>
mov    %r13d,%r14d
lea    (%r14,%r14,1),%r13d
mov    %r14d,%eax
imul   %r15d,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0xdfa(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x18(%rsp)
movapd %xmm1,%xmm0
mulsd  0xdec(%rip),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x18(%rsp),%xmm0
call   1030 <sin@plt>
movapd 0xde5(%rip),%xmm10
cmp    $0x2,%r14d
jl     11e0 <fft_1d+0xd0>
movsd  0x10(%rsp),%xmm1
movapd %xmm1,%xmm8
mulsd  0xdbb(%rip),%xmm8
mulsd  %xmm1,%xmm8
movslq %r13d,%rax
mov    %r14d,%ecx
unpcklpd %xmm8,%xmm8
unpcklpd %xmm0,%xmm0
lea    (%rbx,%rcx,8),%rcx
mov    $0x1,%edx
movapd 0x20(%rsp),%xmm2
jmp    12ac <fft_1d+0x19c>
nopw   0x0(%rax,%rax,1)
movapd %xmm2,%xmm1
shufpd $0x1,%xmm9,%xmm1
mulpd  %xmm0,%xmm1
movapd %xmm2,%xmm3
mulpd  %xmm8,%xmm3
addpd  %xmm1,%xmm3
addpd  %xmm3,%xmm2
add    $0x2,%rdx
cmp    %edx,%r14d
jle    11e0 <fft_1d+0xd0>
movapd %xmm2,%xmm9
xorpd  %xmm10,%xmm9
cmp    %edx,%r12d
jl     1280 <fft_1d+0x170>
movapd %xmm2,%xmm4
unpcklpd %xmm9,%xmm4
movapd %xmm2,%xmm5
unpckhpd %xmm2,%xmm5
mov    %rdx,%rsi
nop
movupd -0x8(%rcx,%rsi,8),%xmm6
movapd %xmm6,%xmm7
mulpd  %xmm4,%xmm7
shufpd $0x1,%xmm7,%xmm7
mulpd  %xmm5,%xmm6
addpd  %xmm7,%xmm6
movsd  -0x8(%rbx,%rsi,8),%xmm7
subsd  %xmm6,%xmm7
movsd  %xmm7,-0x8(%rcx,%rsi,8)
movsd  (%rbx,%rsi,8),%xmm3
movapd %xmm6,%xmm1
unpckhpd %xmm6,%xmm1
movapd %xmm3,%xmm7
subsd  %xmm1,%xmm7
movsd  %xmm7,(%rcx,%rsi,8)
movsd  -0x8(%rbx,%rsi,8),%xmm1
unpcklpd %xmm3,%xmm1
addpd  %xmm6,%xmm1
movupd %xmm1,-0x8(%rbx,%rsi,8)
add    %rax,%rsi
cmp    %rbp,%rsi
jle    12d0 <fft_1d+0x1c0>
jmp    1280 <fft_1d+0x170>
cmp    $0x1,%r15d
jne    13be <fft_1d+0x2ae>
test   %r12d,%r12d
jle    13be <fft_1d+0x2ae>
or     $0x1,%r12d
xorps  %xmm0,%xmm0
cvtsi2sdl 0x8(%rsp),%xmm0
unpcklpd %xmm0,%xmm0
add    $0xfffffffffffffffd,%r12
mov    %r12,%rax
shr    %rax
add    $0x1,%rax
test   %r12,%r12
je     13cd <fft_1d+0x2bd>
mov    %rax,%rdx
and    $0xfffffffffffffffe,%rdx
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movupd -0x8(%rbx,%rcx,8),%xmm1
movupd 0x8(%rbx,%rcx,8),%xmm2
divpd  %xmm0,%xmm1
movupd %xmm1,-0x8(%rbx,%rcx,8)
divpd  %xmm0,%xmm2
movupd %xmm2,0x8(%rbx,%rcx,8)
add    $0x4,%rcx
add    $0xfffffffffffffffe,%rdx
jne    1380 <fft_1d+0x270>
test   $0x1,%al
je     13be <fft_1d+0x2ae>
movupd -0x8(%rbx,%rcx,8),%xmm1
divpd  %xmm0,%xmm1
movupd %xmm1,-0x8(%rbx,%rcx,8)
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x1,%ecx
test   $0x1,%al
jne    13ae <fft_1d+0x29e>
jmp    13be <fft_1d+0x2ae>

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

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