#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 */
float lerp(float, float, float, float, float);
float biLerp(float x, float y, float q11, float q12, float q21, float q22,
             float x1, float x2, float y1, float y2) {
  float r1 = lerp(x, x1, x2, q11, q21);
  float r2 = lerp(x, x1, x2, q12, q22);
  return lerp(y, y1, y2, r1, r2);
}


x86 assembly (clang, -O0):
<biLerp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  0x18(%rbp),%xmm8
movss  0x10(%rbp),%xmm8
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  %xmm5,-0x18(%rbp)
movss  %xmm6,-0x1c(%rbp)
movss  %xmm7,-0x20(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x1c(%rbp),%xmm1
movss  -0x20(%rbp),%xmm2
movss  -0xc(%rbp),%xmm3
movss  -0x14(%rbp),%xmm4
call   1030 <lerp@plt>
movss  %xmm0,-0x24(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x1c(%rbp),%xmm1
movss  -0x20(%rbp),%xmm2
movss  -0x10(%rbp),%xmm3
movss  -0x18(%rbp),%xmm4
call   1030 <lerp@plt>
movss  %xmm0,-0x28(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0x10(%rbp),%xmm1
movss  0x18(%rbp),%xmm2
movss  -0x24(%rbp),%xmm3
movss  -0x28(%rbp),%xmm4
call   1030 <lerp@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<biLerp>:
sub    $0x28,%rsp
movss  %xmm7,0xc(%rsp)
movss  %xmm6,0x8(%rsp)
movss  %xmm5,0x20(%rsp)
movss  %xmm3,0x14(%rsp)
movaps %xmm2,%xmm3
movss  %xmm1,0x24(%rsp)
movaps %xmm0,%xmm1
movss  %xmm0,0x4(%rsp)
movss  0x30(%rsp),%xmm0
movss  %xmm0,0x1c(%rsp)
movss  0x38(%rsp),%xmm0
movss  %xmm0,0x18(%rsp)
movaps %xmm1,%xmm0
movaps %xmm6,%xmm1
movaps %xmm7,%xmm2
call   1030 <lerp@plt>
movss  %xmm0,0x10(%rsp)
movss  0x4(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
movss  0xc(%rsp),%xmm2
movss  0x14(%rsp),%xmm3
movss  0x20(%rsp),%xmm4
call   1030 <lerp@plt>
movaps %xmm0,%xmm4
movss  0x24(%rsp),%xmm0
movss  0x1c(%rsp),%xmm1
movss  0x18(%rsp),%xmm2
movss  0x10(%rsp),%xmm3
add    $0x28,%rsp
jmp    1030 <lerp@plt>

LLVM IR (-O0):
define float @biLerp(float %0, float %1, float %2, float %3, float %4, float %5, float %6, float %7, float %8, float %9) {
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca float
%16 = alloca float
%17 = alloca float
%18 = alloca float
%19 = alloca float
%20 = alloca float
%21 = alloca float
%22 = alloca float
store float %0, float* %11
store float %1, float* %12
store float %2, float* %13
store float %3, float* %14
store float %4, float* %15
store float %5, float* %16
store float %6, float* %17
store float %7, float* %18
store float %8, float* %19
store float %9, float* %20
%23 = load float, float* %11
%24 = load float, float* %17
%25 = load float, float* %18
%26 = load float, float* %13
%27 = load float, float* %15
%28 = call float @lerp(float %23, float %24, float %25, float %26, float %27)
store float %28, float* %21
%29 = load float, float* %11
%30 = load float, float* %17
%31 = load float, float* %18
%32 = load float, float* %14
%33 = load float, float* %16
%34 = call float @lerp(float %29, float %30, float %31, float %32, float %33)
store float %34, float* %22
%35 = load float, float* %12
%36 = load float, float* %19
%37 = load float, float* %20
%38 = load float, float* %21
%39 = load float, float* %22
%40 = call float @lerp(float %35, float %36, float %37, float %38, float %39)
ret float %40
}

LLVM IR (-O2):
define float @biLerp(float %0, float %1, float %2, float %3, float %4, float %5, float %6, float %7, float %8, float %9) {
%11 = tail call float @lerp(float %0, float %6, float %7, float %2, float %4)
%12 = tail call float @lerp(float %0, float %6, float %7, float %3, float %5)
%13 = tail call float @lerp(float %1, float %8, float %9, float %11, float %12)
ret float %13
}