#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 *, float, float);
void main() {
  float x;
  for (x = 0.0; x <= 6.5; x += 0.5) {
    printf("f(%.1f) = %6.2f\n", x, (x * x + 2 * x - 1));
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xecf(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     119a <main+0x8a>
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
movss  -0x4(%rbp),%xmm3
movss  0xec2(%rip),%xmm2
mulss  -0x4(%rbp),%xmm2
mulss  %xmm3,%xmm1
addss  %xmm2,%xmm1
movss  0xea9(%rip),%xmm2
subss  %xmm2,%xmm1
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe80(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1120 <main+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xf50(%rip),%rbx
movss  0xee0(%rip),%xmm1
xorps  %xmm0,%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movss  0xed1(%rip),%xmm0
movss  0xecd(%rip),%xmm1
mov    %rbx,%rdi
call   1030 <printf@plt>
movss  0xec1(%rip),%xmm0
movss  0xebd(%rip),%xmm1
mov    %rbx,%rdi
call   1030 <printf@plt>
movss  0xeb1(%rip),%xmm0
movss  0xead(%rip),%xmm1
mov    %rbx,%rdi
call   1030 <printf@plt>
movss  0xea1(%rip),%xmm1
mov    %rbx,%rdi
movss  0xe8a(%rip),%xmm0
call   1030 <printf@plt>
movss  0xe8d(%rip),%xmm0
movss  0xe89(%rip),%xmm1
mov    %rbx,%rdi
call   1030 <printf@plt>
movss  0xe7d(%rip),%xmm0
movss  0xe79(%rip),%xmm1
mov    %rbx,%rdi
call   1030 <printf@plt>
movss  0xe6d(%rip),%xmm0
movss  0xe69(%rip),%xmm1
mov    %rbx,%rdi
call   1030 <printf@plt>
movss  0xe5d(%rip),%xmm0
movss  0xe59(%rip),%xmm1
mov    %rbx,%rdi
call   1030 <printf@plt>
movss  0xe4d(%rip),%xmm0
movss  0xe49(%rip),%xmm1
mov    %rbx,%rdi
call   1030 <printf@plt>
movss  0xe3d(%rip),%xmm0
movss  0xe39(%rip),%xmm1
mov    %rbx,%rdi
call   1030 <printf@plt>
movss  0xe2d(%rip),%xmm0
movss  0xe29(%rip),%xmm1
mov    %rbx,%rdi
call   1030 <printf@plt>
movss  0xe1d(%rip),%xmm0
movss  0xe19(%rip),%xmm1
mov    %rbx,%rdi
call   1030 <printf@plt>
movss  0xe0d(%rip),%xmm0
movss  0xe09(%rip),%xmm1
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"f(%.1f) = %6.2f\0A\00"
define void @main() {
%1 = alloca float
store float 0.000000e+00, float* %1
br label %2
2: ; preds = %15, %0
%3 = load float, float* %1
%4 = fpext float %3 to double
%5 = fcmp ole double %4, 6.500000e+00
br i1 %5, label %6, label %20
6: ; preds = %2
%7 = load float, float* %1
%8 = load float, float* %1
%9 = load float, float* %1
%10 = load float, float* %1
%11 = fmul float 2.000000e+00, %10
%12 = call float @llvm.fmuladd.f32(float %8, float %9, float %11)
%13 = fsub float %12, 1.000000e+00
%14 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), float %7, float %13)
br label %15
15: ; preds = %6
%16 = load float, float* %1
%17 = fpext float %16 to double
%18 = fadd double %17, 5.000000e-01
%19 = fptrunc double %18 to float
store float %19, float* %1
br label %2
20: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"f(%.1f) = %6.2f\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), float 0.000000e+00, float -1.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), float 5.000000e-01, float 2.500000e-01)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), float 1.000000e+00, float 2.000000e+00)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), float 1.500000e+00, float 4.250000e+00)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), float 2.000000e+00, float 7.000000e+00)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), float 2.500000e+00, float 1.025000e+01)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), float 3.000000e+00, float 1.400000e+01)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), float 3.500000e+00, float 1.825000e+01)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), float 4.000000e+00, float 2.300000e+01)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), float 4.500000e+00, float 2.825000e+01)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), float 5.000000e+00, float 3.400000e+01)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), float 5.500000e+00, float 4.025000e+01)
%13 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), float 6.000000e+00, float 4.700000e+01)
%14 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), float 6.500000e+00, float 5.425000e+01)
ret void
}