#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*/ printf(char *, double, double);
int /*<<< orphan*/ rick_f90_realft(double *, int *, int *);
int /*<<< orphan*/ rick_realft_nr(double *, int, int);
int main(void) {
  int i, n, m;
  double x[3 * 5], y[3 * 5];
  n = 5;
  m = 2 * n + 2;
  for (i = 0; i < 3 * 5; i++) {
    x[i] = y[i] = i;
  }
  i = 1;
  rick_realft_nr((x - 1), n, i);
  rick_f90_realft(y, &n, &i);
  for (i = 0; i < m; i++)
    printf("%11g %11g\n", x[i], y[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
add    $0x2,%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xf,-0x8(%rbp)
jge    1193 <main+0x63>
cvtsi2sdl -0x8(%rbp),%xmm0
movslq -0x8(%rbp),%rax
movsd  %xmm0,-0x110(%rbp,%rax,8)
ff ff
movslq -0x8(%rbp),%rax
movsd  %xmm0,-0x90(%rbp,%rax,8)
ff ff
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115c <main+0x2c>
movl   $0x1,-0x8(%rbp)
lea    -0x90(%rbp),%rdi
add    $0xfffffffffffffff8,%rdi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1050 <rick_realft_nr@plt>
lea    -0x110(%rbp),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1030 <rick_f90_realft@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    120b <main+0xdb>
movslq -0x8(%rbp),%rax
movsd  -0x90(%rbp,%rax,8),%xmm0
ff ff
movslq -0x8(%rbp),%rax
movsd  -0x110(%rbp,%rax,8),%xmm1
ff ff
lea    0xe08(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11cb <main+0x9b>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x110,%rsp
movl   $0x5,0xc(%rsp)
xorps  %xmm0,%xmm0
movhps 0xeb6(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,0x90(%rsp)
movaps 0xeb2(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps 0xeae(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps 0xeaa(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps 0xea6(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps 0xea2(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps 0xe9e(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0xf0(%rsp)
movabs $0x402c000000000000,%rax
mov    %rax,0x80(%rsp)
mov    %rax,0x100(%rsp)
movl   $0x1,0x8(%rsp)
lea    0x88(%rsp),%rdi
mov    $0x5,%esi
mov    $0x1,%edx
call   1050 <rick_realft_nr@plt>
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1030 <rick_f90_realft@plt>
movl   $0x0,0x8(%rsp)
xor    %eax,%eax
lea    0xe43(%rip),%rbx
nopl   (%rax)
cltq
movsd  0x90(%rsp,%rax,8),%xmm0
movsd  0x10(%rsp,%rax,8),%xmm1
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x8(%rsp),%ecx
lea    0x1(%rcx),%eax
mov    %eax,0x8(%rsp)
cmp    $0xb,%ecx
jl     1230 <main+0x100>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%11g %11g\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [15 x double]
%6 = alloca [15 x double]
store i32 0, i32* %1
store i32 5, i32* %3
%7 = load i32, i32* %3
%8 = mul nsw i32 2, %7
%9 = add nsw i32 %8, 2
store i32 %9, i32* %4
store i32 0, i32* %2
br label %10
10: ; preds = %22, %0
%11 = load i32, i32* %2
%12 = icmp slt i32 %11, 15
br i1 %12, label %13, label %25
13: ; preds = %10
%14 = load i32, i32* %2
%15 = sitofp i32 %14 to double
%16 = load i32, i32* %2
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [15 x double], [15 x double]* %6, i64 0, i64 %17
store double %15, double* %18
%19 = load i32, i32* %2
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [15 x double], [15 x double]* %5, i64 0, i64 %20
store double %15, double* %21
br label %22
22: ; preds = %13
%23 = load i32, i32* %2
%24 = add nsw i32 %23, 1
store i32 %24, i32* %2
br label %10
25: ; preds = %10
store i32 1, i32* %2
%26 = getelementptr inbounds [15 x double], [15 x double]* %5, i64 0, i64 0
%27 = getelementptr inbounds double, double* %26, i64 -1
%28 = load i32, i32* %3
%29 = load i32, i32* %2
%30 = call i32 @rick_realft_nr(double* %27, i32 %28, i32 %29)
%31 = getelementptr inbounds [15 x double], [15 x double]* %6, i64 0, i64 0
%32 = call i32 @rick_f90_realft(double* %31, i32* %3, i32* %2)
store i32 0, i32* %2
br label %33
33: ; preds = %47, %25
%34 = load i32, i32* %2
%35 = load i32, i32* %4
%36 = icmp slt i32 %34, %35
br i1 %36, label %37, label %50
37: ; preds = %33
%38 = load i32, i32* %2
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [15 x double], [15 x double]* %5, i64 0, i64 %39
%41 = load double, double* %40
%42 = load i32, i32* %2
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [15 x double], [15 x double]* %6, i64 0, i64 %43
%45 = load double, double* %44
%46 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), double %41, double %45)
br label %47
47: ; preds = %37
%48 = load i32, i32* %2
%49 = add nsw i32 %48, 1
store i32 %49, i32* %2
br label %33
50: ; preds = %33
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"%11g %11g\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [15 x double]
%4 = alloca [15 x double]
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast [15 x double]* %3 to i8*
%8 = bitcast [15 x double]* %4 to i8*
store i32 5, i32* %2
%9 = getelementptr inbounds [15 x double], [15 x double]* %4, i64 0, i64 0
%10 = bitcast [15 x double]* %4 to <2 x double>*
store <2 x double> <double 0.000000e+00, double 1.000000e+00>, <2 x double>* %10
%11 = bitcast [15 x double]* %3 to <2 x double>*
store <2 x double> <double 0.000000e+00, double 1.000000e+00>, <2 x double>* %11
%12 = getelementptr inbounds [15 x double], [15 x double]* %4, i64 0, i64 2
%13 = getelementptr inbounds [15 x double], [15 x double]* %3, i64 0, i64 2
%14 = bitcast double* %12 to <2 x double>*
store <2 x double> <double 2.000000e+00, double 3.000000e+00>, <2 x double>* %14
%15 = bitcast double* %13 to <2 x double>*
store <2 x double> <double 2.000000e+00, double 3.000000e+00>, <2 x double>* %15
%16 = getelementptr inbounds [15 x double], [15 x double]* %4, i64 0, i64 4
%17 = getelementptr inbounds [15 x double], [15 x double]* %3, i64 0, i64 4
%18 = bitcast double* %16 to <2 x double>*
store <2 x double> <double 4.000000e+00, double 5.000000e+00>, <2 x double>* %18
%19 = bitcast double* %17 to <2 x double>*
store <2 x double> <double 4.000000e+00, double 5.000000e+00>, <2 x double>* %19
%20 = getelementptr inbounds [15 x double], [15 x double]* %4, i64 0, i64 6
%21 = getelementptr inbounds [15 x double], [15 x double]* %3, i64 0, i64 6
%22 = bitcast double* %20 to <2 x double>*
store <2 x double> <double 6.000000e+00, double 7.000000e+00>, <2 x double>* %22
%23 = bitcast double* %21 to <2 x double>*
store <2 x double> <double 6.000000e+00, double 7.000000e+00>, <2 x double>* %23
%24 = getelementptr inbounds [15 x double], [15 x double]* %4, i64 0, i64 8
%25 = getelementptr inbounds [15 x double], [15 x double]* %3, i64 0, i64 8
%26 = bitcast double* %24 to <2 x double>*
store <2 x double> <double 8.000000e+00, double 9.000000e+00>, <2 x double>* %26
%27 = bitcast double* %25 to <2 x double>*
store <2 x double> <double 8.000000e+00, double 9.000000e+00>, <2 x double>* %27
%28 = getelementptr inbounds [15 x double], [15 x double]* %4, i64 0, i64 10
%29 = getelementptr inbounds [15 x double], [15 x double]* %3, i64 0, i64 10
%30 = bitcast double* %28 to <2 x double>*
store <2 x double> <double 1.000000e+01, double 1.100000e+01>, <2 x double>* %30
%31 = bitcast double* %29 to <2 x double>*
store <2 x double> <double 1.000000e+01, double 1.100000e+01>, <2 x double>* %31
%32 = getelementptr inbounds [15 x double], [15 x double]* %4, i64 0, i64 12
%33 = getelementptr inbounds [15 x double], [15 x double]* %3, i64 0, i64 12
%34 = bitcast double* %32 to <2 x double>*
store <2 x double> <double 1.200000e+01, double 1.300000e+01>, <2 x double>* %34
%35 = bitcast double* %33 to <2 x double>*
store <2 x double> <double 1.200000e+01, double 1.300000e+01>, <2 x double>* %35
%36 = getelementptr inbounds [15 x double], [15 x double]* %4, i64 0, i64 14
store double 1.400000e+01, double* %36
%37 = getelementptr inbounds [15 x double], [15 x double]* %3, i64 0, i64 14
store double 1.400000e+01, double* %37
store i32 1, i32* %1
%38 = getelementptr inbounds [15 x double], [15 x double]* %3, i64 0, i64 -1
%39 = call i32 @rick_realft_nr(double* %38, i32 5, i32 1)
%40 = call i32 @rick_f90_realft(double* %9, i32* %2, i32* %1)
store i32 0, i32* %1
br label %41
41: ; preds = %0, %41
%42 = phi i32 [ 0, %0 ], [ %50, %41 ]
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [15 x double], [15 x double]* %3, i64 0, i64 %43
%45 = load double, double* %44
%46 = getelementptr inbounds [15 x double], [15 x double]* %4, i64 0, i64 %43
%47 = load double, double* %46
%48 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), double %45, double %47)
%49 = load i32, i32* %1
%50 = add nsw i32 %49, 1
store i32 %50, i32* %1
%51 = icmp slt i32 %49, 11
br i1 %51, label %41, label %52
52: ; preds = %41
ret i32 0
}