#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 */
typedef int /*<<< orphan*/ s;

/* Variables and functions */
scalar_t__ fabs(float);
float stbir__filter_mitchell(float x, float s) {
  (void)sizeof(s);
  x = (float)fabs(x);
  if (x < 1.0f)
    return (16 + x * x * (21 * x - 36)) / 18;
  else if (x < 2.0f)
    return (32 + x * (-60 + x * (36 - 7 * x))) / 18;
  return (0.0f);
}


x86 assembly (clang, -O0):
<stbir__filter_mitchell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xec2(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1195 <stbir__filter_mitchell+0x85>
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  0xec1(%rip),%xmm2
mulss  %xmm2,%xmm1
movss  0xeb9(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  0xea1(%rip),%xmm1
addss  %xmm1,%xmm0
movss  0xe81(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1211 <stbir__filter_mitchell+0x101>
movss  0xe67(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1204 <stbir__filter_mitchell+0xf4>
movss  -0x8(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0x8(%rbp),%xmm2
movss  0xe56(%rip),%xmm3
mulss  %xmm3,%xmm2
movss  0xe4e(%rip),%xmm3
addss  %xmm3,%xmm2
mulss  %xmm2,%xmm1
movss  0xe36(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  0xe22(%rip),%xmm1
addss  %xmm1,%xmm0
movss  0xe12(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1211 <stbir__filter_mitchell+0x101>
jmp    1209 <stbir__filter_mitchell+0xf9>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stbir__filter_mitchell>:
push   %rax
call   1030 <fabs@plt>
cvtsi2ss %rax,%xmm1
test   %rax,%rax
jle    115f <stbir__filter_mitchell+0x4f>
xorps  %xmm0,%xmm0
cmp    $0x1,%rax
jne    115d <stbir__filter_mitchell+0x4d>
movss  0xecf(%rip),%xmm0
mulss  %xmm1,%xmm0
addss  0xec7(%rip),%xmm0
mulss  %xmm1,%xmm0
addss  0xebf(%rip),%xmm0
mulss  %xmm1,%xmm0
addss  0xeb7(%rip),%xmm0
divss  0xeb3(%rip),%xmm0
pop    %rax
ret
movaps %xmm1,%xmm0
mulss  0xeaa(%rip),%xmm1
mulss  %xmm0,%xmm0
addss  0xea2(%rip),%xmm1
mulss  %xmm0,%xmm1
addss  0xe9a(%rip),%xmm1
divss  0xe86(%rip),%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @stbir__filter_mitchell(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = call i64 @fabs(float %6)
%8 = sitofp i64 %7 to float
store float %8, float* %4
%9 = load float, float* %4
%10 = fcmp olt float %9, 1.000000e+00
br i1 %10, label %11, label %19
11: ; preds = %2
%12 = load float, float* %4
%13 = load float, float* %4
%14 = fmul float %12, %13
%15 = load float, float* %4
%16 = call float @llvm.fmuladd.f32(float 2.100000e+01, float %15, float -3.600000e+01)
%17 = call float @llvm.fmuladd.f32(float %14, float %16, float 1.600000e+01)
%18 = fdiv float %17, 1.800000e+01
store float %18, float* %3
br label %32
19: ; preds = %2
%20 = load float, float* %4
%21 = fcmp olt float %20, 2.000000e+00
br i1 %21, label %22, label %30
22: ; preds = %19
%23 = load float, float* %4
%24 = load float, float* %4
%25 = load float, float* %4
%26 = call float @llvm.fmuladd.f32(float -7.000000e+00, float %25, float 3.600000e+01)
%27 = call float @llvm.fmuladd.f32(float %24, float %26, float -6.000000e+01)
%28 = call float @llvm.fmuladd.f32(float %23, float %27, float 3.200000e+01)
%29 = fdiv float %28, 1.800000e+01
store float %29, float* %3
br label %32
30: ; preds = %19
br label %31
31: ; preds = %30
store float 0.000000e+00, float* %3
br label %32
32: ; preds = %31, %22, %11
%33 = load float, float* %3
ret float %33
}

LLVM IR (-O2):
define float @stbir__filter_mitchell(float %0, float %1) {
%3 = tail call i64 @fabs(float %0)
%4 = sitofp i64 %3 to float
%5 = icmp slt i64 %3, 1
br i1 %5, label %6, label %11
6: ; preds = %2
%7 = fmul float %4, %4
%8 = tail call float @llvm.fmuladd.f32(float %4, float 2.100000e+01, float -3.600000e+01)
%9 = tail call float @llvm.fmuladd.f32(float %7, float %8, float 1.600000e+01)
%10 = fdiv float %9, 1.800000e+01
br label %18
11: ; preds = %2
%12 = icmp eq i64 %3, 1
br i1 %12, label %13, label %18
13: ; preds = %11
%14 = tail call float @llvm.fmuladd.f32(float %4, float -7.000000e+00, float 3.600000e+01)
%15 = tail call float @llvm.fmuladd.f32(float %4, float %14, float -6.000000e+01)
%16 = tail call float @llvm.fmuladd.f32(float %4, float %15, float 3.200000e+01)
%17 = fdiv float %16, 1.800000e+01
br label %18
18: ; preds = %11, %13, %6
%19 = phi float [ %10, %6 ], [ %17, %13 ], [ 0.000000e+00, %11 ]
ret float %19
}