#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 */
double FYX(float, float);
int /*<<< orphan*/ printf(char *, double);
main() {
  float f, x = -1, y = 0;
  while (x <= 1) {
    printf("x=%.3f  ", x);
    printf("y=%.3f  ", y);
    printf("f=%.3f\n\n", FYX(x, y));
    y += 0.100;
    if (y > 2.100) {
      y = 0;
      x += 0.25;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xec9(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xeb8(%rip),%xmm0
ucomiss -0xc(%rbp),%xmm0
jb     11ff <main+0xdf>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
call   1040 <FYX@plt>
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe64(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe3e(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11fa <main+0xda>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe2b(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1144 <main+0x24>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
movss  0xecf(%rip),%xmm0
xorps  %xmm2,%xmm2
lea    0xee5(%rip),%r14
lea    0xee7(%rip),%r15
lea    0xee9(%rip),%rbx
movaps %xmm0,%xmm1
jmp    1164 <main+0x44>
xchg   %ax,%ax
movss  0xeb0(%rip),%xmm0
ucomiss %xmm1,%xmm0
movaps %xmm1,%xmm0
jb     11fb <main+0xdb>
movss  %xmm2,0x10(%rsp)
movss  %xmm1,0x14(%rsp)
movss  %xmm0,0xc(%rsp)
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x18(%rsp)
mov    %r15,%rdi
call   1030 <printf@plt>
movss  0xc(%rsp),%xmm0
movss  0x10(%rsp),%xmm1
call   1040 <FYX@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0x18(%rsp),%xmm0
addsd  0xe4f(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
ucomisd 0xe44(%rip),%xmm1
movss  0x14(%rsp),%xmm1
addss  0xe22(%rip),%xmm1
ja     11ea <main+0xca>
movss  0xc(%rsp),%xmm1
xorps  %xmm2,%xmm2
ja     1150 <main+0x30>
movaps %xmm0,%xmm2
jmp    1150 <main+0x30>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [9 x i8] c"x=%.3f \00"
@.str.1 = [9 x i8] c"y=%.3f \00"
@.str.2 = [9 x i8] c"f=%.3f\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
store i32 0, i32* %1
store float -1.000000e+00, float* %3
store float 0.000000e+00, float* %4
br label %5
5: ; preds = %31, %0
%6 = load float, float* %3
%7 = fcmp ole float %6, 1.000000e+00
br i1 %7, label %8, label %32
8: ; preds = %5
%9 = load float, float* %3
%10 = fpext float %9 to double
%11 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double %10)
%12 = load float, float* %4
%13 = fpext float %12 to double
%14 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), double %13)
%15 = load float, float* %3
%16 = load float, float* %4
%17 = call double @FYX(float %15, float %16)
%18 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), double %17)
%19 = load float, float* %4
%20 = fpext float %19 to double
%21 = fadd double %20, 1.000000e-01
%22 = fptrunc double %21 to float
store float %22, float* %4
%23 = load float, float* %4
%24 = fpext float %23 to double
%25 = fcmp ogt double %24, 2.100000e+00
br i1 %25, label %26, label %31
26: ; preds = %8
store float 0.000000e+00, float* %4
%27 = load float, float* %3
%28 = fpext float %27 to double
%29 = fadd double %28, 2.500000e-01
%30 = fptrunc double %29 to float
store float %30, float* %3
br label %31
31: ; preds = %26, %8
br label %5
32: ; preds = %5
%33 = load i32, i32* %1
ret i32 %33
}

LLVM IR (-O2):
@.str = [9 x i8] c"x=%.3f \00"
@.str.1 = [9 x i8] c"y=%.3f \00"
@.str.2 = [9 x i8] c"f=%.3f\0A\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi float [ 0.000000e+00, %0 ], [ %16, %1 ]
%3 = phi float [ -1.000000e+00, %0 ], [ %15, %1 ]
%4 = fpext float %3 to double
%5 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double %4)
%6 = fpext float %2 to double
%7 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), double %6)
%8 = tail call double @FYX(float %3, float %2)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), double %8)
%10 = fadd double %6, 1.000000e-01
%11 = fptrunc double %10 to float
%12 = fpext float %11 to double
%13 = fcmp ogt double %12, 2.100000e+00
%14 = fadd float %3, 2.500000e-01
%15 = select i1 %13, float %14, float %3
%16 = select i1 %13, float 0.000000e+00, float %11
%17 = fcmp ugt float %15, 1.000000e+00
br i1 %17, label %18, label %1
18: ; preds = %1
ret i32 0
}