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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xec1(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xebc(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     11e7 <main+0xc7>
movsd  -0x10(%rbp),%xmm0
lea    0xec5(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0xe9e(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     11c3 <main+0xa3>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1040 <doc@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
lea    0xe8d(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movsd  0xe6c(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    116a <main+0x4a>
movsd  0xe4d(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xe23(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1144 <main+0x24>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xorpd  %xmm0,%xmm0
lea    0xf39(%rip),%r14
lea    0xf3c(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
movsd  %xmm0,(%rsp)
mov    %r14,%rdi
movsd  (%rsp),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
movsd  (%rsp),%xmm0
movsd  0xe9f(%rip),%xmm1
call   1040 <doc@plt>
movaps %xmm0,%xmm1
mov    %rbx,%rdi
movsd  0xe8c(%rip),%xmm0
mov    $0x2,%al
call   1030 <printf@plt>
movsd  (%rsp),%xmm0
movsd  0xe80(%rip),%xmm1
call   1040 <doc@plt>
movaps %xmm0,%xmm1
mov    %rbx,%rdi
movsd  0xe6d(%rip),%xmm0
mov    $0x2,%al
call   1030 <printf@plt>
movsd  (%rsp),%xmm0
movsd  0xe61(%rip),%xmm1
call   1040 <doc@plt>
movaps %xmm0,%xmm1
mov    %rbx,%rdi
movsd  0xe4e(%rip),%xmm0
mov    $0x2,%al
call   1030 <printf@plt>
movsd  (%rsp),%xmm0
movsd  0xe42(%rip),%xmm1
call   1040 <doc@plt>
movaps %xmm0,%xmm1
mov    %rbx,%rdi
movsd  0xe2f(%rip),%xmm0
mov    $0x2,%al
call   1030 <printf@plt>
movsd  (%rsp),%xmm0
movsd  0xe23(%rip),%xmm1
call   1040 <doc@plt>
movaps %xmm0,%xmm1
mov    %rbx,%rdi
movsd  0xe10(%rip),%xmm0
mov    $0x2,%al
call   1030 <printf@plt>
movsd  (%rsp),%xmm0
movsd  0xe04(%rip),%xmm1
call   1040 <doc@plt>
movaps %xmm0,%xmm1
mov    %rbx,%rdi
movsd  0xdf1(%rip),%xmm0
mov    $0x2,%al
call   1030 <printf@plt>
movsd  (%rsp),%xmm0
movsd  0xde5(%rip),%xmm1
call   1040 <doc@plt>
movaps %xmm0,%xmm1
mov    %rbx,%rdi
movsd  0xdd2(%rip),%xmm0
mov    $0x2,%al
call   1030 <printf@plt>
movsd  (%rsp),%xmm0
movsd  0xdc6(%rip),%xmm1
call   1040 <doc@plt>
movaps %xmm0,%xmm1
mov    %rbx,%rdi
movsd  0xdb3(%rip),%xmm0
mov    $0x2,%al
call   1030 <printf@plt>
movsd  (%rsp),%xmm0
movsd  0xda7(%rip),%xmm1
call   1040 <doc@plt>
movaps %xmm0,%xmm1
mov    %rbx,%rdi
movsd  0xd94(%rip),%xmm0
mov    $0x2,%al
call   1030 <printf@plt>
movsd  (%rsp),%xmm0
movsd  0xd88(%rip),%xmm1
call   1040 <doc@plt>
movaps %xmm0,%xmm1
mov    %rbx,%rdi
movsd  0xd75(%rip),%xmm0
mov    $0x2,%al
call   1030 <printf@plt>
movsd  (%rsp),%xmm0
movsd  0xd69(%rip),%xmm1
call   1040 <doc@plt>
movaps %xmm0,%xmm1
mov    %rbx,%rdi
movsd  0xd56(%rip),%xmm0
mov    $0x2,%al
call   1030 <printf@plt>
movsd  (%rsp),%xmm0
addsd  0xd4a(%rip),%xmm0
movsd  0xd4a(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"\0A\0A(x=%f)\0A\00"
@.str.1 = [17 x i8] c"for y=%f f=%f , \00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi double [ 0.000000e+00, %0 ], [ %26, %1 ]
%3 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %2)
%4 = tail call double @doc(double %2, double -5.000000e-01)
%5 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double -5.000000e-01, double %4)
%6 = tail call double @doc(double %2, double -4.000000e-01)
%7 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double -4.000000e-01, double %6)
%8 = tail call double @doc(double %2, double 0xBFD3333333333334)
%9 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double 0xBFD3333333333334, double %8)
%10 = tail call double @doc(double %2, double 0xBFC999999999999B)
%11 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double 0xBFC999999999999B, double %10)
%12 = tail call double @doc(double %2, double 0xBFB999999999999C)
%13 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double 0xBFB999999999999C, double %12)
%14 = tail call double @doc(double %2, double 0xBC80000000000000)
%15 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double 0xBC80000000000000, double %14)
%16 = tail call double @doc(double %2, double 0x3FB9999999999998)
%17 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double 0x3FB9999999999998, double %16)
%18 = tail call double @doc(double %2, double 0x3FC9999999999999)
%19 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double 0x3FC9999999999999, double %18)
%20 = tail call double @doc(double %2, double 3.000000e-01)
%21 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double 3.000000e-01, double %20)
%22 = tail call double @doc(double %2, double 4.000000e-01)
%23 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double 4.000000e-01, double %22)
%24 = tail call double @doc(double %2, double 5.000000e-01)
%25 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double 5.000000e-01, double %24)
%26 = fadd double %2, 2.500000e-01
%27 = fcmp ugt double %26, 2.000000e+00
br i1 %27, label %28, label %1
28: ; preds = %1
ret i32 0
}