#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 prime(float, float);
int /*<<< orphan*/ printf(char *, float, float, double);
main() {
  float X = -1, Y = -1, F;
  while (Y <= 1.1) {
    printf("X=%.3f Y=%.3f F=%.3f\n\n", X, Y, prime(X, Y));
    X += 0.2;
    if (X > 1) {
      X = 0;
      Y += 0.1;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xec9(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xebc(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeae(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     11ff <main+0xdf>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
call   1040 <prime@plt>
movss  -0x18(%rbp),%xmm1
movaps %xmm0,%xmm2
movss  -0x14(%rbp),%xmm0
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe5f(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xe39(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    11fa <main+0xda>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe2b(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1149 <main+0x29>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movss  0xed3(%rip),%xmm3
movsd  0xed3(%rip),%xmm2
lea    0xeec(%rip),%rbx
movaps %xmm3,%xmm1
jmp    1176 <main+0x56>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movss  0x4(%rsp),%xmm1
movaps %xmm2,%xmm3
cmpltss %xmm0,%xmm3
andnps %xmm0,%xmm3
xorps  %xmm2,%xmm2
cvtss2sd %xmm1,%xmm2
movsd  0xeb0(%rip),%xmm0
ucomisd %xmm2,%xmm0
jb     11e5 <main+0xc5>
movss  %xmm1,0x4(%rsp)
movaps %xmm3,0x10(%rsp)
movsd  %xmm2,0x8(%rsp)
movaps %xmm3,%xmm0
call   1040 <prime@plt>
movaps %xmm0,%xmm2
mov    %rbx,%rdi
movaps 0x10(%rsp),%xmm0
movss  0x4(%rsp),%xmm1
call   1030 <printf@plt>
movsd  0x8(%rsp),%xmm3
movss  0xe51(%rip),%xmm2
movaps 0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xe4c(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ucomiss %xmm2,%xmm0
addsd  0xe45(%rip),%xmm3
jbe    1150 <main+0x30>
xorps  %xmm1,%xmm1
cvtsd2ss %xmm3,%xmm1
jmp    1156 <main+0x36>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"X=%.3f Y=%.3f 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* %2
store float -1.000000e+00, float* %3
br label %5
5: ; preds = %27, %0
%6 = load float, float* %3
%7 = fpext float %6 to double
%8 = fcmp ole double %7, 1.100000e+00
br i1 %8, label %9, label %28
9: ; preds = %5
%10 = load float, float* %2
%11 = load float, float* %3
%12 = load float, float* %2
%13 = load float, float* %3
%14 = call double @prime(float %12, float %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), float %10, float %11, double %14)
%16 = load float, float* %2
%17 = fpext float %16 to double
%18 = fadd double %17, 2.000000e-01
%19 = fptrunc double %18 to float
store float %19, float* %2
%20 = load float, float* %2
%21 = fcmp ogt float %20, 1.000000e+00
br i1 %21, label %22, label %27
22: ; preds = %9
store float 0.000000e+00, float* %2
%23 = load float, float* %3
%24 = fpext float %23 to double
%25 = fadd double %24, 1.000000e-01
%26 = fptrunc double %25 to float
store float %26, float* %3
br label %27
27: ; preds = %22, %9
br label %5
28: ; preds = %5
%29 = load i32, i32* %1
ret i32 %29
}

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