#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*/ fft(double *, double *, double *, double *, int *);
int /*<<< orphan*/ init(double *, double *, int *);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  double data64A[] = {774, 784, 780, 776, 787, 774, 786, 777, 779, 786, 774,
                      788, 775, 781, 783, 775, 788, 775, 784, 781, 776, 788,
                      773, 787, 779, 779, 786, 773, 787, 777, 782, 784, 774,
                      788, 775, 784, 782, 776, 788, 774, 786, 779, 778, 787,
                      774, 788, 777, 780, 785, 775, 788, 775, 783, 782, 776,
                      788, 774, 786, 780, 778, 787, 774, 787, 777};
  double data64B[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
  double tfstoreA[64 / 2];
  double tfstoreB[64 / 2];
  int brLookup[64];
  int loop = 0;
  float a = 2.0;
  double num = 0;
  init(tfstoreA, tfstoreB, brLookup);
  fft(data64A, data64B, tfstoreA, tfstoreB, brLookup);
  printf("\n");
  for (loop = 0; loop < 64; loop++) {
    printf("%d\t%f + i%f\n", loop, data64A[loop], data64B[loop]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x720,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x210(%rbp),%rdi
lea    0xea0(%rip),%rsi
mov    $0x200,%edx
call   1050 <memcpy@plt>
lea    -0x410(%rbp),%rdi
xor    %esi,%esi
mov    $0x200,%edx
call   1040 <memset@plt>
movl   $0x0,-0x714(%rbp)
movss  0xe61(%rip),%xmm0
movss  %xmm0,-0x718(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x720(%rbp)
ff
lea    -0x510(%rbp),%rdi
lea    -0x610(%rbp),%rsi
lea    -0x710(%rbp),%rdx
call   1060 <init@plt>
lea    -0x210(%rbp),%rdi
lea    -0x410(%rbp),%rsi
lea    -0x510(%rbp),%rdx
lea    -0x610(%rbp),%rcx
lea    -0x710(%rbp),%r8
call   1070 <fft@plt>
lea    0x1020(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x714(%rbp)
cmpl   $0x40,-0x714(%rbp)
jge    1261 <main+0x111>
mov    -0x714(%rbp),%esi
movslq -0x714(%rbp),%rax
movsd  -0x210(%rbp,%rax,8),%xmm0
ff ff
movslq -0x714(%rbp),%rax
movsd  -0x410(%rbp,%rax,8),%xmm1
ff ff
lea    0xfca(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
mov    -0x714(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x714(%rbp)
jmp    120c <main+0xbc>
xor    %eax,%eax
add    $0x720,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x708,%rsp
lea    0xe88(%rip),%rsi
lea    0x500(%rsp),%r14
mov    $0x200,%edx
mov    %r14,%rdi
call   1060 <memcpy@plt>
lea    0x300(%rsp),%r15
xor    %ebx,%ebx
mov    $0x200,%edx
mov    %r15,%rdi
xor    %esi,%esi
call   1050 <memset@plt>
lea    0x200(%rsp),%r12
lea    0x100(%rsp),%r13
mov    %rsp,%rbp
mov    %r12,%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
call   1070 <init@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r13,%rcx
mov    %rbp,%r8
call   1080 <fft@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1014(%rip),%r14
nopl   0x0(%rax)
movsd  0x500(%rsp,%rbx,8),%xmm0
movsd  0x300(%rsp,%rbx,8),%xmm1
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x2,%al
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    $0x40,%rbx
jne    11f0 <main+0x90>
xor    %eax,%eax
add    $0x708,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.data64A = [64 x double] [double 7.740000e+02, double 7.840000e+02, double 7.800000e+02, double 7.760000e+02, double 7.870000e+02, double 7.740000e+02, double 7.860000e+02, double 7.770000e+02, double 7.790000e+02, double 7.860000e+02, double 7.740000e+02, double 7.880000e+02, double 7.750000e+02, double 7.810000e+02, double 7.830000e+02, double 7.750000e+02, double 7.880000e+02, double 7.750000e+02, double 7.840000e+02, double 7.810000e+02, double 7.760000e+02, double 7.880000e+02, double 7.730000e+02, double 7.870000e+02, double 7.790000e+02, double 7.790000e+02, double 7.860000e+02, double 7.730000e+02, double 7.870000e+02, double 7.770000e+02, double 7.820000e+02, double 7.840000e+02, double 7.740000e+02, double 7.880000e+02, double 7.750000e+02, double 7.840000e+02, double 7.820000e+02, double 7.760000e+02, double 7.880000e+02, double 7.740000e+02, double 7.860000e+02, double 7.790000e+02, double 7.780000e+02, double 7.870000e+02, double 7.740000e+02, double 7.880000e+02, double 7.770000e+02, double 7.800000e+02, double 7.850000e+02, double 7.750000e+02, double 7.880000e+02, double 7.750000e+02, double 7.830000e+02, double 7.820000e+02, double 7.760000e+02, double 7.880000e+02, double 7.740000e+02, double 7.860000e+02, double 7.800000e+02, double 7.780000e+02, double 7.870000e+02, double 7.740000e+02, double 7.870000e+02, double 7.770000e+02]
@.str = [2 x i8] c"\0A\00"
@.str.1 = [13 x i8] c"%d\09%f + i%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [64 x double]
%3 = alloca [64 x double]
%4 = alloca [32 x double]
%5 = alloca [32 x double]
%6 = alloca [64 x i32]
%7 = alloca i32
%8 = alloca float
%9 = alloca double
store i32 0, i32* %1
%10 = bitcast [64 x double]* %2 to i8*
%11 = bitcast [64 x double]* %3 to i8*
store i32 0, i32* %7
store float 2.000000e+00, float* %8
store double 0.000000e+00, double* %9
%12 = getelementptr inbounds [32 x double], [32 x double]* %4, i64 0, i64 0
%13 = getelementptr inbounds [32 x double], [32 x double]* %5, i64 0, i64 0
%14 = getelementptr inbounds [64 x i32], [64 x i32]* %6, i64 0, i64 0
%15 = call i32 @init(double* %12, double* %13, i32* %14)
%16 = getelementptr inbounds [64 x double], [64 x double]* %2, i64 0, i64 0
%17 = getelementptr inbounds [64 x double], [64 x double]* %3, i64 0, i64 0
%18 = getelementptr inbounds [32 x double], [32 x double]* %4, i64 0, i64 0
%19 = getelementptr inbounds [32 x double], [32 x double]* %5, i64 0, i64 0
%20 = getelementptr inbounds [64 x i32], [64 x i32]* %6, i64 0, i64 0
%21 = call i32 @fft(double* %16, double* %17, double* %18, double* %19, i32* %20)
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %7
br label %23
23: ; preds = %37, %0
%24 = load i32, i32* %7
%25 = icmp slt i32 %24, 64
br i1 %25, label %26, label %40
26: ; preds = %23
%27 = load i32, i32* %7
%28 = load i32, i32* %7
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [64 x double], [64 x double]* %2, i64 0, i64 %29
%31 = load double, double* %30
%32 = load i32, i32* %7
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [64 x double], [64 x double]* %3, i64 0, i64 %33
%35 = load double, double* %34
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %27, double %31, double %35)
br label %37
37: ; preds = %26
%38 = load i32, i32* %7
%39 = add nsw i32 %38, 1
store i32 %39, i32* %7
br label %23
40: ; preds = %23
ret i32 0
}

LLVM IR (-O2):
@__const.main.data64A = [64 x double] [double 7.740000e+02, double 7.840000e+02, double 7.800000e+02, double 7.760000e+02, double 7.870000e+02, double 7.740000e+02, double 7.860000e+02, double 7.770000e+02, double 7.790000e+02, double 7.860000e+02, double 7.740000e+02, double 7.880000e+02, double 7.750000e+02, double 7.810000e+02, double 7.830000e+02, double 7.750000e+02, double 7.880000e+02, double 7.750000e+02, double 7.840000e+02, double 7.810000e+02, double 7.760000e+02, double 7.880000e+02, double 7.730000e+02, double 7.870000e+02, double 7.790000e+02, double 7.790000e+02, double 7.860000e+02, double 7.730000e+02, double 7.870000e+02, double 7.770000e+02, double 7.820000e+02, double 7.840000e+02, double 7.740000e+02, double 7.880000e+02, double 7.750000e+02, double 7.840000e+02, double 7.820000e+02, double 7.760000e+02, double 7.880000e+02, double 7.740000e+02, double 7.860000e+02, double 7.790000e+02, double 7.780000e+02, double 7.870000e+02, double 7.740000e+02, double 7.880000e+02, double 7.770000e+02, double 7.800000e+02, double 7.850000e+02, double 7.750000e+02, double 7.880000e+02, double 7.750000e+02, double 7.830000e+02, double 7.820000e+02, double 7.760000e+02, double 7.880000e+02, double 7.740000e+02, double 7.860000e+02, double 7.800000e+02, double 7.780000e+02, double 7.870000e+02, double 7.740000e+02, double 7.870000e+02, double 7.770000e+02]
@.str.1 = [13 x i8] c"%d\09%f + i%f\0A\00"
define i32 @main() {
%1 = alloca [64 x double]
%2 = alloca [64 x double]
%3 = alloca [32 x double]
%4 = alloca [32 x double]
%5 = alloca [64 x i32]
%6 = bitcast [64 x double]* %1 to i8*
%7 = bitcast [64 x double]* %2 to i8*
%8 = bitcast [32 x double]* %3 to i8*
%9 = bitcast [32 x double]* %4 to i8*
%10 = bitcast [64 x i32]* %5 to i8*
%11 = getelementptr inbounds [32 x double], [32 x double]* %3, i64 0, i64 0
%12 = getelementptr inbounds [32 x double], [32 x double]* %4, i64 0, i64 0
%13 = getelementptr inbounds [64 x i32], [64 x i32]* %5, i64 0, i64 0
%14 = call i32 @init(double* %11, double* %12, i32* %13)
%15 = getelementptr inbounds [64 x double], [64 x double]* %1, i64 0, i64 0
%16 = getelementptr inbounds [64 x double], [64 x double]* %2, i64 0, i64 0
%17 = call i32 @fft(double* %15, double* %16, double* %11, double* %12, i32* %13)
%18 = call i32 @putchar(i32 10)
br label %19
19: ; preds = %0, %19
%20 = phi i64 [ 0, %0 ], [ %27, %19 ]
%21 = getelementptr inbounds [64 x double], [64 x double]* %1, i64 0, i64 %20
%22 = load double, double* %21
%23 = getelementptr inbounds [64 x double], [64 x double]* %2, i64 0, i64 %20
%24 = load double, double* %23
%25 = trunc i64 %20 to i32
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %25, double %22, double %24)
%27 = add nuw nsw i64 %20, 1
%28 = icmp eq i64 %27, 64
br i1 %28, label %29, label %19
29: ; preds = %19
ret i32 0
}