#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*/ DFT(int, float *, float *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int i = 0;
  printf("Hello world!\n");
  float x[512];
  float y[512];
  for (i = 0; i < 512; i++)
    x[i] = 0;
  for (i = 0; i < 512; i++)
    y[i] = 0;
  x[5] = 1;
  for (i = 0; i < 512; i++)
    printf("%.1f ", x[i]);
  printf("\n\n");
  for (i = 0; i < 512; i++)
    printf("%.2f ", y[i]);
  printf("\n\n\n");
  DFT(-1, x, y);
  for (i = 0; i < 512; i++)
    printf("%.2f ", x[i]);
  printf("\n\n");
  for (i = 0; i < 512; i++)
    printf("%f ", y[i]);
  printf("\n\n\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1010,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x200,-0x8(%rbp)
jge    1179 <main+0x59>
movslq -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,-0x810(%rbp,%rax,4)
ff ff
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114e <main+0x2e>
movl   $0x0,-0x8(%rbp)
cmpl   $0x200,-0x8(%rbp)
jge    11ab <main+0x8b>
movslq -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,-0x1010(%rbp,%rax,4)
ff ff
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1180 <main+0x60>
movss  0xe4d(%rip),%xmm0
movss  %xmm0,-0x7fc(%rbp)
ff
movl   $0x0,-0x8(%rbp)
cmpl   $0x200,-0x8(%rbp)
jge    11fc <main+0xdc>
movslq -0x8(%rbp),%rax
movss  -0x810(%rbp,%rax,4),%xmm0
ff ff
cvtss2sd %xmm0,%xmm0
lea    0xe2b(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11c2 <main+0xa2>
lea    0xe1c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x200,-0x8(%rbp)
jge    124b <main+0x12b>
movslq -0x8(%rbp),%rax
movss  -0x1010(%rbp,%rax,4),%xmm0
ff ff
cvtss2sd %xmm0,%xmm0
lea    0xde2(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1211 <main+0xf1>
lea    0xdcc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x810(%rbp),%rsi
lea    -0x1010(%rbp),%rdx
mov    $0xffffffff,%edi
call   1040 <DFT@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x200,-0x8(%rbp)
jge    12b2 <main+0x192>
movslq -0x8(%rbp),%rax
movss  -0x810(%rbp,%rax,4),%xmm0
ff ff
cvtss2sd %xmm0,%xmm0
lea    0xd7b(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1278 <main+0x158>
lea    0xd66(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x200,-0x8(%rbp)
jge    1301 <main+0x1e1>
movslq -0x8(%rbp),%rax
movss  -0x1010(%rbp,%rax,4),%xmm0
ff ff
cvtss2sd %xmm0,%xmm0
lea    0xd36(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12c7 <main+0x1a7>
lea    0xd16(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x1010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x1008,%rsp
lea    0xebf(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rdi
mov    $0x800,%edx
xor    %esi,%esi
call   1060 <memset@plt>
lea    0x800(%rsp),%rdi
mov    $0x800,%edx
xor    %esi,%esi
call   1060 <memset@plt>
movl   $0x3f800000,0x14(%rsp)
3f
lea    0xe78(%rip),%r14
xorps  %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
movss  (%rsp,%rbx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    $0x200,%rbx
jne    11a0 <main+0x60>
lea    0xe57(%rip),%rdi
call   1030 <puts@plt>
lea    0xe33(%rip),%r14
xorps  %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
movss  0x800(%rsp,%rbx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    $0x200,%rbx
jne    11f0 <main+0xb0>
lea    0xe02(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rsi
lea    0x800(%rsp),%rdx
mov    $0xffffffff,%edi
call   1050 <DFT@plt>
xor    %ebx,%ebx
lea    0xdc8(%rip),%r14
xchg   %ax,%ax
movss  (%rsp,%rbx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    $0x200,%rbx
jne    1240 <main+0x100>
lea    0xdb7(%rip),%rdi
call   1030 <puts@plt>
xor    %ebx,%ebx
lea    0xd97(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
movss  0x800(%rsp,%rbx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    $0x200,%rbx
jne    1280 <main+0x140>
lea    0xd72(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x1008,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello world!\0A\00"
@.str.1 = [6 x i8] c"%.1f \00"
@.str.2 = [3 x i8] c"\0A\0A\00"
@.str.3 = [6 x i8] c"%.2f \00"
@.str.4 = [4 x i8] c"\0A\0A\0A\00"
@.str.5 = [4 x i8] c"%f \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [512 x float]
%4 = alloca [512 x float]
store i32 0, i32* %1
store i32 0, i32* %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %6
6: ; preds = %13, %0
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 512
br i1 %8, label %9, label %16
9: ; preds = %6
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [512 x float], [512 x float]* %3, i64 0, i64 %11
store float 0.000000e+00, float* %12
br label %13
13: ; preds = %9
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %6
16: ; preds = %6
store i32 0, i32* %2
br label %17
17: ; preds = %24, %16
%18 = load i32, i32* %2
%19 = icmp slt i32 %18, 512
br i1 %19, label %20, label %27
20: ; preds = %17
%21 = load i32, i32* %2
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [512 x float], [512 x float]* %4, i64 0, i64 %22
store float 0.000000e+00, float* %23
br label %24
24: ; preds = %20
%25 = load i32, i32* %2
%26 = add nsw i32 %25, 1
store i32 %26, i32* %2
br label %17
27: ; preds = %17
%28 = getelementptr inbounds [512 x float], [512 x float]* %3, i64 0, i64 5
store float 1.000000e+00, float* %28
store i32 0, i32* %2
br label %29
29: ; preds = %39, %27
%30 = load i32, i32* %2
%31 = icmp slt i32 %30, 512
br i1 %31, label %32, label %42
32: ; preds = %29
%33 = load i32, i32* %2
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [512 x float], [512 x float]* %3, i64 0, i64 %34
%36 = load float, float* %35
%37 = fpext float %36 to double
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %37)
br label %39
39: ; preds = %32
%40 = load i32, i32* %2
%41 = add nsw i32 %40, 1
store i32 %41, i32* %2
br label %29
42: ; preds = %29
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %2
br label %44
44: ; preds = %54, %42
%45 = load i32, i32* %2
%46 = icmp slt i32 %45, 512
br i1 %46, label %47, label %57
47: ; preds = %44
%48 = load i32, i32* %2
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [512 x float], [512 x float]* %4, i64 0, i64 %49
%51 = load float, float* %50
%52 = fpext float %51 to double
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %52)
br label %54
54: ; preds = %47
%55 = load i32, i32* %2
%56 = add nsw i32 %55, 1
store i32 %56, i32* %2
br label %44
57: ; preds = %44
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%59 = getelementptr inbounds [512 x float], [512 x float]* %3, i64 0, i64 0
%60 = getelementptr inbounds [512 x float], [512 x float]* %4, i64 0, i64 0
%61 = call i32 @DFT(i32 -1, float* %59, float* %60)
store i32 0, i32* %2
br label %62
62: ; preds = %72, %57
%63 = load i32, i32* %2
%64 = icmp slt i32 %63, 512
br i1 %64, label %65, label %75
65: ; preds = %62
%66 = load i32, i32* %2
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds [512 x float], [512 x float]* %3, i64 0, i64 %67
%69 = load float, float* %68
%70 = fpext float %69 to double
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %70)
br label %72
72: ; preds = %65
%73 = load i32, i32* %2
%74 = add nsw i32 %73, 1
store i32 %74, i32* %2
br label %62
75: ; preds = %62
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %2
br label %77
77: ; preds = %87, %75
%78 = load i32, i32* %2
%79 = icmp slt i32 %78, 512
br i1 %79, label %80, label %90
80: ; preds = %77
%81 = load i32, i32* %2
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds [512 x float], [512 x float]* %4, i64 0, i64 %82
%84 = load float, float* %83
%85 = fpext float %84 to double
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %85)
br label %87
87: ; preds = %80
%88 = load i32, i32* %2
%89 = add nsw i32 %88, 1
store i32 %89, i32* %2
br label %77
90: ; preds = %77
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"%.1f \00"
@.str.3 = [6 x i8] c"%.2f \00"
@.str.5 = [4 x i8] c"%f \00"
@str = [13 x i8] c"Hello world!\00"
@str.8 = [2 x i8] c"\0A\00"
@str.9 = [3 x i8] c"\0A\0A\00"
define i32 @main() {
%1 = alloca [512 x float]
%2 = bitcast [512 x float]* %1 to i8*
%3 = alloca [512 x float]
%4 = bitcast [512 x float]* %3 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%6 = getelementptr inbounds [512 x float], [512 x float]* %1, i64 0, i64 5
store float 1.000000e+00, float* %6
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double 0.000000e+00)
br label %8
8: ; preds = %0, %8
%9 = phi i64 [ 1, %0 ], [ %14, %8 ]
%10 = getelementptr inbounds [512 x float], [512 x float]* %1, i64 0, i64 %9
%11 = load float, float* %10
%12 = fpext float %11 to double
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %12)
%14 = add nuw nsw i64 %9, 1
%15 = icmp eq i64 %14, 512
br i1 %15, label %16, label %8
16: ; preds = %8
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.8, i64 0, i64 0))
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double 0.000000e+00)
br label %19
19: ; preds = %16, %19
%20 = phi i64 [ 1, %16 ], [ %25, %19 ]
%21 = getelementptr inbounds [512 x float], [512 x float]* %3, i64 0, i64 %20
%22 = load float, float* %21
%23 = fpext float %22 to double
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %23)
%25 = add nuw nsw i64 %20, 1
%26 = icmp eq i64 %25, 512
br i1 %26, label %27, label %19
27: ; preds = %19
%28 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.9, i64 0, i64 0))
%29 = getelementptr inbounds [512 x float], [512 x float]* %1, i64 0, i64 0
%30 = getelementptr inbounds [512 x float], [512 x float]* %3, i64 0, i64 0
%31 = call i32 @DFT(i32 -1, float* %29, float* %30)
br label %32
32: ; preds = %27, %32
%33 = phi i64 [ 0, %27 ], [ %38, %32 ]
%34 = getelementptr inbounds [512 x float], [512 x float]* %1, i64 0, i64 %33
%35 = load float, float* %34
%36 = fpext float %35 to double
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %36)
%38 = add nuw nsw i64 %33, 1
%39 = icmp eq i64 %38, 512
br i1 %39, label %40, label %32
40: ; preds = %32
%41 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.8, i64 0, i64 0))
br label %42
42: ; preds = %40, %42
%43 = phi i64 [ 0, %40 ], [ %48, %42 ]
%44 = getelementptr inbounds [512 x float], [512 x float]* %3, i64 0, i64 %43
%45 = load float, float* %44
%46 = fpext float %45 to double
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %46)
%48 = add nuw nsw i64 %43, 1
%49 = icmp eq i64 %48, 512
br i1 %49, label %50, label %42
50: ; preds = %42
%51 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.9, i64 0, i64 0))
ret i32 0
}