main() {
  int i;
  float x, Fzero(), Fone();
  for (i = 0; i < 100; i++) {
    x = i;
    printf("%f %f %f\n", x, Fzero(x * x), Fone(x * x));
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    11c8 <main+0x98>
cvtsi2ssl -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    $0x1,%al
call   1040 <Fzero@plt>
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    $0x1,%al
call   1050 <Fone@plt>
movsd  -0x20(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x18(%rbp),%xmm0
cvtss2sd %xmm2,%xmm2
lea    0xe4d(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
xor    %ebp,%ebp
lea    0xec1(%rip),%rbx
nop
xorps  %xmm0,%xmm0
cvtsi2ss %ebp,%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
mulss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,(%rsp)
mov    $0x1,%al
call   1040 <Fzero@plt>
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
mov    $0x1,%al
call   1050 <Fone@plt>
xorps  %xmm2,%xmm2
cvtss2sd %xmm0,%xmm2
mov    %rbx,%rdi
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mov    $0x3,%al
call   1030 <printf@plt>
add    $0x1,%ebp
cmp    $0x64,%ebp
jne    1140 <main+0x10>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%f %f %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
store i32 0, i32* %1
store i32 0, i32* %2
br label %4
4: ; preds = %25, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 100
br i1 %6, label %7, label %28
7: ; preds = %4
%8 = load i32, i32* %2
%9 = sitofp i32 %8 to float
store float %9, float* %3
%10 = load float, float* %3
%11 = fpext float %10 to double
%12 = load float, float* %3
%13 = load float, float* %3
%14 = fmul float %12, %13
%15 = fpext float %14 to double
%16 = call float (double, ...) bitcast (float (...)* @Fzero to float (double, ...)*)(double %15)
%17 = fpext float %16 to double
%18 = load float, float* %3
%19 = load float, float* %3
%20 = fmul float %18, %19
%21 = fpext float %20 to double
%22 = call float (double, ...) bitcast (float (...)* @Fone to float (double, ...)*)(double %21)
%23 = fpext float %22 to double
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %11, double %17, double %23)
br label %25
25: ; preds = %7
%26 = load i32, i32* %2
%27 = add nsw i32 %26, 1
store i32 %27, i32* %2
br label %4
28: ; preds = %4
%29 = load i32, i32* %1
ret i32 %29
}

LLVM IR (-O2):
@.str = [10 x i8] c"%f %f %f\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %12, %1 ]
%3 = sitofp i32 %2 to float
%4 = fpext float %3 to double
%5 = fmul float %3, %3
%6 = fpext float %5 to double
%7 = tail call float (double, ...) bitcast (float (...)* @Fzero to float (double, ...)*)(double %6)
%8 = fpext float %7 to double
%9 = tail call float (double, ...) bitcast (float (...)* @Fone to float (double, ...)*)(double %6)
%10 = fpext float %9 to double
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %4, double %8, double %10)
%12 = add nuw nsw i32 %2, 1
%13 = icmp eq i32 %12, 100
br i1 %13, label %14, label %1
14: ; preds = %1
ret i32 0
}