#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*/ butterflies();
int /*<<< orphan*/ decimate();
int /*<<< orphan*/ fillInput();
int /*<<< orphan*/ printSpectrum();
int /*<<< orphan*/ printf(char *, ...);
unsigned int time_ms();
void fft_bench() {
  unsigned int startTime, endTime;
  printf("fft_bench v1.0\n");
  fillInput();
  startTime = time_ms();
  decimate();
  butterflies();
  endTime = time_ms();
  printSpectrum();
  printf("1024 point bit-reversal and butterfly run time = %u ms\n",
         (endTime - startTime));
}


x86 assembly (clang, -O0):
<fft_bench>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x0,%al
call   1070 <fillInput@plt>
mov    $0x0,%al
call   1080 <time_ms@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <decimate@plt>
mov    $0x0,%al
call   1050 <butterflies@plt>
mov    $0x0,%al
call   1080 <time_ms@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <printSpectrum@plt>
mov    -0x8(%rbp),%esi
sub    -0x4(%rbp),%esi
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fft_bench>:
push   %rbp
push   %rbx
push   %rax
lea    0xebe(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1080 <fillInput@plt>
xor    %eax,%eax
call   1090 <time_ms@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <decimate@plt>
xor    %eax,%eax
call   1060 <butterflies@plt>
xor    %eax,%eax
call   1090 <time_ms@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1050 <printSpectrum@plt>
sub    %ebx,%ebp
lea    0xe4a(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1070 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"fft_bench v1.0\0A\00"
@.str.1 = [56 x i8] c"1024 point bit-reversal and butterfly run time = %u ms\0A\00"
define void @fft_bench() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @fillInput()
%5 = call i32 (...) @time_ms()
store i32 %5, i32* %1
%6 = call i32 (...) @decimate()
%7 = call i32 (...) @butterflies()
%8 = call i32 (...) @time_ms()
store i32 %8, i32* %2
%9 = call i32 (...) @printSpectrum()
%10 = load i32, i32* %2
%11 = load i32, i32* %1
%12 = sub i32 %10, %11
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0), i32 %12)
ret void
}

LLVM IR (-O2):
@.str.1 = [56 x i8] c"1024 point bit-reversal and butterfly run time = %u ms\0A\00"
@str = [15 x i8] c"fft_bench v1.0\00"
define void @fft_bench() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @fillInput()
%3 = tail call i32 (...) @time_ms()
%4 = tail call i32 (...) @decimate()
%5 = tail call i32 (...) @butterflies()
%6 = tail call i32 (...) @time_ms()
%7 = tail call i32 (...) @printSpectrum()
%8 = sub i32 %6, %3
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret void
}