#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 cos(double);
int sin(double);
int sqrt(int);
void fft(double *real, double *imag, int n, int sign) {
  int i, j, j1, j2;
  int bit;
  int step;
  double temp_r, temp_i, norm;
  double w_r, w_i, ww_r, ww_i;
  for (i = j = 0; i < n; i++) {
    if (i > j) {
      temp_r = real[i];
      real[i] = real[j];
      real[j] = temp_r;
      temp_i = imag[i];
      imag[i] = imag[j];
      imag[j] = temp_i;
    }
    for (bit = n >> 1; j & bit; bit >>= 1)
      j ^= bit;
    j |= bit;
  }
  for (step = 1; step < n; step <<= 1) {
    w_r = cos(3.14159265358979323846 / step);
    w_i = sin(3.14159265358979323846 / step) * sign;
    ww_r = 1;
    ww_i = 0;
    for (i = 0; i < step; i++) {
      for (j1 = i, j2 = i + step; j2 < n; j1 += 2 * step, j2 += 2 * step) {
        temp_r = ww_r * real[j2] - ww_i * imag[j2];
        temp_i = ww_r * imag[j2] + ww_i * real[j2];
        real[j2] = real[j1] - temp_r;
        imag[j2] = imag[j1] - temp_i;
        real[j1] += temp_r;
        imag[j1] += temp_i;
      }
      temp_r = ww_r;
      ww_r = ww_r * w_r - ww_i * w_i;
      ww_i = temp_r * w_i + ww_i * w_r;
    }
  }
  norm = 1. / sqrt(n);
  for (i = 0; i < n; i++) {
    real[i] *= norm;
    imag[i] *= norm;
  }
}


x86 assembly (clang, -O0):
<fft>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    122e <fft+0xfe>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    11e8 <fft+0xb8>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x38(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x40(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x20(%rbp),%eax
and    -0x2c(%rbp),%eax
cmp    $0x0,%eax
je     1217 <fft+0xe7>
mov    -0x2c(%rbp),%eax
xor    -0x20(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x2c(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11f1 <fft+0xc1>
mov    -0x2c(%rbp),%eax
or     -0x20(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1154 <fft+0x24>
movl   $0x1,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1448 <fft+0x318>
cvtsi2sdl -0x30(%rbp),%xmm1
movsd  0xdba(%rip),%xmm0
divsd  %xmm1,%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x50(%rbp)
cvtsi2sdl -0x30(%rbp),%xmm1
movsd  0xd9f(%rip),%xmm0
divsd  %xmm1,%xmm0
call   1030 <sin@plt>
imul   -0x18(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xd79(%rip),%xmm0
movsd  %xmm0,-0x60(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x30(%rbp),%eax
jge    1435 <fft+0x305>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%eax
add    -0x30(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    13c4 <fft+0x294>
movsd  -0x60(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x68(%rbp),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x28(%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,-0x38(%rbp)
movsd  -0x60(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x68(%rbp),%xmm1
mov    -0x8(%rbp),%rax
movslq -0x28(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  -0x38(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  -0x40(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x38(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x40(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%eax
shl    $0x1,%eax
add    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x30(%rbp),%eax
shl    $0x1,%eax
add    -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
jmp    12b6 <fft+0x186>
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  -0x58(%rbp),%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
movsd  -0x58(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm1
mulsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    129b <fft+0x16b>
jmp    143a <fft+0x30a>
mov    -0x30(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1235 <fft+0x105>
mov    -0x14(%rbp),%edi
call   1050 <sqrt@plt>
cvtsi2sd %eax,%xmm1
movsd  0xba4(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    14b4 <fft+0x384>
movsd  -0x48(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x48(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    146c <fft+0x33c>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fft>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %edx,%r12d
test   %edx,%edx
jle    140e <fft+0x2de>
mov    %ecx,%r15d
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %r12d,%ebp
xor    %eax,%eax
xor    %ecx,%ecx
nopl   0x0(%rax)
movslq %ecx,%rdx
cmp    %rdx,%rax
jle    1194 <fft+0x64>
movsd  (%rbx,%rax,8),%xmm0
movsd  (%rbx,%rdx,8),%xmm1
movsd  %xmm1,(%rbx,%rax,8)
movsd  %xmm0,(%rbx,%rdx,8)
movsd  (%r14,%rax,8),%xmm0
movsd  (%r14,%rdx,8),%xmm1
movsd  %xmm1,(%r14,%rax,8)
movsd  %xmm0,(%r14,%rdx,8)
mov    %r12d,%esi
nopw   0x0(%rax,%rax,1)
mov    %ecx,%edx
sar    %esi
xor    %esi,%ecx
test   %esi,%edx
jne    11a0 <fft+0x70>
or     %esi,%edx
add    $0x1,%rax
mov    %edx,%ecx
cmp    %rbp,%rax
jne    1160 <fft+0x30>
cmp    $0x2,%r12d
jl     133f <fft+0x20f>
mov    $0x1,%r13d
xorpd  %xmm0,%xmm0
movhpd 0xe35(%rip),%xmm0
movapd %xmm0,0x10(%rsp)
jmp    11ec <fft+0xbc>
nopl   0x0(%rax,%rax,1)
mov    %r8d,%r13d
cmp    %r12d,%r8d
jge    133f <fft+0x20f>
xorps  %xmm0,%xmm0
cvtsi2sd %r13d,%xmm0
movsd  0xe04(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movapd %xmm1,%xmm0
call   1040 <cos@plt>
movapd %xmm0,0x20(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
movapd 0x20(%rsp),%xmm10
movapd 0xde0(%rip),%xmm9
lea    0x0(%r13,%r13,1),%r8d
test   %r13d,%r13d
jle    11e0 <fft+0xb0>
imul   %r15d,%eax
xorps  %xmm8,%xmm8
cvtsi2sd %eax,%xmm8
movslq %r8d,%rax
mov    %r13d,%r9d
movapd %xmm8,%xmm1
unpcklpd %xmm10,%xmm1
mov    %r13d,%esi
xor    %edx,%edx
movapd 0x10(%rsp),%xmm4
jmp    12a3 <fft+0x173>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movapd %xmm4,%xmm0
xorpd  %xmm9,%xmm0
movapd %xmm10,%xmm3
unpcklpd %xmm0,%xmm3
unpcklpd %xmm8,%xmm4
mulpd  %xmm3,%xmm4
mulpd  %xmm1,%xmm2
addpd  %xmm2,%xmm4
add    $0x1,%rdx
add    $0x1,%esi
cmp    %r9,%rdx
je     11e0 <fft+0xb0>
lea    (%rdx,%r13,1),%ecx
movapd %xmm4,%xmm2
unpckhpd %xmm4,%xmm2
cmp    %r12d,%ecx
jge    1270 <fft+0x140>
movslq %esi,%rcx
movapd %xmm4,%xmm0
xorpd  %xmm9,%xmm0
mov    %rdx,%rdi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsd  (%rbx,%rcx,8),%xmm5
movsd  (%r14,%rcx,8),%xmm6
movapd %xmm6,%xmm7
mulsd  %xmm0,%xmm7
movapd %xmm2,%xmm3
mulsd  %xmm5,%xmm3
addsd  %xmm7,%xmm3
mulsd  %xmm4,%xmm5
mulsd  %xmm2,%xmm6
addsd  %xmm5,%xmm6
movsd  (%rbx,%rdi,8),%xmm5
subsd  %xmm3,%xmm5
movsd  %xmm5,(%rbx,%rcx,8)
movsd  (%r14,%rdi,8),%xmm5
subsd  %xmm6,%xmm5
movsd  %xmm5,(%r14,%rcx,8)
addsd  (%rbx,%rdi,8),%xmm3
movsd  %xmm3,(%rbx,%rdi,8)
addsd  (%r14,%rdi,8),%xmm6
movsd  %xmm6,(%r14,%rdi,8)
add    %rax,%rdi
add    %rax,%rcx
cmp    %rbp,%rcx
jl     12d0 <fft+0x1a0>
jmp    1279 <fft+0x149>
mov    %r12d,%edi
call   1050 <sqrt@plt>
test   %r12d,%r12d
jle    1540 <fft+0x410>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  0xca9(%rip),%xmm0
divsd  %xmm1,%xmm0
cmp    $0x4,%r12d
jb     1383 <fft+0x253>
lea    (%r14,%rbp,8),%rax
cmp    %rbx,%rax
jbe    1424 <fft+0x2f4>
lea    (%rbx,%rbp,8),%rax
cmp    %r14,%rax
jbe    1424 <fft+0x2f4>
xor    %eax,%eax
mov    %rax,%rcx
not    %rcx
test   $0x1,%bpl
je     13b3 <fft+0x283>
movsd  (%rbx,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rbx,%rax,8)
movsd  (%r14,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%r14,%rax,8)
or     $0x1,%rax
add    %rbp,%rcx
je     1540 <fft+0x410>
nopl   0x0(%rax)
movsd  (%rbx,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rbx,%rax,8)
movsd  (%r14,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%r14,%rax,8)
movsd  0x8(%rbx,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rbx,%rax,8)
movsd  0x8(%r14,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%r14,%rax,8)
add    $0x2,%rax
cmp    %rax,%rbp
jne    13c0 <fft+0x290>
jmp    1540 <fft+0x410>
mov    %r12d,%edi
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <sqrt@plt>
mov    %ebp,%eax
and    $0xfffffffc,%eax
movapd %xmm0,%xmm1
unpcklpd %xmm0,%xmm1
lea    -0x4(%rax),%rcx
mov    %rcx,%rdx
shr    $0x2,%rdx
add    $0x1,%rdx
test   %rcx,%rcx
je     154f <fft+0x41f>
mov    %rdx,%rsi
and    $0xfffffffffffffffe,%rsi
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movupd (%rbx,%rcx,8),%xmm2
movupd 0x10(%rbx,%rcx,8),%xmm3
mulpd  %xmm1,%xmm2
mulpd  %xmm1,%xmm3
movupd %xmm2,(%rbx,%rcx,8)
movupd %xmm3,0x10(%rbx,%rcx,8)
movupd (%r14,%rcx,8),%xmm2
movupd 0x10(%r14,%rcx,8),%xmm3
mulpd  %xmm1,%xmm2
mulpd  %xmm1,%xmm3
movupd %xmm2,(%r14,%rcx,8)
movupd %xmm3,0x10(%r14,%rcx,8)
movupd 0x20(%rbx,%rcx,8),%xmm2
movupd 0x30(%rbx,%rcx,8),%xmm3
mulpd  %xmm1,%xmm2
mulpd  %xmm1,%xmm3
movupd %xmm2,0x20(%rbx,%rcx,8)
movupd %xmm3,0x30(%rbx,%rcx,8)
movupd 0x20(%r14,%rcx,8),%xmm2
movupd 0x30(%r14,%rcx,8),%xmm3
mulpd  %xmm1,%xmm2
mulpd  %xmm1,%xmm3
movupd %xmm2,0x20(%r14,%rcx,8)
movupd %xmm3,0x30(%r14,%rcx,8)
add    $0x8,%rcx
add    $0xfffffffffffffffe,%rsi
jne    1460 <fft+0x330>
test   $0x1,%dl
je     1537 <fft+0x407>
movupd (%rbx,%rcx,8),%xmm2
movupd 0x10(%rbx,%rcx,8),%xmm3
mulpd  %xmm1,%xmm2
mulpd  %xmm1,%xmm3
movupd %xmm2,(%rbx,%rcx,8)
movupd %xmm3,0x10(%rbx,%rcx,8)
movupd (%r14,%rcx,8),%xmm2
movupd 0x10(%r14,%rcx,8),%xmm3
mulpd  %xmm1,%xmm2
mulpd  %xmm1,%xmm3
movupd %xmm2,(%r14,%rcx,8)
movupd %xmm3,0x10(%r14,%rcx,8)
cmp    %rbp,%rax
jne    1385 <fft+0x255>
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %ecx,%ecx
test   $0x1,%dl
jne    14f7 <fft+0x3c7>
jmp    1537 <fft+0x407>

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

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