#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*/ getch();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ quickfwt(double *, int, int, double *);
main() {
  int i;
  double p[8], value[8];
  for (i = 0; i < 8; i++)
    p[i] = i + 1;
  quickfwt(p, 8, 3, value);
  printf("\n");
  for (i = 0; i < 8; i++) {
    printf("%5.2lf\n", value[i]);
  }
  printf("\n");
  getch();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    1175 <main+0x45>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
movslq -0x8(%rbp),%rax
movsd  %xmm0,-0x50(%rbp,%rax,8)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1149 <main+0x19>
lea    -0x50(%rbp),%rdi
lea    -0x90(%rbp),%rcx
mov    $0x8,%esi
mov    $0x3,%edx
call   1050 <quickfwt@plt>
lea    0xe70(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    11d7 <main+0xa7>
movslq -0x8(%rbp),%rax
movsd  -0x90(%rbp,%rax,8),%xmm0
ff ff
lea    0xe3e(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11a4 <main+0x74>
lea    0xe28(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getch@plt>
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x80,%rsp
movaps 0xeb1(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xeb5(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xeb9(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
lea    0x40(%rsp),%rdi
mov    %rsp,%rcx
mov    $0x8,%esi
mov    $0x3,%edx
call   1060 <quickfwt@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
movsd  (%rsp),%xmm0
lea    0xe9b(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x8(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x10(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x18(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x20(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x28(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x30(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x38(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <getch@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str.1 = [8 x i8] c"%5.2lf\0A\00"
define i32 @main() {
%1 = alloca [8 x double]
%2 = alloca [8 x double]
%3 = bitcast [8 x double]* %1 to i8*
%4 = bitcast [8 x double]* %2 to i8*
%5 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 0
%6 = bitcast [8 x double]* %1 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 2.000000e+00>, <2 x double>* %6
%7 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 2
%8 = bitcast double* %7 to <2 x double>*
store <2 x double> <double 3.000000e+00, double 4.000000e+00>, <2 x double>* %8
%9 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 4
%10 = bitcast double* %9 to <2 x double>*
store <2 x double> <double 5.000000e+00, double 6.000000e+00>, <2 x double>* %10
%11 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 6
%12 = bitcast double* %11 to <2 x double>*
store <2 x double> <double 7.000000e+00, double 8.000000e+00>, <2 x double>* %12
%13 = getelementptr inbounds [8 x double], [8 x double]* %2, i64 0, i64 0
%14 = call i32 @quickfwt(double* %5, i32 8, i32 3, double* %13)
%15 = call i32 @putchar(i32 10)
%16 = load double, double* %13
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %16)
%18 = getelementptr inbounds [8 x double], [8 x double]* %2, i64 0, i64 1
%19 = load double, double* %18
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %19)
%21 = getelementptr inbounds [8 x double], [8 x double]* %2, i64 0, i64 2
%22 = load double, double* %21
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %22)
%24 = getelementptr inbounds [8 x double], [8 x double]* %2, i64 0, i64 3
%25 = load double, double* %24
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %25)
%27 = getelementptr inbounds [8 x double], [8 x double]* %2, i64 0, i64 4
%28 = load double, double* %27
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %28)
%30 = getelementptr inbounds [8 x double], [8 x double]* %2, i64 0, i64 5
%31 = load double, double* %30
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %31)
%33 = getelementptr inbounds [8 x double], [8 x double]* %2, i64 0, i64 6
%34 = load double, double* %33
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %34)
%36 = getelementptr inbounds [8 x double], [8 x double]* %2, i64 0, i64 7
%37 = load double, double* %36
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %37)
%39 = call i32 @putchar(i32 10)
%40 = call i32 (...) @getch()
ret i32 0
}