#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 catmullrom_w0(float);
float catmullrom_w1(float);
float catmullrom_w2(float);
float catmullrom_w3(float);
float catmullrom_filter(float x, float c0, float c1, float c2, float c3) {
  float r = c0 * catmullrom_w0(x);
  r += c1 * catmullrom_w1(x);
  r += c2 * catmullrom_w2(x);
  r += c3 * catmullrom_w3(x);
  return r;
}


x86 assembly (clang, -O0):
<catmullrom_filter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <catmullrom_w0@plt>
movaps %xmm0,%xmm1
movss  -0x28(%rbp),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x4(%rbp),%xmm0
call   1050 <catmullrom_w1@plt>
movaps %xmm0,%xmm2
movss  -0x24(%rbp),%xmm0
movss  -0x18(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <catmullrom_w2@plt>
movaps %xmm0,%xmm2
movss  -0x20(%rbp),%xmm0
movss  -0x18(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x4(%rbp),%xmm0
call   1060 <catmullrom_w3@plt>
movaps %xmm0,%xmm2
movss  -0x1c(%rbp),%xmm0
movss  -0x18(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<catmullrom_filter>:
sub    $0x18,%rsp
movss  %xmm4,0x14(%rsp)
movss  %xmm3,0xc(%rsp)
movss  %xmm2,0x8(%rsp)
movss  %xmm1,0x4(%rsp)
movss  %xmm0,0x10(%rsp)
call   1040 <catmullrom_w0@plt>
mulss  0x4(%rsp),%xmm0
movss  %xmm0,0x4(%rsp)
movss  0x10(%rsp),%xmm0
call   1050 <catmullrom_w1@plt>
mulss  0x8(%rsp),%xmm0
addss  0x4(%rsp),%xmm0
movss  %xmm0,0x8(%rsp)
movss  0x10(%rsp),%xmm0
call   1030 <catmullrom_w2@plt>
mulss  0xc(%rsp),%xmm0
addss  0x8(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
movss  0x10(%rsp),%xmm0
call   1060 <catmullrom_w3@plt>
mulss  0x14(%rsp),%xmm0
addss  0xc(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @catmullrom_filter(float %0, float %1, float %2, float %3, float %4) {
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
store float %0, float* %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store float %4, float* %10
%12 = load float, float* %7
%13 = load float, float* %6
%14 = call float @catmullrom_w0(float %13)
%15 = fmul float %12, %14
store float %15, float* %11
%16 = load float, float* %8
%17 = load float, float* %6
%18 = call float @catmullrom_w1(float %17)
%19 = load float, float* %11
%20 = call float @llvm.fmuladd.f32(float %16, float %18, float %19)
store float %20, float* %11
%21 = load float, float* %9
%22 = load float, float* %6
%23 = call float @catmullrom_w2(float %22)
%24 = load float, float* %11
%25 = call float @llvm.fmuladd.f32(float %21, float %23, float %24)
store float %25, float* %11
%26 = load float, float* %10
%27 = load float, float* %6
%28 = call float @catmullrom_w3(float %27)
%29 = load float, float* %11
%30 = call float @llvm.fmuladd.f32(float %26, float %28, float %29)
store float %30, float* %11
%31 = load float, float* %11
ret float %31
}

LLVM IR (-O2):
define float @catmullrom_filter(float %0, float %1, float %2, float %3, float %4) {
%6 = tail call float @catmullrom_w0(float %0)
%7 = fmul float %6, %1
%8 = tail call float @catmullrom_w1(float %0)
%9 = tail call float @llvm.fmuladd.f32(float %2, float %8, float %7)
%10 = tail call float @catmullrom_w2(float %0)
%11 = tail call float @llvm.fmuladd.f32(float %3, float %10, float %9)
%12 = tail call float @catmullrom_w3(float %0)
%13 = tail call float @llvm.fmuladd.f32(float %4, float %12, float %11)
ret float %13
}