#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*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
void prntft(float data[], unsigned long nn) {
  unsigned long n;
  printf("%4s %13s %13s %12s %13s\n", "n", "real(n)", "imag.(n)", "real(N-n)",
         "imag.(N-n)");
  printf("   0 %14.6f %12.6f %12.6f %12.6f\n", data[1], data[2], data[1],
         data[2]);
  for (n = 3; n <= nn + 1; n += 2) {
    printf("%4lu %14.6f %12.6f %12.6f %12.6f\n", ((n - 1) / 2), data[n],
           data[n + 1], data[2 * nn + 2 - n], data[2 * nn + 3 - n]);
  }
  printf(" press return to continue ...\n");
  (void)getchar();
  return;
}


x86 assembly (clang, -O0):
<prntft>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
lea    0xedb(%rip),%rsi
lea    0xed6(%rip),%rdx
lea    0xed7(%rip),%rcx
lea    0xed9(%rip),%r8
lea    0xedc(%rip),%r9
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm1
cvtss2sd %xmm1,%xmm1
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm2
cvtss2sd %xmm2,%xmm2
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm3
cvtss2sd %xmm3,%xmm3
lea    0xea5(%rip),%rdi
mov    $0x4,%al
call   1030 <printf@plt>
movq   $0x3,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
add    $0x1,%rcx
cmp    %rcx,%rax
ja     1248 <prntft+0x128>
mov    -0x18(%rbp),%rsi
sub    $0x1,%rsi
shr    $0x1,%rsi
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movss  0x4(%rax,%rcx,4),%xmm1
cvtss2sd %xmm1,%xmm1
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x1,%rcx
add    $0x2,%rcx
sub    -0x18(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm2
cvtss2sd %xmm2,%xmm2
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x1,%rcx
add    $0x3,%rcx
sub    -0x18(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm3
cvtss2sd %xmm3,%xmm3
lea    0xe33(%rip),%rdi
mov    $0x4,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x18(%rbp)
jmp    11ab <prntft+0x8b>
lea    0xe36(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prntft>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r12
lea    0xeba(%rip),%rdi
lea    0xecc(%rip),%rsi
lea    0xec7(%rip),%rdx
lea    0xec8(%rip),%rcx
lea    0xeca(%rip),%r8
lea    0xecd(%rip),%r9
xor    %eax,%eax
call   1040 <printf@plt>
movss  0x4(%r12),%xmm0
movss  0x8(%r12),%xmm1
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
lea    0xeb4(%rip),%rdi
movaps %xmm0,%xmm2
movaps %xmm1,%xmm3
mov    $0x4,%al
call   1040 <printf@plt>
lea    0x1(%r14),%r15
cmp    $0x3,%r15
jb     120e <prntft+0xde>
lea    (%r12,%r14,8),%r13
mov    $0x2,%ebx
lea    0xeaf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rsi
shr    %rsi
movss  0x4(%r12,%rbx,4),%xmm0
movss  0x8(%r12,%rbx,4),%xmm1
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
movss  -0x4(%r13),%xmm2
movss  0x0(%r13),%xmm3
cvtss2sd %xmm2,%xmm2
cvtss2sd %xmm3,%xmm3
mov    %r14,%rdi
mov    $0x4,%al
call   1040 <printf@plt>
add    $0xfffffffffffffff8,%r13
lea    0x2(%rbx),%rax
add    $0x3,%rbx
cmp    %r15,%rbx
mov    %rax,%rbx
jbe    11c0 <prntft+0x90>
lea    0xe70(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1050 <getchar@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"%4s %13s %13s %12s %13s\0A\00"
@.str.1 = [2 x i8] c"n\00"
@.str.2 = [8 x i8] c"real(n)\00"
@.str.3 = [9 x i8] c"imag.(n)\00"
@.str.4 = [10 x i8] c"real(N-n)\00"
@.str.5 = [11 x i8] c"imag.(N-n)\00"
@.str.6 = [34 x i8] c" 0 %14.6f %12.6f %12.6f %12.6f\0A\00"
@.str.7 = [34 x i8] c"%4lu %14.6f %12.6f %12.6f %12.6f\0A\00"
@.str.8 = [31 x i8] c" press return to continue ...\0A\00"
define void @prntft(float* %0, i64 %1) {
%3 = alloca float*
%4 = alloca i64
%5 = alloca i64
store float* %0, float** %3
store i64 %1, i64* %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
%7 = load float*, float** %3
%8 = getelementptr inbounds float, float* %7, i64 1
%9 = load float, float* %8
%10 = fpext float %9 to double
%11 = load float*, float** %3
%12 = getelementptr inbounds float, float* %11, i64 2
%13 = load float, float* %12
%14 = fpext float %13 to double
%15 = load float*, float** %3
%16 = getelementptr inbounds float, float* %15, i64 1
%17 = load float, float* %16
%18 = fpext float %17 to double
%19 = load float*, float** %3
%20 = getelementptr inbounds float, float* %19, i64 2
%21 = load float, float* %20
%22 = fpext float %21 to double
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i64 0, i64 0), double %10, double %14, double %18, double %22)
store i64 3, i64* %5
br label %24
24: ; preds = %63, %2
%25 = load i64, i64* %5
%26 = load i64, i64* %4
%27 = add i64 %26, 1
%28 = icmp ule i64 %25, %27
br i1 %28, label %29, label %66
29: ; preds = %24
%30 = load i64, i64* %5
%31 = sub i64 %30, 1
%32 = udiv i64 %31, 2
%33 = load float*, float** %3
%34 = load i64, i64* %5
%35 = getelementptr inbounds float, float* %33, i64 %34
%36 = load float, float* %35
%37 = fpext float %36 to double
%38 = load float*, float** %3
%39 = load i64, i64* %5
%40 = add i64 %39, 1
%41 = getelementptr inbounds float, float* %38, i64 %40
%42 = load float, float* %41
%43 = fpext float %42 to double
%44 = load float*, float** %3
%45 = load i64, i64* %4
%46 = mul i64 2, %45
%47 = add i64 %46, 2
%48 = load i64, i64* %5
%49 = sub i64 %47, %48
%50 = getelementptr inbounds float, float* %44, i64 %49
%51 = load float, float* %50
%52 = fpext float %51 to double
%53 = load float*, float** %3
%54 = load i64, i64* %4
%55 = mul i64 2, %54
%56 = add i64 %55, 3
%57 = load i64, i64* %5
%58 = sub i64 %56, %57
%59 = getelementptr inbounds float, float* %53, i64 %58
%60 = load float, float* %59
%61 = fpext float %60 to double
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0), i64 %32, double %37, double %43, double %52, double %61)
br label %63
63: ; preds = %29
%64 = load i64, i64* %5
%65 = add i64 %64, 2
store i64 %65, i64* %5
br label %24
66: ; preds = %24
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.8, i64 0, i64 0))
%68 = call i32 (...) @getchar()
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"%4s %13s %13s %12s %13s\0A\00"
@.str.1 = [2 x i8] c"n\00"
@.str.2 = [8 x i8] c"real(n)\00"
@.str.3 = [9 x i8] c"imag.(n)\00"
@.str.4 = [10 x i8] c"real(N-n)\00"
@.str.5 = [11 x i8] c"imag.(N-n)\00"
@.str.6 = [34 x i8] c" 0 %14.6f %12.6f %12.6f %12.6f\0A\00"
@.str.7 = [34 x i8] c"%4lu %14.6f %12.6f %12.6f %12.6f\0A\00"
@str = [30 x i8] c" press return to continue ...\00"
define void @prntft(float* nocapture %0, i64 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
%4 = getelementptr inbounds float, float* %0, i64 1
%5 = load float, float* %4
%6 = fpext float %5 to double
%7 = getelementptr inbounds float, float* %0, i64 2
%8 = load float, float* %7
%9 = fpext float %8 to double
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i64 0, i64 0), double %6, double %9, double %6, double %9)
%11 = add i64 %1, 1
%12 = icmp ult i64 %11, 3
br i1 %12, label %41, label %13
13: ; preds = %2
%14 = shl i64 %1, 1
%15 = add i64 %14, 2
%16 = add i64 %14, 3
br label %17
17: ; preds = %13, %17
%18 = phi i64 [ -3, %13 ], [ %39, %17 ]
%19 = phi i64 [ 3, %13 ], [ %38, %17 ]
%20 = add nsw i64 %19, -1
%21 = lshr i64 %20, 1
%22 = getelementptr inbounds float, float* %0, i64 %19
%23 = load float, float* %22
%24 = fpext float %23 to double
%25 = add i64 %19, 1
%26 = getelementptr inbounds float, float* %0, i64 %25
%27 = load float, float* %26
%28 = fpext float %27 to double
%29 = add i64 %15, %18
%30 = getelementptr inbounds float, float* %0, i64 %29
%31 = load float, float* %30
%32 = fpext float %31 to double
%33 = add i64 %16, %18
%34 = getelementptr inbounds float, float* %0, i64 %33
%35 = load float, float* %34
%36 = fpext float %35 to double
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0), i64 %21, double %24, double %28, double %32, double %36)
%38 = add i64 %19, 2
%39 = sub i64 -2, %19
%40 = icmp ugt i64 %38, %11
br i1 %40, label %41, label %17
41: ; preds = %17, %2
%42 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%43 = tail call i32 (...) @getchar()
ret void
}