#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 cubic_interpolation(float *, float);
float bicubic_interpolation_cell(float p[4][4], float x, float y) {
  float v[4];
  v[0] = cubic_interpolation(p[0], y);
  v[1] = cubic_interpolation(p[1], y);
  v[2] = cubic_interpolation(p[2], y);
  v[3] = cubic_interpolation(p[3], y);
  return cubic_interpolation(v, x);
}


x86 assembly (clang, -O0):
<bicubic_interpolation_cell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
movss  -0x10(%rbp),%xmm0
call   1030 <cubic_interpolation@plt>
movss  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x10,%rdi
movss  -0x10(%rbp),%xmm0
call   1030 <cubic_interpolation@plt>
movss  %xmm0,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x20,%rdi
movss  -0x10(%rbp),%xmm0
call   1030 <cubic_interpolation@plt>
movss  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x30,%rdi
movss  -0x10(%rbp),%xmm0
call   1030 <cubic_interpolation@plt>
movss  %xmm0,-0x14(%rbp)
lea    -0x20(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
call   1030 <cubic_interpolation@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bicubic_interpolation_cell>:
push   %rbx
sub    $0x20,%rsp
movss  %xmm1,0x8(%rsp)
movss  %xmm0,0xc(%rsp)
mov    %rdi,%rbx
movaps %xmm1,%xmm0
call   1030 <cubic_interpolation@plt>
movss  %xmm0,0x10(%rsp)
lea    0x10(%rbx),%rdi
movss  0x8(%rsp),%xmm0
call   1030 <cubic_interpolation@plt>
movss  %xmm0,0x14(%rsp)
lea    0x20(%rbx),%rdi
movss  0x8(%rsp),%xmm0
call   1030 <cubic_interpolation@plt>
movss  %xmm0,0x18(%rsp)
add    $0x30,%rbx
mov    %rbx,%rdi
movss  0x8(%rsp),%xmm0
call   1030 <cubic_interpolation@plt>
movss  %xmm0,0x1c(%rsp)
lea    0x10(%rsp),%rdi
movss  0xc(%rsp),%xmm0
call   1030 <cubic_interpolation@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @bicubic_interpolation_cell([4 x float]* %0, float %1, float %2) {
%4 = alloca [4 x float]*
%5 = alloca float
%6 = alloca float
%7 = alloca [4 x float]
store [4 x float]* %0, [4 x float]** %4
store float %1, float* %5
store float %2, float* %6
%8 = load [4 x float]*, [4 x float]** %4
%9 = getelementptr inbounds [4 x float], [4 x float]* %8, i64 0
%10 = getelementptr inbounds [4 x float], [4 x float]* %9, i64 0, i64 0
%11 = load float, float* %6
%12 = call float @cubic_interpolation(float* %10, float %11)
%13 = getelementptr inbounds [4 x float], [4 x float]* %7, i64 0, i64 0
store float %12, float* %13
%14 = load [4 x float]*, [4 x float]** %4
%15 = getelementptr inbounds [4 x float], [4 x float]* %14, i64 1
%16 = getelementptr inbounds [4 x float], [4 x float]* %15, i64 0, i64 0
%17 = load float, float* %6
%18 = call float @cubic_interpolation(float* %16, float %17)
%19 = getelementptr inbounds [4 x float], [4 x float]* %7, i64 0, i64 1
store float %18, float* %19
%20 = load [4 x float]*, [4 x float]** %4
%21 = getelementptr inbounds [4 x float], [4 x float]* %20, i64 2
%22 = getelementptr inbounds [4 x float], [4 x float]* %21, i64 0, i64 0
%23 = load float, float* %6
%24 = call float @cubic_interpolation(float* %22, float %23)
%25 = getelementptr inbounds [4 x float], [4 x float]* %7, i64 0, i64 2
store float %24, float* %25
%26 = load [4 x float]*, [4 x float]** %4
%27 = getelementptr inbounds [4 x float], [4 x float]* %26, i64 3
%28 = getelementptr inbounds [4 x float], [4 x float]* %27, i64 0, i64 0
%29 = load float, float* %6
%30 = call float @cubic_interpolation(float* %28, float %29)
%31 = getelementptr inbounds [4 x float], [4 x float]* %7, i64 0, i64 3
store float %30, float* %31
%32 = getelementptr inbounds [4 x float], [4 x float]* %7, i64 0, i64 0
%33 = load float, float* %5
%34 = call float @cubic_interpolation(float* %32, float %33)
ret float %34
}

LLVM IR (-O2):
define float @bicubic_interpolation_cell([4 x float]* %0, float %1, float %2) {
%4 = alloca [4 x float]
%5 = bitcast [4 x float]* %4 to i8*
%6 = getelementptr inbounds [4 x float], [4 x float]* %0, i64 0, i64 0
%7 = tail call float @cubic_interpolation(float* %6, float %2)
%8 = getelementptr inbounds [4 x float], [4 x float]* %4, i64 0, i64 0
store float %7, float* %8
%9 = getelementptr inbounds [4 x float], [4 x float]* %0, i64 1, i64 0
%10 = tail call float @cubic_interpolation(float* %9, float %2)
%11 = getelementptr inbounds [4 x float], [4 x float]* %4, i64 0, i64 1
store float %10, float* %11
%12 = getelementptr inbounds [4 x float], [4 x float]* %0, i64 2, i64 0
%13 = tail call float @cubic_interpolation(float* %12, float %2)
%14 = getelementptr inbounds [4 x float], [4 x float]* %4, i64 0, i64 2
store float %13, float* %14
%15 = getelementptr inbounds [4 x float], [4 x float]* %0, i64 3, i64 0
%16 = tail call float @cubic_interpolation(float* %15, float %2)
%17 = getelementptr inbounds [4 x float], [4 x float]* %4, i64 0, i64 3
store float %16, float* %17
%18 = call float @cubic_interpolation(float* %8, float %1)
ret float %18
}