#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 triLerp(float x, float y, float z, float q000, float q001, float q010,
              float q011, float q100, float q101, float q110, float q111,
              float x1, float x2, float y1, float y2, float z1, float z2) {
  float x00 = lerp(x, x1, x2, q000, q100);
  float x10 = lerp(x, x1, x2, q010, q110);
  float x01 = lerp(x, x1, x2, q001, q101);
  float x11 = lerp(x, x1, x2, q011, q111);
  float r0 = lerp(y, y1, y2, x00, x10);
  float r1 = lerp(y, y1, y2, x01, x11);
  return lerp(z, z1, z2, r0, r1);
}


x86 assembly (clang, -O0):
<triLerp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movss  0x50(%rbp),%xmm8
movss  0x48(%rbp),%xmm8
movss  0x40(%rbp),%xmm8
movss  0x38(%rbp),%xmm8
movss  0x30(%rbp),%xmm8
movss  0x28(%rbp),%xmm8
movss  0x20(%rbp),%xmm8
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  0x28(%rbp),%xmm1
movss  0x30(%rbp),%xmm2
movss  -0x10(%rbp),%xmm3
movss  -0x20(%rbp),%xmm4
call   1030 <lerp@plt>
movss  %xmm0,-0x24(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0x28(%rbp),%xmm1
movss  0x30(%rbp),%xmm2
movss  -0x18(%rbp),%xmm3
movss  0x18(%rbp),%xmm4
call   1030 <lerp@plt>
movss  %xmm0,-0x28(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0x28(%rbp),%xmm1
movss  0x30(%rbp),%xmm2
movss  -0x14(%rbp),%xmm3
movss  0x10(%rbp),%xmm4
call   1030 <lerp@plt>
movss  %xmm0,-0x2c(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0x28(%rbp),%xmm1
movss  0x30(%rbp),%xmm2
movss  -0x1c(%rbp),%xmm3
movss  0x20(%rbp),%xmm4
call   1030 <lerp@plt>
movss  %xmm0,-0x30(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0x38(%rbp),%xmm1
movss  0x40(%rbp),%xmm2
movss  -0x24(%rbp),%xmm3
movss  -0x28(%rbp),%xmm4
call   1030 <lerp@plt>
movss  %xmm0,-0x34(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0x38(%rbp),%xmm1
movss  0x40(%rbp),%xmm2
movss  -0x2c(%rbp),%xmm3
movss  -0x30(%rbp),%xmm4
call   1030 <lerp@plt>
movss  %xmm0,-0x38(%rbp)
movss  -0xc(%rbp),%xmm0
movss  0x48(%rbp),%xmm1
movss  0x50(%rbp),%xmm2
movss  -0x34(%rbp),%xmm3
movss  -0x38(%rbp),%xmm4
call   1030 <lerp@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<triLerp>:
sub    $0x48,%rsp
movss  %xmm6,0x38(%rsp)
movss  %xmm5,0x10(%rsp)
movss  %xmm4,0x14(%rsp)
movss  %xmm2,0x44(%rsp)
movss  %xmm1,0x24(%rsp)
movaps %xmm0,%xmm4
movss  %xmm0,0xc(%rsp)
movss  0x88(%rsp),%xmm0
movss  %xmm0,0x40(%rsp)
movss  0x90(%rsp),%xmm0
movss  %xmm0,0x3c(%rsp)
movss  0x78(%rsp),%xmm0
movss  %xmm0,0x20(%rsp)
movss  0x80(%rsp),%xmm0
movss  %xmm0,0x1c(%rsp)
movss  0x60(%rsp),%xmm0
movss  %xmm0,0x34(%rsp)
movss  0x50(%rsp),%xmm0
movss  %xmm0,0x2c(%rsp)
movss  0x58(%rsp),%xmm0
movss  %xmm0,0x28(%rsp)
movss  0x68(%rsp),%xmm1
movss  %xmm1,0x8(%rsp)
movss  0x70(%rsp),%xmm2
movss  %xmm2,0x18(%rsp)
movaps %xmm4,%xmm0
movaps %xmm7,%xmm4
call   1030 <lerp@plt>
movss  %xmm0,0x30(%rsp)
movss  0xc(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
movss  0x18(%rsp),%xmm2
movss  0x10(%rsp),%xmm3
movss  0x28(%rsp),%xmm4
call   1030 <lerp@plt>
movss  %xmm0,0x10(%rsp)
movss  0xc(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
movss  0x18(%rsp),%xmm2
movss  0x14(%rsp),%xmm3
movss  0x2c(%rsp),%xmm4
call   1030 <lerp@plt>
movss  %xmm0,0x14(%rsp)
movss  0xc(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
movss  0x18(%rsp),%xmm2
movss  0x38(%rsp),%xmm3
movss  0x34(%rsp),%xmm4
call   1030 <lerp@plt>
movss  %xmm0,0xc(%rsp)
movss  0x24(%rsp),%xmm0
movss  0x20(%rsp),%xmm1
movss  0x1c(%rsp),%xmm2
movss  0x30(%rsp),%xmm3
movss  0x10(%rsp),%xmm4
call   1030 <lerp@plt>
movss  %xmm0,0x8(%rsp)
movss  0x24(%rsp),%xmm0
movss  0x20(%rsp),%xmm1
movss  0x1c(%rsp),%xmm2
movss  0x14(%rsp),%xmm3
movss  0xc(%rsp),%xmm4
call   1030 <lerp@plt>
movaps %xmm0,%xmm4
movss  0x44(%rsp),%xmm0
movss  0x40(%rsp),%xmm1
movss  0x3c(%rsp),%xmm2
movss  0x8(%rsp),%xmm3
add    $0x48,%rsp
jmp    1030 <lerp@plt>

LLVM IR (-O0):
define float @triLerp(float %0, float %1, float %2, float %3, float %4, float %5, float %6, float %7, float %8, float %9, float %10, float %11, float %12, float %13, float %14, float %15, float %16) {
%18 = alloca float
%19 = alloca float
%20 = alloca float
%21 = alloca float
%22 = alloca float
%23 = alloca float
%24 = alloca float
%25 = alloca float
%26 = alloca float
%27 = alloca float
%28 = alloca float
%29 = alloca float
%30 = alloca float
%31 = alloca float
%32 = alloca float
%33 = alloca float
%34 = alloca float
%35 = alloca float
%36 = alloca float
%37 = alloca float
%38 = alloca float
%39 = alloca float
%40 = alloca float
store float %0, float* %18
store float %1, float* %19
store float %2, float* %20
store float %3, float* %21
store float %4, float* %22
store float %5, float* %23
store float %6, float* %24
store float %7, float* %25
store float %8, float* %26
store float %9, float* %27
store float %10, float* %28
store float %11, float* %29
store float %12, float* %30
store float %13, float* %31
store float %14, float* %32
store float %15, float* %33
store float %16, float* %34
%41 = load float, float* %18
%42 = load float, float* %29
%43 = load float, float* %30
%44 = load float, float* %21
%45 = load float, float* %25
%46 = call float @lerp(float %41, float %42, float %43, float %44, float %45)
store float %46, float* %35
%47 = load float, float* %18
%48 = load float, float* %29
%49 = load float, float* %30
%50 = load float, float* %23
%51 = load float, float* %27
%52 = call float @lerp(float %47, float %48, float %49, float %50, float %51)
store float %52, float* %36
%53 = load float, float* %18
%54 = load float, float* %29
%55 = load float, float* %30
%56 = load float, float* %22
%57 = load float, float* %26
%58 = call float @lerp(float %53, float %54, float %55, float %56, float %57)
store float %58, float* %37
%59 = load float, float* %18
%60 = load float, float* %29
%61 = load float, float* %30
%62 = load float, float* %24
%63 = load float, float* %28
%64 = call float @lerp(float %59, float %60, float %61, float %62, float %63)
store float %64, float* %38
%65 = load float, float* %19
%66 = load float, float* %31
%67 = load float, float* %32
%68 = load float, float* %35
%69 = load float, float* %36
%70 = call float @lerp(float %65, float %66, float %67, float %68, float %69)
store float %70, float* %39
%71 = load float, float* %19
%72 = load float, float* %31
%73 = load float, float* %32
%74 = load float, float* %37
%75 = load float, float* %38
%76 = call float @lerp(float %71, float %72, float %73, float %74, float %75)
store float %76, float* %40
%77 = load float, float* %20
%78 = load float, float* %33
%79 = load float, float* %34
%80 = load float, float* %39
%81 = load float, float* %40
%82 = call float @lerp(float %77, float %78, float %79, float %80, float %81)
ret float %82
}

LLVM IR (-O2):
define float @triLerp(float %0, float %1, float %2, float %3, float %4, float %5, float %6, float %7, float %8, float %9, float %10, float %11, float %12, float %13, float %14, float %15, float %16) {
%18 = tail call float @lerp(float %0, float %11, float %12, float %3, float %7)
%19 = tail call float @lerp(float %0, float %11, float %12, float %5, float %9)
%20 = tail call float @lerp(float %0, float %11, float %12, float %4, float %8)
%21 = tail call float @lerp(float %0, float %11, float %12, float %6, float %10)
%22 = tail call float @lerp(float %1, float %13, float %14, float %18, float %19)
%23 = tail call float @lerp(float %1, float %13, float %14, float %20, float %21)
%24 = tail call float @lerp(float %2, float %15, float %16, float %22, float %23)
ret float %24
}