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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xeb9(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     11f6 <main+0xd6>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
call   1030 <f@plt>
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
movss  0xe66(%rip),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    11cb <main+0xab>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe57(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    11f1 <main+0xd1>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe2c(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    113f <main+0x1f>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
xorps  %xmm0,%xmm0
lea    0xee5(%rip),%r14
lea    0xee5(%rip),%r15
lea    0xee5(%rip),%rbx
xorps  %xmm4,%xmm4
jmp    1172 <main+0x52>
cs nopw 0x0(%rax,%rax,1)
xorps  %xmm0,%xmm0
cmpltss %xmm2,%xmm3
andps  %xmm3,%xmm4
andnps %xmm1,%xmm3
orps   %xmm3,%xmm4
movss  0xe9f(%rip),%xmm1
ucomiss %xmm4,%xmm1
jb     11f2 <main+0xd2>
movaps %xmm4,0x20(%rsp)
movaps %xmm0,(%rsp)
xorps  %xmm0,%xmm0
cvtss2sd %xmm4,%xmm0
mov    %r14,%rdi
call   1040 <printf@plt>
movaps (%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x18(%rsp)
mov    %r15,%rdi
call   1040 <printf@plt>
movaps 0x20(%rsp),%xmm0
movaps (%rsp),%xmm1
call   1030 <f@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
movsd  0x18(%rsp),%xmm0
movaps 0x20(%rsp),%xmm4
movaps (%rsp),%xmm3
movss  0xe33(%rip),%xmm2
ucomiss %xmm3,%xmm2
addsd  0xe38(%rip),%xmm0
movaps %xmm4,%xmm1
addss  0xe21(%rip),%xmm1
jbe    1150 <main+0x30>
cvtsd2ss %xmm0,%xmm0
jmp    1153 <main+0x33>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

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