#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*/ cdft(int, int, double *, int *, double *);
int /*<<< orphan*/ ddct(int, int, double *, int *, double *);
int /*<<< orphan*/ ddst(int, int, double *, int *, double *);
int /*<<< orphan*/ dfct(int, double *, double *, int *, double *);
int /*<<< orphan*/ dfst(int, double *, double *, int *, double *);
double errorcheck(int, int, double, double *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ putdata(int, int, double *);
int /*<<< orphan*/ rdft(int, int, double *, int *, double *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n, ip[64 + 2];
  double a[8192 + 1], w[8192 * 5 / 4], t[8192 / 2 + 1], err;
  printf("data length n=? (must be 2^m)\n");
  scanf("%d", &n);
  ip[0] = 0;
  putdata(0, n - 1, a);
  cdft(n, 1, a, ip, w);
  cdft(n, -1, a, ip, w);
  err = errorcheck(0, n - 1, 2.0 / n, a);
  printf("cdft err= %g \n", err);
  putdata(0, n - 1, a);
  rdft(n, 1, a, ip, w);
  rdft(n, -1, a, ip, w);
  err = errorcheck(0, n - 1, 2.0 / n, a);
  printf("rdft err= %g \n", err);
  putdata(0, n - 1, a);
  ddct(n, 1, a, ip, w);
  ddct(n, -1, a, ip, w);
  a[0] *= 0.5;
  err = errorcheck(0, n - 1, 2.0 / n, a);
  printf("ddct err= %g \n", err);
  putdata(0, n - 1, a);
  ddst(n, 1, a, ip, w);
  ddst(n, -1, a, ip, w);
  a[0] *= 0.5;
  err = errorcheck(0, n - 1, 2.0 / n, a);
  printf("ddst err= %g \n", err);
  putdata(0, n, a);
  a[0] *= 0.5;
  a[n] *= 0.5;
  dfct(n, a, t, ip, w);
  a[0] *= 0.5;
  a[n] *= 0.5;
  dfct(n, a, t, ip, w);
  err = errorcheck(0, n, 2.0 / n, a);
  printf("dfct err= %g \n", err);
  putdata(1, n - 1, a);
  dfst(n, a, t, ip, w);
  dfst(n, a, t, ip, w);
  err = errorcheck(1, n - 1, 2.0 / n, a);
  printf("dfst err= %g \n", err);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2c140,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe68(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
movl   $0x0,-0x110(%rbp)
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
lea    -0x10120(%rbp),%rdx
xor    %edi,%edi
call   1030 <putdata@plt>
mov    -0x8(%rbp),%edi
lea    -0x10120(%rbp),%rdx
lea    -0x110(%rbp),%rcx
lea    -0x24120(%rbp),%r8
mov    $0x1,%esi
call   1080 <cdft@plt>
mov    -0x8(%rbp),%edi
lea    -0x10120(%rbp),%rdx
lea    -0x110(%rbp),%rcx
lea    -0x24120(%rbp),%r8
mov    $0xffffffff,%esi
call   1080 <cdft@plt>
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xdbb(%rip),%xmm0
divsd  %xmm1,%xmm0
lea    -0x10120(%rbp),%rdx
xor    %edi,%edi
call   10b0 <errorcheck@plt>
movsd  %xmm0,-0x2c138(%rbp)
ff
movsd  -0x2c138(%rbp),%xmm0
ff
lea    0xdc4(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
lea    -0x10120(%rbp),%rdx
xor    %edi,%edi
call   1030 <putdata@plt>
mov    -0x8(%rbp),%edi
lea    -0x10120(%rbp),%rdx
lea    -0x110(%rbp),%rcx
lea    -0x24120(%rbp),%r8
mov    $0x1,%esi
call   1050 <rdft@plt>
mov    -0x8(%rbp),%edi
lea    -0x10120(%rbp),%rdx
lea    -0x110(%rbp),%rcx
lea    -0x24120(%rbp),%r8
mov    $0xffffffff,%esi
call   1050 <rdft@plt>
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xd20(%rip),%xmm0
divsd  %xmm1,%xmm0
lea    -0x10120(%rbp),%rdx
xor    %edi,%edi
call   10b0 <errorcheck@plt>
movsd  %xmm0,-0x2c138(%rbp)
ff
movsd  -0x2c138(%rbp),%xmm0
ff
lea    0xd38(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
lea    -0x10120(%rbp),%rdx
xor    %edi,%edi
call   1030 <putdata@plt>
mov    -0x8(%rbp),%edi
lea    -0x10120(%rbp),%rdx
lea    -0x110(%rbp),%rcx
lea    -0x24120(%rbp),%r8
mov    $0x1,%esi
call   10a0 <ddct@plt>
mov    -0x8(%rbp),%edi
lea    -0x10120(%rbp),%rdx
lea    -0x110(%rbp),%rcx
lea    -0x24120(%rbp),%r8
mov    $0xffffffff,%esi
call   10a0 <ddct@plt>
movsd  0xc98(%rip),%xmm0
mulsd  -0x10120(%rbp),%xmm0
ff
movsd  %xmm0,-0x10120(%rbp)
ff
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xc6d(%rip),%xmm0
divsd  %xmm1,%xmm0
lea    -0x10120(%rbp),%rdx
xor    %edi,%edi
call   10b0 <errorcheck@plt>
movsd  %xmm0,-0x2c138(%rbp)
ff
movsd  -0x2c138(%rbp),%xmm0
ff
lea    0xc94(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
lea    -0x10120(%rbp),%rdx
xor    %edi,%edi
call   1030 <putdata@plt>
mov    -0x8(%rbp),%edi
lea    -0x10120(%rbp),%rdx
lea    -0x110(%rbp),%rcx
lea    -0x24120(%rbp),%r8
mov    $0x1,%esi
call   1070 <ddst@plt>
mov    -0x8(%rbp),%edi
lea    -0x10120(%rbp),%rdx
lea    -0x110(%rbp),%rcx
lea    -0x24120(%rbp),%r8
mov    $0xffffffff,%esi
call   1070 <ddst@plt>
movsd  0xbe5(%rip),%xmm0
mulsd  -0x10120(%rbp),%xmm0
ff
movsd  %xmm0,-0x10120(%rbp)
ff
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xbba(%rip),%xmm0
divsd  %xmm1,%xmm0
lea    -0x10120(%rbp),%rdx
xor    %edi,%edi
call   10b0 <errorcheck@plt>
movsd  %xmm0,-0x2c138(%rbp)
ff
movsd  -0x2c138(%rbp),%xmm0
ff
lea    0xbf0(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%esi
lea    -0x10120(%rbp),%rdx
xor    %edi,%edi
call   1030 <putdata@plt>
movsd  0xb79(%rip),%xmm0
mulsd  -0x10120(%rbp),%xmm0
ff
movsd  %xmm0,-0x10120(%rbp)
ff
movslq -0x8(%rbp),%rax
movsd  0xb5d(%rip),%xmm0
mulsd  -0x10120(%rbp,%rax,8),%xmm0
fe ff
movsd  %xmm0,-0x10120(%rbp,%rax,8)
fe ff
mov    -0x8(%rbp),%edi
lea    -0x10120(%rbp),%rsi
lea    -0x2c130(%rbp),%rdx
lea    -0x110(%rbp),%rcx
lea    -0x24120(%rbp),%r8
call   10c0 <dfct@plt>
movsd  0xb1f(%rip),%xmm0
mulsd  -0x10120(%rbp),%xmm0
ff
movsd  %xmm0,-0x10120(%rbp)
ff
movslq -0x8(%rbp),%rax
movsd  0xb03(%rip),%xmm0
mulsd  -0x10120(%rbp,%rax,8),%xmm0
fe ff
movsd  %xmm0,-0x10120(%rbp,%rax,8)
fe ff
mov    -0x8(%rbp),%edi
lea    -0x10120(%rbp),%rsi
lea    -0x2c130(%rbp),%rdx
lea    -0x110(%rbp),%rcx
lea    -0x24120(%rbp),%r8
call   10c0 <dfct@plt>
mov    -0x8(%rbp),%esi
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xab5(%rip),%xmm0
divsd  %xmm1,%xmm0
lea    -0x10120(%rbp),%rdx
xor    %edi,%edi
call   10b0 <errorcheck@plt>
movsd  %xmm0,-0x2c138(%rbp)
ff
movsd  -0x2c138(%rbp),%xmm0
ff
lea    0xafa(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
lea    -0x10120(%rbp),%rdx
mov    $0x1,%edi
call   1030 <putdata@plt>
mov    -0x8(%rbp),%edi
lea    -0x10120(%rbp),%rsi
lea    -0x2c130(%rbp),%rdx
lea    -0x110(%rbp),%rcx
lea    -0x24120(%rbp),%r8
call   1090 <dfst@plt>
mov    -0x8(%rbp),%edi
lea    -0x10120(%rbp),%rsi
lea    -0x2c130(%rbp),%rdx
lea    -0x110(%rbp),%rcx
lea    -0x24120(%rbp),%r8
call   1090 <dfst@plt>
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xa13(%rip),%xmm0
divsd  %xmm1,%xmm0
lea    -0x10120(%rbp),%rdx
mov    $0x1,%edi
call   10b0 <errorcheck@plt>
movsd  %xmm0,-0x2c138(%rbp)
ff
movsd  -0x2c138(%rbp),%xmm0
ff
lea    0xa64(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x2c140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x2c148,%rsp
lea    0xea8(%rip),%rdi
call   1030 <puts@plt>
lea    0xe3f(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1070 <scanf@plt>
movl   $0x0,0x10(%rsp)
mov    0xc(%rsp),%esi
add    $0xffffffff,%esi
lea    0x120(%rsp),%rbx
xor    %edi,%edi
mov    %rbx,%rdx
call   1040 <putdata@plt>
mov    0xc(%rsp),%edi
lea    0x10(%rsp),%r14
lea    0x18140(%rsp),%r15
mov    $0x1,%esi
mov    %rbx,%rdx
mov    %r14,%rcx
mov    %r15,%r8
call   1090 <cdft@plt>
mov    0xc(%rsp),%edi
mov    $0xffffffff,%esi
mov    %rbx,%rdx
mov    %r14,%rcx
mov    %r15,%r8
call   1090 <cdft@plt>
mov    0xc(%rsp),%esi
cvtsi2sd %esi,%xmm1
add    $0xffffffff,%esi
movsd  0xdb6(%rip),%xmm0
divsd  %xmm1,%xmm0
xor    %edi,%edi
mov    %rbx,%rdx
call   10c0 <errorcheck@plt>
lea    0xdb4(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    0xc(%rsp),%esi
add    $0xffffffff,%esi
xor    %edi,%edi
mov    %rbx,%rdx
call   1040 <putdata@plt>
mov    0xc(%rsp),%edi
mov    $0x1,%esi
mov    %rbx,%rdx
mov    %r14,%rcx
mov    %r15,%r8
call   1060 <rdft@plt>
mov    0xc(%rsp),%edi
mov    $0xffffffff,%esi
mov    %rbx,%rdx
mov    %r14,%rcx
mov    %r15,%r8
call   1060 <rdft@plt>
mov    0xc(%rsp),%esi
xorps  %xmm1,%xmm1
cvtsi2sd %esi,%xmm1
add    $0xffffffff,%esi
movsd  0xd45(%rip),%xmm0
divsd  %xmm1,%xmm0
xor    %edi,%edi
mov    %rbx,%rdx
call   10c0 <errorcheck@plt>
lea    0xd52(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    0xc(%rsp),%esi
add    $0xffffffff,%esi
xor    %edi,%edi
mov    %rbx,%rdx
call   1040 <putdata@plt>
mov    0xc(%rsp),%edi
mov    $0x1,%esi
mov    %rbx,%rdx
mov    %r14,%rcx
mov    %r15,%r8
call   10b0 <ddct@plt>
mov    0xc(%rsp),%edi
mov    $0xffffffff,%esi
mov    %rbx,%rdx
mov    %r14,%rcx
mov    %r15,%r8
call   10b0 <ddct@plt>
movsd  0x120(%rsp),%xmm0
mulsd  0xce1(%rip),%xmm0
movsd  %xmm0,0x120(%rsp)
mov    0xc(%rsp),%esi
xorps  %xmm1,%xmm1
cvtsi2sd %esi,%xmm1
add    $0xffffffff,%esi
movsd  0xcba(%rip),%xmm0
divsd  %xmm1,%xmm0
xor    %edi,%edi
mov    %rbx,%rdx
call   10c0 <errorcheck@plt>
lea    0xcd6(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    0xc(%rsp),%esi
add    $0xffffffff,%esi
xor    %edi,%edi
mov    %rbx,%rdx
call   1040 <putdata@plt>
mov    0xc(%rsp),%edi
mov    $0x1,%esi
mov    %rbx,%rdx
mov    %r14,%rcx
mov    %r15,%r8
call   1080 <ddst@plt>
mov    0xc(%rsp),%edi
mov    $0xffffffff,%esi
mov    %rbx,%rdx
mov    %r14,%rcx
mov    %r15,%r8
call   1080 <ddst@plt>
movsd  0x120(%rsp),%xmm0
mulsd  0xc56(%rip),%xmm0
movsd  %xmm0,0x120(%rsp)
mov    0xc(%rsp),%esi
xorps  %xmm1,%xmm1
cvtsi2sd %esi,%xmm1
add    $0xffffffff,%esi
movsd  0xc2f(%rip),%xmm0
divsd  %xmm1,%xmm0
xor    %edi,%edi
mov    %rbx,%rdx
call   10c0 <errorcheck@plt>
lea    0xc5a(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    0xc(%rsp),%esi
xor    %edi,%edi
mov    %rbx,%rdx
call   1040 <putdata@plt>
movsd  0x120(%rsp),%xmm0
movsd  0xbfc(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x120(%rsp)
movslq 0xc(%rsp),%rdi
movsd  0x120(%rsp,%rdi,8),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x120(%rsp,%rdi,8)
lea    0x10130(%rsp),%r12
mov    %rbx,%rsi
mov    %r12,%rdx
mov    %r14,%rcx
mov    %r15,%r8
call   10d0 <dfct@plt>
movsd  0x120(%rsp),%xmm0
movsd  0xbaa(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x120(%rsp)
movslq 0xc(%rsp),%rdi
mulsd  0x120(%rsp,%rdi,8),%xmm1
movsd  %xmm1,0x120(%rsp,%rdi,8)
mov    %rbx,%rsi
mov    %r12,%rdx
mov    %r14,%rcx
mov    %r15,%r8
call   10d0 <dfct@plt>
mov    0xc(%rsp),%esi
xorps  %xmm1,%xmm1
cvtsi2sd %esi,%xmm1
movsd  0xb5a(%rip),%xmm0
divsd  %xmm1,%xmm0
xor    %edi,%edi
mov    %rbx,%rdx
call   10c0 <errorcheck@plt>
lea    0xb94(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    0xc(%rsp),%esi
add    $0xffffffff,%esi
mov    $0x1,%edi
mov    %rbx,%rdx
call   1040 <putdata@plt>
mov    0xc(%rsp),%edi
mov    %rbx,%rsi
mov    %r12,%rdx
mov    %r14,%rcx
mov    %r15,%r8
call   10a0 <dfst@plt>
mov    0xc(%rsp),%edi
mov    %rbx,%rsi
mov    %r12,%rdx
mov    %r14,%rcx
mov    %r15,%r8
call   10a0 <dfst@plt>
mov    0xc(%rsp),%esi
xorps  %xmm1,%xmm1
cvtsi2sd %esi,%xmm1
add    $0xffffffff,%esi
movsd  0xaea(%rip),%xmm0
divsd  %xmm1,%xmm0
mov    $0x1,%edi
mov    %rbx,%rdx
call   10c0 <errorcheck@plt>
lea    0xb30(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x2c148,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [31 x i8] c"data length n=? (must be 2^m)\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [15 x i8] c"cdft err= %g \0A\00"
@.str.3 = [15 x i8] c"rdft err= %g \0A\00"
@.str.4 = [15 x i8] c"ddct err= %g \0A\00"
@.str.5 = [15 x i8] c"ddst err= %g \0A\00"
@.str.6 = [15 x i8] c"dfct err= %g \0A\00"
@.str.7 = [15 x i8] c"dfst err= %g \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [66 x i32]
%4 = alloca [8193 x double]
%5 = alloca [10240 x double]
%6 = alloca [4097 x double]
%7 = alloca double
store i32 0, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%10 = getelementptr inbounds [66 x i32], [66 x i32]* %3, i64 0, i64 0
store i32 0, i32* %10
%11 = load i32, i32* %2
%12 = sub nsw i32 %11, 1
%13 = getelementptr inbounds [8193 x double], [8193 x double]* %4, i64 0, i64 0
%14 = call i32 @putdata(i32 0, i32 %12, double* %13)
%15 = load i32, i32* %2
%16 = getelementptr inbounds [8193 x double], [8193 x double]* %4, i64 0, i64 0
%17 = getelementptr inbounds [66 x i32], [66 x i32]* %3, i64 0, i64 0
%18 = getelementptr inbounds [10240 x double], [10240 x double]* %5, i64 0, i64 0
%19 = call i32 @cdft(i32 %15, i32 1, double* %16, i32* %17, double* %18)
%20 = load i32, i32* %2
%21 = getelementptr inbounds [8193 x double], [8193 x double]* %4, i64 0, i64 0
%22 = getelementptr inbounds [66 x i32], [66 x i32]* %3, i64 0, i64 0
%23 = getelementptr inbounds [10240 x double], [10240 x double]* %5, i64 0, i64 0
%24 = call i32 @cdft(i32 %20, i32 -1, double* %21, i32* %22, double* %23)
%25 = load i32, i32* %2
%26 = sub nsw i32 %25, 1
%27 = load i32, i32* %2
%28 = sitofp i32 %27 to double
%29 = fdiv double 2.000000e+00, %28
%30 = getelementptr inbounds [8193 x double], [8193 x double]* %4, i64 0, i64 0
%31 = call double @errorcheck(i32 0, i32 %26, double %29, double* %30)
store double %31, double* %7
%32 = load double, double* %7
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double %32)
%34 = load i32, i32* %2
%35 = sub nsw i32 %34, 1
%36 = getelementptr inbounds [8193 x double], [8193 x double]* %4, i64 0, i64 0
%37 = call i32 @putdata(i32 0, i32 %35, double* %36)
%38 = load i32, i32* %2
%39 = getelementptr inbounds [8193 x double], [8193 x double]* %4, i64 0, i64 0
%40 = getelementptr inbounds [66 x i32], [66 x i32]* %3, i64 0, i64 0
%41 = getelementptr inbounds [10240 x double], [10240 x double]* %5, i64 0, i64 0
%42 = call i32 @rdft(i32 %38, i32 1, double* %39, i32* %40, double* %41)
%43 = load i32, i32* %2
%44 = getelementptr inbounds [8193 x double], [8193 x double]* %4, i64 0, i64 0
%45 = getelementptr inbounds [66 x i32], [66 x i32]* %3, i64 0, i64 0
%46 = getelementptr inbounds [10240 x double], [10240 x double]* %5, i64 0, i64 0
%47 = call i32 @rdft(i32 %43, i32 -1, double* %44, i32* %45, double* %46)
%48 = load i32, i32* %2
%49 = sub nsw i32 %48, 1
%50 = load i32, i32* %2
%51 = sitofp i32 %50 to double
%52 = fdiv double 2.000000e+00, %51
%53 = getelementptr inbounds [8193 x double], [8193 x double]* %4, i64 0, i64 0
%54 = call double @errorcheck(i32 0, i32 %49, double %52, double* %53)
store double %54, double* %7
%55 = load double, double* %7
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), double %55)
%57 = load i32, i32* %2
%58 = sub nsw i32 %57, 1
%59 = getelementptr inbounds [8193 x double], [8193 x double]* %4, i64 0, i64 0
%60 = call i32 @putdata(i32 0, i32 %58, double* %59)
%61 = load i32, i32* %2
%62 = getelementptr inbounds [8193 x double], [8193 x double]* %4, i64 0, i64 0
%63 = getelementptr inbounds [66 x i32], [66 x i32]* %3, i64 0, i64 0
%64 = getelementptr inbounds [10240 x double], [10240 x double]* %5, i64 0, i64 0
%65 = call i32 @ddct(i32 %61, i32 1, double* %62, i32* %63, double* %64)
%66 = load i32, i32* %2
%67 = getelementptr inbounds [8193 x double], [8193 x double]* %4, i64 0, i64 0
%68 = getelementptr inbounds [66 x i32], [66 x i32]* %3, i64 0, i64 0
%69 = getelementptr inbounds [10240 x double], [10240 x double]* %5, i64 0, i64 0
%70 = call i32 @ddct(i32 %66, i32 -1, double* %67, i32* %68, double* %69)
%71 = getelementptr inbounds [8193 x double], [8193 x double]* %4, i64 0, i64 0
%72 = load double, double* %71
%73 = fmul double %72, 5.000000e-01
store double %73, double* %71
%74 = load i32, i32* %2
%75 = sub nsw i32 %74, 1
%76 = load i32, i32* %2
%77 = sitofp i32 %76 to double
%78 = fdiv double 2.000000e+00, %77
%79 = getelementptr inbounds [8193 x double], [8193 x double]* %4, i64 0, i64 0
%80 = call double @errorcheck(i32 0, i32 %75, double %78, double* %79)
store double %80, double* %7
%81 = load double, double* %7
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), double %81)
%83 = load i32, i32* %2
%84 = sub nsw i32 %83, 1
%85 = getelementptr inbounds [8193 x double], [8193 x double]* %4, i64 0, i64 0
%86 = call i32 @putdata(i32 0, i32 %84, double* %85)
%87 = load i32, i32* %2
%88 = getelementptr inbounds [8193 x double], [8193 x double]* %4, i64 0, i64 0
%89 = getelementptr inbounds [66 x i32], [66 x i32]* %3, i64 0, i64 0
%90 = getelementptr inbounds [10240 x double], [10240 x double]* %5, i64 0, i64 0
%91 = call i32 @ddst(i32 %87, i32 1, double* %88, i32* %89, double* %90)
%92 = load i32, i32* %2
%93 = getelementptr inbounds [8193 x double], [8193 x double]* %4, i64 0, i64 0
%94 = getelementptr inbounds [66 x i32], [66 x i32]* %3, i64 0, i64 0
%95 = getelementptr inbounds [10240 x double], [10240 x double]* %5, i64 0, i64 0
%96 = call i32 @ddst(i32 %92, i32 -1, double* %93, i32* %94, double* %95)
%97 = getelementptr inbounds [8193 x double], [8193 x double]* %4, i64 0, i64 0
%98 = load double, double* %97
%99 = fmul double %98, 5.000000e-01
store double %99, double* %97
%100 = load i32, i32* %2
%101 = sub nsw i32 %100, 1
%102 = load i32, i32* %2
%103 = sitofp i32 %102 to double
%104 = fdiv double 2.000000e+00, %103
%105 = getelementptr inbounds [8193 x double], [8193 x double]* %4, i64 0, i64 0
%106 = call double @errorcheck(i32 0, i32 %101, double %104, double* %105)
store double %106, double* %7
%107 = load double, double* %7
%108 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), double %107)
%109 = load i32, i32* %2
%110 = getelementptr inbounds [8193 x double], [8193 x double]* %4, i64 0, i64 0
%111 = call i32 @putdata(i32 0, i32 %109, double* %110)
%112 = getelementptr inbounds [8193 x double], [8193 x double]* %4, i64 0, i64 0
%113 = load double, double* %112
%114 = fmul double %113, 5.000000e-01
store double %114, double* %112
%115 = load i32, i32* %2
%116 = sext i32 %115 to i64
%117 = getelementptr inbounds [8193 x double], [8193 x double]* %4, i64 0, i64 %116
%118 = load double, double* %117
%119 = fmul double %118, 5.000000e-01
store double %119, double* %117
%120 = load i32, i32* %2
%121 = getelementptr inbounds [8193 x double], [8193 x double]* %4, i64 0, i64 0
%122 = getelementptr inbounds [4097 x double], [4097 x double]* %6, i64 0, i64 0
%123 = getelementptr inbounds [66 x i32], [66 x i32]* %3, i64 0, i64 0
%124 = getelementptr inbounds [10240 x double], [10240 x double]* %5, i64 0, i64 0
%125 = call i32 @dfct(i32 %120, double* %121, double* %122, i32* %123, double* %124)
%126 = getelementptr inbounds [8193 x double], [8193 x double]* %4, i64 0, i64 0
%127 = load double, double* %126
%128 = fmul double %127, 5.000000e-01
store double %128, double* %126
%129 = load i32, i32* %2
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds [8193 x double], [8193 x double]* %4, i64 0, i64 %130
%132 = load double, double* %131
%133 = fmul double %132, 5.000000e-01
store double %133, double* %131
%134 = load i32, i32* %2
%135 = getelementptr inbounds [8193 x double], [8193 x double]* %4, i64 0, i64 0
%136 = getelementptr inbounds [4097 x double], [4097 x double]* %6, i64 0, i64 0
%137 = getelementptr inbounds [66 x i32], [66 x i32]* %3, i64 0, i64 0
%138 = getelementptr inbounds [10240 x double], [10240 x double]* %5, i64 0, i64 0
%139 = call i32 @dfct(i32 %134, double* %135, double* %136, i32* %137, double* %138)
%140 = load i32, i32* %2
%141 = load i32, i32* %2
%142 = sitofp i32 %141 to double
%143 = fdiv double 2.000000e+00, %142
%144 = getelementptr inbounds [8193 x double], [8193 x double]* %4, i64 0, i64 0
%145 = call double @errorcheck(i32 0, i32 %140, double %143, double* %144)
store double %145, double* %7
%146 = load double, double* %7
%147 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), double %146)
%148 = load i32, i32* %2
%149 = sub nsw i32 %148, 1
%150 = getelementptr inbounds [8193 x double], [8193 x double]* %4, i64 0, i64 0
%151 = call i32 @putdata(i32 1, i32 %149, double* %150)
%152 = load i32, i32* %2
%153 = getelementptr inbounds [8193 x double], [8193 x double]* %4, i64 0, i64 0
%154 = getelementptr inbounds [4097 x double], [4097 x double]* %6, i64 0, i64 0
%155 = getelementptr inbounds [66 x i32], [66 x i32]* %3, i64 0, i64 0
%156 = getelementptr inbounds [10240 x double], [10240 x double]* %5, i64 0, i64 0
%157 = call i32 @dfst(i32 %152, double* %153, double* %154, i32* %155, double* %156)
%158 = load i32, i32* %2
%159 = getelementptr inbounds [8193 x double], [8193 x double]* %4, i64 0, i64 0
%160 = getelementptr inbounds [4097 x double], [4097 x double]* %6, i64 0, i64 0
%161 = getelementptr inbounds [66 x i32], [66 x i32]* %3, i64 0, i64 0
%162 = getelementptr inbounds [10240 x double], [10240 x double]* %5, i64 0, i64 0
%163 = call i32 @dfst(i32 %158, double* %159, double* %160, i32* %161, double* %162)
%164 = load i32, i32* %2
%165 = sub nsw i32 %164, 1
%166 = load i32, i32* %2
%167 = sitofp i32 %166 to double
%168 = fdiv double 2.000000e+00, %167
%169 = getelementptr inbounds [8193 x double], [8193 x double]* %4, i64 0, i64 0
%170 = call double @errorcheck(i32 1, i32 %165, double %168, double* %169)
store double %170, double* %7
%171 = load double, double* %7
%172 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), double %171)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [15 x i8] c"cdft err= %g \0A\00"
@.str.3 = [15 x i8] c"rdft err= %g \0A\00"
@.str.4 = [15 x i8] c"ddct err= %g \0A\00"
@.str.5 = [15 x i8] c"ddst err= %g \0A\00"
@.str.6 = [15 x i8] c"dfct err= %g \0A\00"
@.str.7 = [15 x i8] c"dfst err= %g \0A\00"
@str = [30 x i8] c"data length n=? (must be 2^m)\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [66 x i32]
%3 = alloca [8193 x double]
%4 = alloca [10240 x double]
%5 = alloca [4097 x double]
%6 = bitcast i32* %1 to i8*
%7 = bitcast [66 x i32]* %2 to i8*
%8 = bitcast [8193 x double]* %3 to i8*
%9 = bitcast [10240 x double]* %4 to i8*
%10 = bitcast [4097 x double]* %5 to i8*
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%13 = getelementptr inbounds [66 x i32], [66 x i32]* %2, i64 0, i64 0
store i32 0, i32* %13
%14 = load i32, i32* %1
%15 = add nsw i32 %14, -1
%16 = getelementptr inbounds [8193 x double], [8193 x double]* %3, i64 0, i64 0
%17 = call i32 @putdata(i32 0, i32 %15, double* %16)
%18 = load i32, i32* %1
%19 = getelementptr inbounds [10240 x double], [10240 x double]* %4, i64 0, i64 0
%20 = call i32 @cdft(i32 %18, i32 1, double* %16, i32* %13, double* %19)
%21 = load i32, i32* %1
%22 = call i32 @cdft(i32 %21, i32 -1, double* %16, i32* %13, double* %19)
%23 = load i32, i32* %1
%24 = add nsw i32 %23, -1
%25 = sitofp i32 %23 to double
%26 = fdiv double 2.000000e+00, %25
%27 = call double @errorcheck(i32 0, i32 %24, double %26, double* %16)
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double %27)
%29 = load i32, i32* %1
%30 = add nsw i32 %29, -1
%31 = call i32 @putdata(i32 0, i32 %30, double* %16)
%32 = load i32, i32* %1
%33 = call i32 @rdft(i32 %32, i32 1, double* %16, i32* %13, double* %19)
%34 = load i32, i32* %1
%35 = call i32 @rdft(i32 %34, i32 -1, double* %16, i32* %13, double* %19)
%36 = load i32, i32* %1
%37 = add nsw i32 %36, -1
%38 = sitofp i32 %36 to double
%39 = fdiv double 2.000000e+00, %38
%40 = call double @errorcheck(i32 0, i32 %37, double %39, double* %16)
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), double %40)
%42 = load i32, i32* %1
%43 = add nsw i32 %42, -1
%44 = call i32 @putdata(i32 0, i32 %43, double* %16)
%45 = load i32, i32* %1
%46 = call i32 @ddct(i32 %45, i32 1, double* %16, i32* %13, double* %19)
%47 = load i32, i32* %1
%48 = call i32 @ddct(i32 %47, i32 -1, double* %16, i32* %13, double* %19)
%49 = load double, double* %16
%50 = fmul double %49, 5.000000e-01
store double %50, double* %16
%51 = load i32, i32* %1
%52 = add nsw i32 %51, -1
%53 = sitofp i32 %51 to double
%54 = fdiv double 2.000000e+00, %53
%55 = call double @errorcheck(i32 0, i32 %52, double %54, double* %16)
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), double %55)
%57 = load i32, i32* %1
%58 = add nsw i32 %57, -1
%59 = call i32 @putdata(i32 0, i32 %58, double* %16)
%60 = load i32, i32* %1
%61 = call i32 @ddst(i32 %60, i32 1, double* %16, i32* %13, double* %19)
%62 = load i32, i32* %1
%63 = call i32 @ddst(i32 %62, i32 -1, double* %16, i32* %13, double* %19)
%64 = load double, double* %16
%65 = fmul double %64, 5.000000e-01
store double %65, double* %16
%66 = load i32, i32* %1
%67 = add nsw i32 %66, -1
%68 = sitofp i32 %66 to double
%69 = fdiv double 2.000000e+00, %68
%70 = call double @errorcheck(i32 0, i32 %67, double %69, double* %16)
%71 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), double %70)
%72 = load i32, i32* %1
%73 = call i32 @putdata(i32 0, i32 %72, double* %16)
%74 = load double, double* %16
%75 = fmul double %74, 5.000000e-01
store double %75, double* %16
%76 = load i32, i32* %1
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds [8193 x double], [8193 x double]* %3, i64 0, i64 %77
%79 = load double, double* %78
%80 = fmul double %79, 5.000000e-01
store double %80, double* %78
%81 = getelementptr inbounds [4097 x double], [4097 x double]* %5, i64 0, i64 0
%82 = call i32 @dfct(i32 %76, double* %16, double* %81, i32* %13, double* %19)
%83 = load double, double* %16
%84 = fmul double %83, 5.000000e-01
store double %84, double* %16
%85 = load i32, i32* %1
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds [8193 x double], [8193 x double]* %3, i64 0, i64 %86
%88 = load double, double* %87
%89 = fmul double %88, 5.000000e-01
store double %89, double* %87
%90 = call i32 @dfct(i32 %85, double* %16, double* %81, i32* %13, double* %19)
%91 = load i32, i32* %1
%92 = sitofp i32 %91 to double
%93 = fdiv double 2.000000e+00, %92
%94 = call double @errorcheck(i32 0, i32 %91, double %93, double* %16)
%95 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), double %94)
%96 = load i32, i32* %1
%97 = add nsw i32 %96, -1
%98 = call i32 @putdata(i32 1, i32 %97, double* %16)
%99 = load i32, i32* %1
%100 = call i32 @dfst(i32 %99, double* %16, double* %81, i32* %13, double* %19)
%101 = load i32, i32* %1
%102 = call i32 @dfst(i32 %101, double* %16, double* %81, i32* %13, double* %19)
%103 = load i32, i32* %1
%104 = add nsw i32 %103, -1
%105 = sitofp i32 %103 to double
%106 = fdiv double 2.000000e+00, %105
%107 = call double @errorcheck(i32 1, i32 %104, double %106, double* %16)
%108 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), double %107)
ret i32 0
}