#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 /*<<< orphan*/ ddct(int, int, double *);
int /*<<< orphan*/ ddst(int, int, double *);
int /*<<< orphan*/ dfct(int, double *);
int /*<<< orphan*/ dfst(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 /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  double a[8192 + 1], err;
  printf("data length n=? (must be 2^m)\n");
  scanf("%d", &n);
  putdata(0, n - 1, a);
  cdft(n, 1, a);
  cdft(n, -1, a);
  err = errorcheck(0, n - 1, 2.0 / n, a);
  printf("cdft err= %g \n", err);
  putdata(0, n - 1, a);
  rdft(n, 1, a);
  rdft(n, -1, a);
  err = errorcheck(0, n - 1, 2.0 / n, a);
  printf("rdft err= %g \n", err);
  putdata(0, n - 1, a);
  ddct(n, 1, a);
  ddct(n, -1, a);
  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);
  ddst(n, -1, a);
  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);
  a[0] *= 0.5;
  a[n] *= 0.5;
  dfct(n, a);
  err = errorcheck(0, n, 2.0 / n, a);
  printf("dfct err= %g \n", err);
  putdata(1, n - 1, a);
  dfst(n, a);
  dfst(n, a);
  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    $0x10020,%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>
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
lea    -0x10010(%rbp),%rdx
xor    %edi,%edi
call   1030 <putdata@plt>
mov    -0x8(%rbp),%edi
lea    -0x10010(%rbp),%rdx
mov    $0x1,%esi
call   1080 <cdft@plt>
mov    -0x8(%rbp),%edi
lea    -0x10010(%rbp),%rdx
mov    $0xffffffff,%esi
call   1080 <cdft@plt>
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xde1(%rip),%xmm0
divsd  %xmm1,%xmm0
lea    -0x10010(%rbp),%rdx
xor    %edi,%edi
call   10b0 <errorcheck@plt>
movsd  %xmm0,-0x10018(%rbp)
ff
movsd  -0x10018(%rbp),%xmm0
ff
lea    0xdea(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
lea    -0x10010(%rbp),%rdx
xor    %edi,%edi
call   1030 <putdata@plt>
mov    -0x8(%rbp),%edi
lea    -0x10010(%rbp),%rdx
mov    $0x1,%esi
call   1050 <rdft@plt>
mov    -0x8(%rbp),%edi
lea    -0x10010(%rbp),%rdx
mov    $0xffffffff,%esi
call   1050 <rdft@plt>
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xd62(%rip),%xmm0
divsd  %xmm1,%xmm0
lea    -0x10010(%rbp),%rdx
xor    %edi,%edi
call   10b0 <errorcheck@plt>
movsd  %xmm0,-0x10018(%rbp)
ff
movsd  -0x10018(%rbp),%xmm0
ff
lea    0xd7a(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
lea    -0x10010(%rbp),%rdx
xor    %edi,%edi
call   1030 <putdata@plt>
mov    -0x8(%rbp),%edi
lea    -0x10010(%rbp),%rdx
mov    $0x1,%esi
call   10a0 <ddct@plt>
mov    -0x8(%rbp),%edi
lea    -0x10010(%rbp),%rdx
mov    $0xffffffff,%esi
call   10a0 <ddct@plt>
movsd  0xcf6(%rip),%xmm0
mulsd  -0x10010(%rbp),%xmm0
ff
movsd  %xmm0,-0x10010(%rbp)
ff
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xccb(%rip),%xmm0
divsd  %xmm1,%xmm0
lea    -0x10010(%rbp),%rdx
xor    %edi,%edi
call   10b0 <errorcheck@plt>
movsd  %xmm0,-0x10018(%rbp)
ff
movsd  -0x10018(%rbp),%xmm0
ff
lea    0xcf2(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
lea    -0x10010(%rbp),%rdx
xor    %edi,%edi
call   1030 <putdata@plt>
mov    -0x8(%rbp),%edi
lea    -0x10010(%rbp),%rdx
mov    $0x1,%esi
call   1070 <ddst@plt>
mov    -0x8(%rbp),%edi
lea    -0x10010(%rbp),%rdx
mov    $0xffffffff,%esi
call   1070 <ddst@plt>
movsd  0xc5f(%rip),%xmm0
mulsd  -0x10010(%rbp),%xmm0
ff
movsd  %xmm0,-0x10010(%rbp)
ff
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xc34(%rip),%xmm0
divsd  %xmm1,%xmm0
lea    -0x10010(%rbp),%rdx
xor    %edi,%edi
call   10b0 <errorcheck@plt>
movsd  %xmm0,-0x10018(%rbp)
ff
movsd  -0x10018(%rbp),%xmm0
ff
lea    0xc6a(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%esi
lea    -0x10010(%rbp),%rdx
xor    %edi,%edi
call   1030 <putdata@plt>
movsd  0xbf3(%rip),%xmm0
mulsd  -0x10010(%rbp),%xmm0
ff
movsd  %xmm0,-0x10010(%rbp)
ff
movslq -0x8(%rbp),%rax
movsd  0xbd7(%rip),%xmm0
mulsd  -0x10010(%rbp,%rax,8),%xmm0
fe ff
movsd  %xmm0,-0x10010(%rbp,%rax,8)
fe ff
mov    -0x8(%rbp),%edi
lea    -0x10010(%rbp),%rsi
call   10c0 <dfct@plt>
movsd  0xbae(%rip),%xmm0
mulsd  -0x10010(%rbp),%xmm0
ff
movsd  %xmm0,-0x10010(%rbp)
ff
movslq -0x8(%rbp),%rax
movsd  0xb92(%rip),%xmm0
mulsd  -0x10010(%rbp,%rax,8),%xmm0
fe ff
movsd  %xmm0,-0x10010(%rbp,%rax,8)
fe ff
mov    -0x8(%rbp),%edi
lea    -0x10010(%rbp),%rsi
call   10c0 <dfct@plt>
mov    -0x8(%rbp),%esi
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xb59(%rip),%xmm0
divsd  %xmm1,%xmm0
lea    -0x10010(%rbp),%rdx
xor    %edi,%edi
call   10b0 <errorcheck@plt>
movsd  %xmm0,-0x10018(%rbp)
ff
movsd  -0x10018(%rbp),%xmm0
ff
lea    0xb9e(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
lea    -0x10010(%rbp),%rdx
mov    $0x1,%edi
call   1030 <putdata@plt>
mov    -0x8(%rbp),%edi
lea    -0x10010(%rbp),%rsi
call   1090 <dfst@plt>
mov    -0x8(%rbp),%edi
lea    -0x10010(%rbp),%rsi
call   1090 <dfst@plt>
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xae1(%rip),%xmm0
divsd  %xmm1,%xmm0
lea    -0x10010(%rbp),%rdx
mov    $0x1,%edi
call   10b0 <errorcheck@plt>
movsd  %xmm0,-0x10018(%rbp)
ff
movsd  -0x10018(%rbp),%xmm0
ff
lea    0xb32(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10020,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10020,%rsp
lea    0xeae(%rip),%rdi
call   1030 <puts@plt>
lea    0xe45(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1070 <scanf@plt>
mov    0xc(%rsp),%esi
add    $0xffffffff,%esi
lea    0x10(%rsp),%rbx
xor    %edi,%edi
mov    %rbx,%rdx
call   1040 <putdata@plt>
mov    0xc(%rsp),%edi
mov    $0x1,%esi
mov    %rbx,%rdx
call   1090 <cdft@plt>
mov    0xc(%rsp),%edi
mov    $0xffffffff,%esi
mov    %rbx,%rdx
call   1090 <cdft@plt>
mov    0xc(%rsp),%esi
cvtsi2sd %esi,%xmm1
add    $0xffffffff,%esi
movsd  0xde0(%rip),%xmm0
divsd  %xmm1,%xmm0
xor    %edi,%edi
mov    %rbx,%rdx
call   10c0 <errorcheck@plt>
lea    0xdde(%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
call   1060 <rdft@plt>
mov    0xc(%rsp),%edi
mov    $0xffffffff,%esi
mov    %rbx,%rdx
call   1060 <rdft@plt>
mov    0xc(%rsp),%esi
xorps  %xmm1,%xmm1
cvtsi2sd %esi,%xmm1
add    $0xffffffff,%esi
movsd  0xd7b(%rip),%xmm0
divsd  %xmm1,%xmm0
xor    %edi,%edi
mov    %rbx,%rdx
call   10c0 <errorcheck@plt>
lea    0xd88(%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
call   10b0 <ddct@plt>
mov    0xc(%rsp),%edi
mov    $0xffffffff,%esi
mov    %rbx,%rdx
call   10b0 <ddct@plt>
movsd  0x10(%rsp),%xmm0
mulsd  0xd26(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
mov    0xc(%rsp),%esi
xorps  %xmm1,%xmm1
cvtsi2sd %esi,%xmm1
add    $0xffffffff,%esi
movsd  0xd02(%rip),%xmm0
divsd  %xmm1,%xmm0
xor    %edi,%edi
mov    %rbx,%rdx
call   10c0 <errorcheck@plt>
lea    0xd1e(%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
call   1080 <ddst@plt>
mov    0xc(%rsp),%edi
mov    $0xffffffff,%esi
mov    %rbx,%rdx
call   1080 <ddst@plt>
movsd  0x10(%rsp),%xmm0
mulsd  0xcad(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
mov    0xc(%rsp),%esi
xorps  %xmm1,%xmm1
cvtsi2sd %esi,%xmm1
add    $0xffffffff,%esi
movsd  0xc89(%rip),%xmm0
divsd  %xmm1,%xmm0
xor    %edi,%edi
mov    %rbx,%rdx
call   10c0 <errorcheck@plt>
lea    0xcb4(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    0xc(%rsp),%esi
xor    %edi,%edi
mov    %rbx,%rdx
call   1040 <putdata@plt>
movsd  0x10(%rsp),%xmm0
movsd  0xc59(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rsp)
movslq 0xc(%rsp),%rdi
movsd  0x10(%rsp,%rdi,8),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rsp,%rdi,8)
mov    %rbx,%rsi
call   10d0 <dfct@plt>
movsd  0x10(%rsp),%xmm0
movsd  0xc24(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rsp)
movslq 0xc(%rsp),%rdi
mulsd  0x10(%rsp,%rdi,8),%xmm1
movsd  %xmm1,0x10(%rsp,%rdi,8)
mov    %rbx,%rsi
call   10d0 <dfct@plt>
mov    0xc(%rsp),%esi
xorps  %xmm1,%xmm1
cvtsi2sd %esi,%xmm1
movsd  0xbe6(%rip),%xmm0
divsd  %xmm1,%xmm0
xor    %edi,%edi
mov    %rbx,%rdx
call   10c0 <errorcheck@plt>
lea    0xc20(%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
call   10a0 <dfst@plt>
mov    0xc(%rsp),%edi
mov    %rbx,%rsi
call   10a0 <dfst@plt>
mov    0xc(%rsp),%esi
xorps  %xmm1,%xmm1
cvtsi2sd %esi,%xmm1
add    $0xffffffff,%esi
movsd  0xb88(%rip),%xmm0
divsd  %xmm1,%xmm0
mov    $0x1,%edi
mov    %rbx,%rdx
call   10c0 <errorcheck@plt>
lea    0xbce(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10020,%rsp
pop    %rbx
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 [8193 x double]
%4 = alloca double
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 1
%9 = getelementptr inbounds [8193 x double], [8193 x double]* %3, i64 0, i64 0
%10 = call i32 @putdata(i32 0, i32 %8, double* %9)
%11 = load i32, i32* %2
%12 = getelementptr inbounds [8193 x double], [8193 x double]* %3, i64 0, i64 0
%13 = call i32 @cdft(i32 %11, i32 1, double* %12)
%14 = load i32, i32* %2
%15 = getelementptr inbounds [8193 x double], [8193 x double]* %3, i64 0, i64 0
%16 = call i32 @cdft(i32 %14, i32 -1, double* %15)
%17 = load i32, i32* %2
%18 = sub nsw i32 %17, 1
%19 = load i32, i32* %2
%20 = sitofp i32 %19 to double
%21 = fdiv double 2.000000e+00, %20
%22 = getelementptr inbounds [8193 x double], [8193 x double]* %3, i64 0, i64 0
%23 = call double @errorcheck(i32 0, i32 %18, double %21, double* %22)
store double %23, double* %4
%24 = load double, double* %4
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double %24)
%26 = load i32, i32* %2
%27 = sub nsw i32 %26, 1
%28 = getelementptr inbounds [8193 x double], [8193 x double]* %3, i64 0, i64 0
%29 = call i32 @putdata(i32 0, i32 %27, double* %28)
%30 = load i32, i32* %2
%31 = getelementptr inbounds [8193 x double], [8193 x double]* %3, i64 0, i64 0
%32 = call i32 @rdft(i32 %30, i32 1, double* %31)
%33 = load i32, i32* %2
%34 = getelementptr inbounds [8193 x double], [8193 x double]* %3, i64 0, i64 0
%35 = call i32 @rdft(i32 %33, i32 -1, double* %34)
%36 = load i32, i32* %2
%37 = sub nsw i32 %36, 1
%38 = load i32, i32* %2
%39 = sitofp i32 %38 to double
%40 = fdiv double 2.000000e+00, %39
%41 = getelementptr inbounds [8193 x double], [8193 x double]* %3, i64 0, i64 0
%42 = call double @errorcheck(i32 0, i32 %37, double %40, double* %41)
store double %42, double* %4
%43 = load double, double* %4
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), double %43)
%45 = load i32, i32* %2
%46 = sub nsw i32 %45, 1
%47 = getelementptr inbounds [8193 x double], [8193 x double]* %3, i64 0, i64 0
%48 = call i32 @putdata(i32 0, i32 %46, double* %47)
%49 = load i32, i32* %2
%50 = getelementptr inbounds [8193 x double], [8193 x double]* %3, i64 0, i64 0
%51 = call i32 @ddct(i32 %49, i32 1, double* %50)
%52 = load i32, i32* %2
%53 = getelementptr inbounds [8193 x double], [8193 x double]* %3, i64 0, i64 0
%54 = call i32 @ddct(i32 %52, i32 -1, double* %53)
%55 = getelementptr inbounds [8193 x double], [8193 x double]* %3, i64 0, i64 0
%56 = load double, double* %55
%57 = fmul double %56, 5.000000e-01
store double %57, double* %55
%58 = load i32, i32* %2
%59 = sub nsw i32 %58, 1
%60 = load i32, i32* %2
%61 = sitofp i32 %60 to double
%62 = fdiv double 2.000000e+00, %61
%63 = getelementptr inbounds [8193 x double], [8193 x double]* %3, i64 0, i64 0
%64 = call double @errorcheck(i32 0, i32 %59, double %62, double* %63)
store double %64, double* %4
%65 = load double, double* %4
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), double %65)
%67 = load i32, i32* %2
%68 = sub nsw i32 %67, 1
%69 = getelementptr inbounds [8193 x double], [8193 x double]* %3, i64 0, i64 0
%70 = call i32 @putdata(i32 0, i32 %68, double* %69)
%71 = load i32, i32* %2
%72 = getelementptr inbounds [8193 x double], [8193 x double]* %3, i64 0, i64 0
%73 = call i32 @ddst(i32 %71, i32 1, double* %72)
%74 = load i32, i32* %2
%75 = getelementptr inbounds [8193 x double], [8193 x double]* %3, i64 0, i64 0
%76 = call i32 @ddst(i32 %74, i32 -1, double* %75)
%77 = getelementptr inbounds [8193 x double], [8193 x double]* %3, i64 0, i64 0
%78 = load double, double* %77
%79 = fmul double %78, 5.000000e-01
store double %79, double* %77
%80 = load i32, i32* %2
%81 = sub nsw i32 %80, 1
%82 = load i32, i32* %2
%83 = sitofp i32 %82 to double
%84 = fdiv double 2.000000e+00, %83
%85 = getelementptr inbounds [8193 x double], [8193 x double]* %3, i64 0, i64 0
%86 = call double @errorcheck(i32 0, i32 %81, double %84, double* %85)
store double %86, double* %4
%87 = load double, double* %4
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), double %87)
%89 = load i32, i32* %2
%90 = getelementptr inbounds [8193 x double], [8193 x double]* %3, i64 0, i64 0
%91 = call i32 @putdata(i32 0, i32 %89, double* %90)
%92 = getelementptr inbounds [8193 x double], [8193 x double]* %3, i64 0, i64 0
%93 = load double, double* %92
%94 = fmul double %93, 5.000000e-01
store double %94, double* %92
%95 = load i32, i32* %2
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds [8193 x double], [8193 x double]* %3, i64 0, i64 %96
%98 = load double, double* %97
%99 = fmul double %98, 5.000000e-01
store double %99, double* %97
%100 = load i32, i32* %2
%101 = getelementptr inbounds [8193 x double], [8193 x double]* %3, i64 0, i64 0
%102 = call i32 @dfct(i32 %100, double* %101)
%103 = getelementptr inbounds [8193 x double], [8193 x double]* %3, i64 0, i64 0
%104 = load double, double* %103
%105 = fmul double %104, 5.000000e-01
store double %105, double* %103
%106 = load i32, i32* %2
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds [8193 x double], [8193 x double]* %3, i64 0, i64 %107
%109 = load double, double* %108
%110 = fmul double %109, 5.000000e-01
store double %110, double* %108
%111 = load i32, i32* %2
%112 = getelementptr inbounds [8193 x double], [8193 x double]* %3, i64 0, i64 0
%113 = call i32 @dfct(i32 %111, double* %112)
%114 = load i32, i32* %2
%115 = load i32, i32* %2
%116 = sitofp i32 %115 to double
%117 = fdiv double 2.000000e+00, %116
%118 = getelementptr inbounds [8193 x double], [8193 x double]* %3, i64 0, i64 0
%119 = call double @errorcheck(i32 0, i32 %114, double %117, double* %118)
store double %119, double* %4
%120 = load double, double* %4
%121 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), double %120)
%122 = load i32, i32* %2
%123 = sub nsw i32 %122, 1
%124 = getelementptr inbounds [8193 x double], [8193 x double]* %3, i64 0, i64 0
%125 = call i32 @putdata(i32 1, i32 %123, double* %124)
%126 = load i32, i32* %2
%127 = getelementptr inbounds [8193 x double], [8193 x double]* %3, i64 0, i64 0
%128 = call i32 @dfst(i32 %126, double* %127)
%129 = load i32, i32* %2
%130 = getelementptr inbounds [8193 x double], [8193 x double]* %3, i64 0, i64 0
%131 = call i32 @dfst(i32 %129, double* %130)
%132 = load i32, i32* %2
%133 = sub nsw i32 %132, 1
%134 = load i32, i32* %2
%135 = sitofp i32 %134 to double
%136 = fdiv double 2.000000e+00, %135
%137 = getelementptr inbounds [8193 x double], [8193 x double]* %3, i64 0, i64 0
%138 = call double @errorcheck(i32 1, i32 %133, double %136, double* %137)
store double %138, double* %4
%139 = load double, double* %4
%140 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), double %139)
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 [8193 x double]
%3 = bitcast i32* %1 to i8*
%4 = bitcast [8193 x double]* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = add nsw i32 %7, -1
%9 = getelementptr inbounds [8193 x double], [8193 x double]* %2, i64 0, i64 0
%10 = call i32 @putdata(i32 0, i32 %8, double* %9)
%11 = load i32, i32* %1
%12 = call i32 @cdft(i32 %11, i32 1, double* %9)
%13 = load i32, i32* %1
%14 = call i32 @cdft(i32 %13, i32 -1, double* %9)
%15 = load i32, i32* %1
%16 = add nsw i32 %15, -1
%17 = sitofp i32 %15 to double
%18 = fdiv double 2.000000e+00, %17
%19 = call double @errorcheck(i32 0, i32 %16, double %18, double* %9)
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double %19)
%21 = load i32, i32* %1
%22 = add nsw i32 %21, -1
%23 = call i32 @putdata(i32 0, i32 %22, double* %9)
%24 = load i32, i32* %1
%25 = call i32 @rdft(i32 %24, i32 1, double* %9)
%26 = load i32, i32* %1
%27 = call i32 @rdft(i32 %26, i32 -1, double* %9)
%28 = load i32, i32* %1
%29 = add nsw i32 %28, -1
%30 = sitofp i32 %28 to double
%31 = fdiv double 2.000000e+00, %30
%32 = call double @errorcheck(i32 0, i32 %29, double %31, double* %9)
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), double %32)
%34 = load i32, i32* %1
%35 = add nsw i32 %34, -1
%36 = call i32 @putdata(i32 0, i32 %35, double* %9)
%37 = load i32, i32* %1
%38 = call i32 @ddct(i32 %37, i32 1, double* %9)
%39 = load i32, i32* %1
%40 = call i32 @ddct(i32 %39, i32 -1, double* %9)
%41 = load double, double* %9
%42 = fmul double %41, 5.000000e-01
store double %42, double* %9
%43 = load i32, i32* %1
%44 = add nsw i32 %43, -1
%45 = sitofp i32 %43 to double
%46 = fdiv double 2.000000e+00, %45
%47 = call double @errorcheck(i32 0, i32 %44, double %46, double* %9)
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), double %47)
%49 = load i32, i32* %1
%50 = add nsw i32 %49, -1
%51 = call i32 @putdata(i32 0, i32 %50, double* %9)
%52 = load i32, i32* %1
%53 = call i32 @ddst(i32 %52, i32 1, double* %9)
%54 = load i32, i32* %1
%55 = call i32 @ddst(i32 %54, i32 -1, double* %9)
%56 = load double, double* %9
%57 = fmul double %56, 5.000000e-01
store double %57, double* %9
%58 = load i32, i32* %1
%59 = add nsw i32 %58, -1
%60 = sitofp i32 %58 to double
%61 = fdiv double 2.000000e+00, %60
%62 = call double @errorcheck(i32 0, i32 %59, double %61, double* %9)
%63 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), double %62)
%64 = load i32, i32* %1
%65 = call i32 @putdata(i32 0, i32 %64, double* %9)
%66 = load double, double* %9
%67 = fmul double %66, 5.000000e-01
store double %67, double* %9
%68 = load i32, i32* %1
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds [8193 x double], [8193 x double]* %2, i64 0, i64 %69
%71 = load double, double* %70
%72 = fmul double %71, 5.000000e-01
store double %72, double* %70
%73 = call i32 @dfct(i32 %68, double* %9)
%74 = load double, double* %9
%75 = fmul double %74, 5.000000e-01
store double %75, double* %9
%76 = load i32, i32* %1
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds [8193 x double], [8193 x double]* %2, i64 0, i64 %77
%79 = load double, double* %78
%80 = fmul double %79, 5.000000e-01
store double %80, double* %78
%81 = call i32 @dfct(i32 %76, double* %9)
%82 = load i32, i32* %1
%83 = sitofp i32 %82 to double
%84 = fdiv double 2.000000e+00, %83
%85 = call double @errorcheck(i32 0, i32 %82, double %84, double* %9)
%86 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), double %85)
%87 = load i32, i32* %1
%88 = add nsw i32 %87, -1
%89 = call i32 @putdata(i32 1, i32 %88, double* %9)
%90 = load i32, i32* %1
%91 = call i32 @dfst(i32 %90, double* %9)
%92 = load i32, i32* %1
%93 = call i32 @dfst(i32 %92, double* %9)
%94 = load i32, i32* %1
%95 = add nsw i32 %94, -1
%96 = sitofp i32 %94 to double
%97 = fdiv double 2.000000e+00, %96
%98 = call double @errorcheck(i32 1, i32 %95, double %97, double* %9)
%99 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), double %98)
ret i32 0
}