#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 blerp(double, double, double, double, double, double);
int /*<<< orphan*/ printf(char *, double, double, double, double, double);
int main(void) {
  double i, j, k, l, s;
  double tx, ty;
  s = 0.05;
  tx = ty = 1;
  for (i = 0; i <= 1; i += s) {
    for (j = 0; j <= 1; j += s) {
      for (k = 0; k <= 1; k += s) {
        for (l = 0; l <= 1; l += s) {
          printf("[%.2f,%.2f,%.2f,%.2f] %f\n", i, j, k, l,
                 blerp(i, j, k, l, tx, ty));
        }
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed1(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xebc(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xeaf(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xe9a(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     128f <main+0x16f>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe7f(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     1276 <main+0x156>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe64(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
jb     125d <main+0x13d>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe49(%rip),%xmm0
ucomisd -0x28(%rbp),%xmm0
jb     1244 <main+0x124>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm3
movsd  -0x38(%rbp),%xmm4
movsd  -0x40(%rbp),%xmm5
call   1040 <blerp@plt>
movsd  -0x60(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm3
movaps %xmm0,%xmm4
movsd  -0x48(%rbp),%xmm0
lea    0xde5(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x30(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    11af <main+0x8f>
jmp    1249 <main+0x129>
movsd  -0x30(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1194 <main+0x74>
jmp    1262 <main+0x142>
movsd  -0x30(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1179 <main+0x59>
jmp    127b <main+0x15b>
movsd  -0x30(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    115e <main+0x3e>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
xorpd  %xmm0,%xmm0
lea    0xee0(%rip),%rbx
xorps  %xmm5,%xmm5
movsd  %xmm0,(%rsp)
nopl   0x0(%rax,%rax,1)
xorps  %xmm4,%xmm4
movsd  %xmm5,0x8(%rsp)
nopl   0x0(%rax)
xorps  %xmm3,%xmm3
movsd  %xmm4,0x10(%rsp)
nopl   0x0(%rax)
movsd  %xmm3,0x18(%rsp)
movsd  (%rsp),%xmm0
movaps %xmm5,%xmm1
movaps %xmm4,%xmm2
movsd  0xe87(%rip),%xmm4
movsd  0xe7f(%rip),%xmm5
call   1040 <blerp@plt>
movaps %xmm0,%xmm4
mov    %rbx,%rdi
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
movsd  0x18(%rsp),%xmm3
call   1030 <printf@plt>
movsd  0x18(%rsp),%xmm3
movsd  0x10(%rsp),%xmm4
movsd  0x8(%rsp),%xmm5
movsd  0xe46(%rip),%xmm2
movsd  0xe36(%rip),%xmm1
movsd  (%rsp),%xmm0
addsd  %xmm2,%xmm3
ucomisd %xmm3,%xmm1
jae    1160 <main+0x40>
addsd  %xmm2,%xmm4
ucomisd %xmm4,%xmm1
jae    1150 <main+0x30>
addsd  %xmm2,%xmm5
ucomisd %xmm5,%xmm1
jae    1140 <main+0x20>
addsd  %xmm2,%xmm0
ucomisd %xmm0,%xmm1
jae    1130 <main+0x10>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"[%.2f,%.2f,%.2f,%.2f] %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store i32 0, i32* %1
store double 5.000000e-02, double* %6
store double 1.000000e+00, double* %8
store double 1.000000e+00, double* %7
store double 0.000000e+00, double* %2
br label %9
9: ; preds = %52, %0
%10 = load double, double* %2
%11 = fcmp ole double %10, 1.000000e+00
br i1 %11, label %12, label %56
12: ; preds = %9
store double 0.000000e+00, double* %3
br label %13
13: ; preds = %47, %12
%14 = load double, double* %3
%15 = fcmp ole double %14, 1.000000e+00
br i1 %15, label %16, label %51
16: ; preds = %13
store double 0.000000e+00, double* %4
br label %17
17: ; preds = %42, %16
%18 = load double, double* %4
%19 = fcmp ole double %18, 1.000000e+00
br i1 %19, label %20, label %46
20: ; preds = %17
store double 0.000000e+00, double* %5
br label %21
21: ; preds = %37, %20
%22 = load double, double* %5
%23 = fcmp ole double %22, 1.000000e+00
br i1 %23, label %24, label %41
24: ; preds = %21
%25 = load double, double* %2
%26 = load double, double* %3
%27 = load double, double* %4
%28 = load double, double* %5
%29 = load double, double* %2
%30 = load double, double* %3
%31 = load double, double* %4
%32 = load double, double* %5
%33 = load double, double* %7
%34 = load double, double* %8
%35 = call double @blerp(double %29, double %30, double %31, double %32, double %33, double %34)
%36 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), double %25, double %26, double %27, double %28, double %35)
br label %37
37: ; preds = %24
%38 = load double, double* %6
%39 = load double, double* %5
%40 = fadd double %39, %38
store double %40, double* %5
br label %21
41: ; preds = %21
br label %42
42: ; preds = %41
%43 = load double, double* %6
%44 = load double, double* %4
%45 = fadd double %44, %43
store double %45, double* %4
br label %17
46: ; preds = %17
br label %47
47: ; preds = %46
%48 = load double, double* %6
%49 = load double, double* %3
%50 = fadd double %49, %48
store double %50, double* %3
br label %13
51: ; preds = %13
br label %52
52: ; preds = %51
%53 = load double, double* %6
%54 = load double, double* %2
%55 = fadd double %54, %53
store double %55, double* %2
br label %9
56: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"[%.2f,%.2f,%.2f,%.2f] %f\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %19
%2 = phi double [ 0.000000e+00, %0 ], [ %20, %19 ]
br label %3
3: ; preds = %1, %16
%4 = phi double [ 0.000000e+00, %1 ], [ %17, %16 ]
br label %5
5: ; preds = %3, %13
%6 = phi double [ 0.000000e+00, %3 ], [ %14, %13 ]
br label %7
7: ; preds = %5, %7
%8 = phi double [ 0.000000e+00, %5 ], [ %11, %7 ]
%9 = tail call double @blerp(double %2, double %4, double %6, double %8, double 1.000000e+00, double 1.000000e+00)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), double %2, double %4, double %6, double %8, double %9)
%11 = fadd double %8, 5.000000e-02
%12 = fcmp ugt double %11, 1.000000e+00
br i1 %12, label %13, label %7
13: ; preds = %7
%14 = fadd double %6, 5.000000e-02
%15 = fcmp ugt double %14, 1.000000e+00
br i1 %15, label %16, label %5
16: ; preds = %13
%17 = fadd double %4, 5.000000e-02
%18 = fcmp ugt double %17, 1.000000e+00
br i1 %18, label %19, label %3
19: ; preds = %16
%20 = fadd double %2, 5.000000e-02
%21 = fcmp ugt double %20, 1.000000e+00
br i1 %21, label %22, label %1
22: ; preds = %19
ret i32 0
}