#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 */
double cubic_convolution(int, double);
double cubic(int image[4][4], double x, double y, double a) {
  double a0 = 0, a1 = 0, a2 = 0, a3 = 0;
  double column[4];
  int i = 0;
  double ret;
  if (x == 0 && y == 0) {
    return (double)image[1][1];
  }
  if (x == 0) {
    for (i = 0; i < 4; i++) {
      column[i] = (double)image[i][1];
    }
  } else {
    a0 = cubic_convolution(x + 1, a);
    a1 = cubic_convolution(x, a);
    a2 = cubic_convolution(1 - x, a);
    a3 = cubic_convolution(2 - x, a);
    if (y == 0) {
      ret = a0 * image[1][0] + a1 * image[1][1] + a2 * image[1][2] +
            a3 * image[1][3];
      return ((ret) < (0)) ? (0) : (((ret) > (255)) ? (255) : (ret));
    } else {
      for (i = 0; i < 4; i++) {
        column[i] = a0 * image[i][0] + a1 * image[i][1] + a2 * image[i][2] +
                    a3 * image[i][3];
      }
    }
  }
  a0 = cubic_convolution(y + 1, a);
  a1 = cubic_convolution(y, a);
  a2 = cubic_convolution(1 - y, a);
  a3 = cubic_convolution(2 - y, a);
  ret = a0 * column[0] + a1 * column[1] + a2 * column[2] + a3 * column[3];
  return ((ret) < (0)) ? (0) : (((ret) > (255)) ? (255) : (ret));
}


x86 assembly (clang, -O0):
<cubic>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm2,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
movl   $0x0,-0x74(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1198 <cubic+0x88>
jp     1198 <cubic+0x88>
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1198 <cubic+0x88>
jp     1198 <cubic+0x88>
mov    -0x10(%rbp),%rax
cvtsi2sdl 0x14(%rax),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    152f <cubic+0x41f>
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11f2 <cubic+0xe2>
jp     11f2 <cubic+0xe2>
movl   $0x0,-0x74(%rbp)
cmpl   $0x4,-0x74(%rbp)
jge    11ed <cubic+0xdd>
mov    -0x10(%rbp),%rax
movslq -0x74(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
cvtsi2sdl 0x4(%rax),%xmm0
movslq -0x74(%rbp),%rax
movsd  %xmm0,-0x70(%rbp,%rax,8)
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    11b7 <cubic+0xa7>
jmp    1402 <cubic+0x2f2>
movsd  0xe0e(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%edi
movsd  -0x28(%rbp),%xmm0
call   1030 <cubic_convolution@plt>
movsd  %xmm0,-0x30(%rbp)
cvttsd2si -0x18(%rbp),%edi
movsd  -0x28(%rbp),%xmm0
call   1030 <cubic_convolution@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  0xdda(%rip),%xmm0
subsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%edi
movsd  -0x28(%rbp),%xmm0
call   1030 <cubic_convolution@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  0xdb2(%rip),%xmm0
subsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%edi
movsd  -0x28(%rbp),%xmm0
call   1030 <cubic_convolution@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1350 <cubic+0x240>
jp     1350 <cubic+0x240>
movsd  -0x30(%rbp),%xmm0
mov    -0x10(%rbp),%rax
cvtsi2sdl 0x10(%rax),%xmm2
movsd  -0x38(%rbp),%xmm1
mov    -0x10(%rbp),%rax
cvtsi2sdl 0x14(%rax),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x40(%rbp),%xmm1
mov    -0x10(%rbp),%rax
cvtsi2sdl 0x18(%rax),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
mov    -0x10(%rbp),%rax
cvtsi2sdl 0x1c(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x80(%rbp),%xmm0
jbe    12f5 <cubic+0x1e5>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
jmp    133e <cubic+0x22e>
movsd  -0x80(%rbp),%xmm0
movsd  0xd0e(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1321 <cubic+0x211>
movsd  0xcfc(%rip),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
jmp    132e <cubic+0x21e>
movsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x8(%rbp)
jmp    152f <cubic+0x41f>
movl   $0x0,-0x74(%rbp)
cmpl   $0x4,-0x74(%rbp)
jge    13f8 <cubic+0x2e8>
movsd  -0x30(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x74(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
cvtsi2sdl (%rax),%xmm2
movsd  -0x38(%rbp),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x74(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
cvtsi2sdl 0x4(%rax),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x40(%rbp),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x74(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
cvtsi2sdl 0x8(%rax),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x74(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
cvtsi2sdl 0xc(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movslq -0x74(%rbp),%rax
movsd  %xmm0,-0x70(%rbp,%rax,8)
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    1357 <cubic+0x247>
jmp    13fd <cubic+0x2ed>
jmp    1402 <cubic+0x2f2>
movsd  0xbfe(%rip),%xmm0
addsd  -0x20(%rbp),%xmm0
cvttsd2si %xmm0,%edi
movsd  -0x28(%rbp),%xmm0
call   1030 <cubic_convolution@plt>
movsd  %xmm0,-0x30(%rbp)
cvttsd2si -0x20(%rbp),%edi
movsd  -0x28(%rbp),%xmm0
call   1030 <cubic_convolution@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  0xbca(%rip),%xmm0
subsd  -0x20(%rbp),%xmm0
cvttsd2si %xmm0,%edi
movsd  -0x28(%rbp),%xmm0
call   1030 <cubic_convolution@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  0xba2(%rip),%xmm0
subsd  -0x20(%rbp),%xmm0
cvttsd2si %xmm0,%edi
movsd  -0x28(%rbp),%xmm0
call   1030 <cubic_convolution@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm1
mulsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x40(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x80(%rbp),%xmm0
jbe    14d9 <cubic+0x3c9>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
jmp    1522 <cubic+0x412>
movsd  -0x80(%rbp),%xmm0
movsd  0xb2a(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1505 <cubic+0x3f5>
movsd  0xb18(%rip),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
jmp    1512 <cubic+0x402>
movsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cubic>:
push   %rbx
sub    $0x60,%rsp
movapd %xmm0,%xmm3
mov    %rdi,%rbx
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm3
jne    113a <cubic+0x2a>
jp     113a <cubic+0x2a>
ucomisd %xmm0,%xmm1
jne    113a <cubic+0x2a>
jp     113a <cubic+0x2a>
cvtsi2sdl 0x14(%rbx),%xmm5
jmp    133a <cubic+0x22a>
ucomisd %xmm0,%xmm3
movsd  %xmm1,0x8(%rsp)
movsd  %xmm2,(%rsp)
jne    124c <cubic+0x13c>
jp     124c <cubic+0x13c>
movss  0x24(%rbx),%xmm0
movss  0x34(%rbx),%xmm4
unpcklps %xmm0,%xmm4
movss  0x4(%rbx),%xmm0
movss  0x14(%rbx),%xmm3
unpcklps %xmm0,%xmm3
cvtdq2pd %xmm3,%xmm0
movaps %xmm0,0x20(%rsp)
cvtdq2pd %xmm4,%xmm0
movapd %xmm0,0x10(%rsp)
movapd %xmm1,%xmm0
addsd  0xe72(%rip),%xmm0
cvttsd2si %xmm0,%edi
movaps %xmm2,%xmm0
call   1030 <cubic_convolution@plt>
movsd  %xmm0,0x40(%rsp)
cvttsd2si 0x8(%rsp),%edi
movsd  (%rsp),%xmm0
call   1030 <cubic_convolution@plt>
movsd  %xmm0,0x58(%rsp)
movsd  0xe42(%rip),%xmm0
subsd  0x8(%rsp),%xmm0
cvttsd2si %xmm0,%edi
movsd  (%rsp),%xmm0
call   1030 <cubic_convolution@plt>
movsd  %xmm0,0x30(%rsp)
movsd  0xe28(%rip),%xmm0
subsd  0x8(%rsp),%xmm0
cvttsd2si %xmm0,%edi
movsd  (%rsp),%xmm0
call   1030 <cubic_convolution@plt>
movapd 0x20(%rsp),%xmm1
movsd  0x58(%rsp),%xmm2
mulsd  %xmm1,%xmm2
unpckhpd %xmm1,%xmm1
mulsd  0x40(%rsp),%xmm1
addsd  %xmm2,%xmm1
movapd 0x10(%rsp),%xmm5
mulsd  %xmm5,%xmm0
unpckhpd %xmm5,%xmm5
mulsd  0x30(%rsp),%xmm5
addsd  %xmm1,%xmm5
addsd  %xmm0,%xmm5
movsd  0xdda(%rip),%xmm0
minsd  %xmm5,%xmm0
xorpd  %xmm1,%xmm1
cmpltsd %xmm1,%xmm5
andnpd %xmm0,%xmm5
jmp    133a <cubic+0x22a>
movapd %xmm3,%xmm0
addsd  0xda8(%rip),%xmm0
cvttsd2si %xmm0,%edi
movaps %xmm2,%xmm0
movsd  %xmm3,0x10(%rsp)
call   1030 <cubic_convolution@plt>
movaps %xmm0,0x40(%rsp)
cvttsd2si 0x10(%rsp),%edi
movsd  (%rsp),%xmm0
call   1030 <cubic_convolution@plt>
movaps %xmm0,0x30(%rsp)
movsd  0xd74(%rip),%xmm0
subsd  0x10(%rsp),%xmm0
cvttsd2si %xmm0,%edi
movsd  (%rsp),%xmm0
call   1030 <cubic_convolution@plt>
movaps %xmm0,0x20(%rsp)
movsd  0xd5b(%rip),%xmm0
subsd  0x10(%rsp),%xmm0
cvttsd2si %xmm0,%edi
movsd  (%rsp),%xmm0
call   1030 <cubic_convolution@plt>
movsd  0x8(%rsp),%xmm1
movapd %xmm0,%xmm5
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jne    1344 <cubic+0x234>
jp     1344 <cubic+0x234>
xorps  %xmm1,%xmm1
cvtsi2sdl 0x10(%rbx),%xmm1
xorps  %xmm2,%xmm2
cvtsi2sdl 0x14(%rbx),%xmm2
movapd 0x30(%rsp),%xmm4
mulsd  %xmm2,%xmm4
movapd 0x40(%rsp),%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm4,%xmm3
xorps  %xmm1,%xmm1
cvtsi2sdl 0x18(%rbx),%xmm1
movapd 0x20(%rsp),%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm3,%xmm2
xorps  %xmm1,%xmm1
cvtsi2sdl 0x1c(%rbx),%xmm1
mulsd  %xmm1,%xmm5
addsd  %xmm2,%xmm5
movsd  0xce3(%rip),%xmm1
minsd  %xmm5,%xmm1
cmpltsd %xmm0,%xmm5
andnpd %xmm1,%xmm5
movapd %xmm5,%xmm0
add    $0x60,%rsp
pop    %rbx
ret
movss  0x20(%rbx),%xmm0
movss  0x30(%rbx),%xmm2
unpcklps %xmm0,%xmm2
cvtdq2pd %xmm2,%xmm6
movss  (%rbx),%xmm0
movss  0x10(%rbx),%xmm2
unpcklps %xmm0,%xmm2
cvtdq2pd %xmm2,%xmm0
movss  0x24(%rbx),%xmm2
movss  0x34(%rbx),%xmm3
unpcklps %xmm2,%xmm3
movss  0x4(%rbx),%xmm2
movss  0x14(%rbx),%xmm4
unpcklps %xmm2,%xmm4
cvtdq2pd %xmm4,%xmm2
cvtdq2pd %xmm3,%xmm3
movapd 0x30(%rsp),%xmm4
unpcklpd %xmm4,%xmm4
mulpd  %xmm4,%xmm3
mulpd  %xmm2,%xmm4
movapd 0x40(%rsp),%xmm7
unpcklpd %xmm7,%xmm7
mulpd  %xmm7,%xmm0
addpd  %xmm4,%xmm0
mulpd  %xmm6,%xmm7
addpd  %xmm3,%xmm7
movss  0x28(%rbx),%xmm3
movss  0x38(%rbx),%xmm2
unpcklps %xmm3,%xmm2
movss  0x8(%rbx),%xmm4
movss  0x18(%rbx),%xmm3
unpcklps %xmm4,%xmm3
cvtdq2pd %xmm3,%xmm3
cvtdq2pd %xmm2,%xmm2
movapd 0x20(%rsp),%xmm6
unpcklpd %xmm6,%xmm6
mulpd  %xmm6,%xmm2
addpd  %xmm7,%xmm2
mulpd  %xmm3,%xmm6
addpd  %xmm0,%xmm6
movss  0x2c(%rbx),%xmm0
movss  0x3c(%rbx),%xmm3
unpcklps %xmm0,%xmm3
cvtdq2pd %xmm3,%xmm0
movss  0xc(%rbx),%xmm4
movss  0x1c(%rbx),%xmm3
unpcklps %xmm4,%xmm3
cvtdq2pd %xmm3,%xmm3
unpcklpd %xmm5,%xmm5
mulpd  %xmm5,%xmm3
addpd  %xmm6,%xmm3
movapd %xmm3,0x20(%rsp)
mulpd  %xmm0,%xmm5
addpd  %xmm2,%xmm5
movapd %xmm5,0x10(%rsp)
movsd  (%rsp),%xmm2
jmp    1182 <cubic+0x72>

LLVM IR (-O0):
define double @cubic([4 x i32]* %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca [4 x i32]*
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca [4 x double]
%15 = alloca i32
%16 = alloca double
store [4 x i32]* %0, [4 x i32]** %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double 0.000000e+00, double* %10
store double 0.000000e+00, double* %11
store double 0.000000e+00, double* %12
store double 0.000000e+00, double* %13
store i32 0, i32* %15
%17 = load double, double* %7
%18 = fcmp oeq double %17, 0.000000e+00
br i1 %18, label %19, label %28
19: ; preds = %4
%20 = load double, double* %8
%21 = fcmp oeq double %20, 0.000000e+00
br i1 %21, label %22, label %28
22: ; preds = %19
%23 = load [4 x i32]*, [4 x i32]** %6
%24 = getelementptr inbounds [4 x i32], [4 x i32]* %23, i64 1
%25 = getelementptr inbounds [4 x i32], [4 x i32]* %24, i64 0, i64 1
%26 = load i32, i32* %25
%27 = sitofp i32 %26 to double
store double %27, double* %5
br label %212
28: ; preds = %19, %4
%29 = load double, double* %7
%30 = fcmp oeq double %29, 0.000000e+00
br i1 %30, label %31, label %50
31: ; preds = %28
store i32 0, i32* %15
br label %32
32: ; preds = %46, %31
%33 = load i32, i32* %15
%34 = icmp slt i32 %33, 4
br i1 %34, label %35, label %49
35: ; preds = %32
%36 = load [4 x i32]*, [4 x i32]** %6
%37 = load i32, i32* %15
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [4 x i32], [4 x i32]* %36, i64 %38
%40 = getelementptr inbounds [4 x i32], [4 x i32]* %39, i64 0, i64 1
%41 = load i32, i32* %40
%42 = sitofp i32 %41 to double
%43 = load i32, i32* %15
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [4 x double], [4 x double]* %14, i64 0, i64 %44
store double %42, double* %45
br label %46
46: ; preds = %35
%47 = load i32, i32* %15
%48 = add nsw i32 %47, 1
store i32 %48, i32* %15
br label %32
49: ; preds = %32
br label %163
50: ; preds = %28
%51 = load double, double* %7
%52 = fadd double %51, 1.000000e+00
%53 = fptosi double %52 to i32
%54 = load double, double* %9
%55 = call double @cubic_convolution(i32 %53, double %54)
store double %55, double* %10
%56 = load double, double* %7
%57 = fptosi double %56 to i32
%58 = load double, double* %9
%59 = call double @cubic_convolution(i32 %57, double %58)
store double %59, double* %11
%60 = load double, double* %7
%61 = fsub double 1.000000e+00, %60
%62 = fptosi double %61 to i32
%63 = load double, double* %9
%64 = call double @cubic_convolution(i32 %62, double %63)
store double %64, double* %12
%65 = load double, double* %7
%66 = fsub double 2.000000e+00, %65
%67 = fptosi double %66 to i32
%68 = load double, double* %9
%69 = call double @cubic_convolution(i32 %67, double %68)
store double %69, double* %13
%70 = load double, double* %8
%71 = fcmp oeq double %70, 0.000000e+00
br i1 %71, label %72, label %114
72: ; preds = %50
%73 = load double, double* %10
%74 = load [4 x i32]*, [4 x i32]** %6
%75 = getelementptr inbounds [4 x i32], [4 x i32]* %74, i64 1
%76 = getelementptr inbounds [4 x i32], [4 x i32]* %75, i64 0, i64 0
%77 = load i32, i32* %76
%78 = sitofp i32 %77 to double
%79 = load double, double* %11
%80 = load [4 x i32]*, [4 x i32]** %6
%81 = getelementptr inbounds [4 x i32], [4 x i32]* %80, i64 1
%82 = getelementptr inbounds [4 x i32], [4 x i32]* %81, i64 0, i64 1
%83 = load i32, i32* %82
%84 = sitofp i32 %83 to double
%85 = fmul double %79, %84
%86 = call double @llvm.fmuladd.f64(double %73, double %78, double %85)
%87 = load double, double* %12
%88 = load [4 x i32]*, [4 x i32]** %6
%89 = getelementptr inbounds [4 x i32], [4 x i32]* %88, i64 1
%90 = getelementptr inbounds [4 x i32], [4 x i32]* %89, i64 0, i64 2
%91 = load i32, i32* %90
%92 = sitofp i32 %91 to double
%93 = call double @llvm.fmuladd.f64(double %87, double %92, double %86)
%94 = load double, double* %13
%95 = load [4 x i32]*, [4 x i32]** %6
%96 = getelementptr inbounds [4 x i32], [4 x i32]* %95, i64 1
%97 = getelementptr inbounds [4 x i32], [4 x i32]* %96, i64 0, i64 3
%98 = load i32, i32* %97
%99 = sitofp i32 %98 to double
%100 = call double @llvm.fmuladd.f64(double %94, double %99, double %93)
store double %100, double* %16
%101 = load double, double* %16
%102 = fcmp olt double %101, 0.000000e+00
br i1 %102, label %103, label %104
103: ; preds = %72
br label %112
104: ; preds = %72
%105 = load double, double* %16
%106 = fcmp ogt double %105, 2.550000e+02
br i1 %106, label %107, label %108
107: ; preds = %104
br label %110
108: ; preds = %104
%109 = load double, double* %16
br label %110
110: ; preds = %108, %107
%111 = phi double [ 2.550000e+02, %107 ], [ %109, %108 ]
br label %112
112: ; preds = %110, %103
%113 = phi double [ 0.000000e+00, %103 ], [ %111, %110 ]
store double %113, double* %5
br label %212
114: ; preds = %50
store i32 0, i32* %15
br label %115
115: ; preds = %158, %114
%116 = load i32, i32* %15
%117 = icmp slt i32 %116, 4
br i1 %117, label %118, label %161
118: ; preds = %115
%119 = load double, double* %10
%120 = load [4 x i32]*, [4 x i32]** %6
%121 = load i32, i32* %15
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds [4 x i32], [4 x i32]* %120, i64 %122
%124 = getelementptr inbounds [4 x i32], [4 x i32]* %123, i64 0, i64 0
%125 = load i32, i32* %124
%126 = sitofp i32 %125 to double
%127 = load double, double* %11
%128 = load [4 x i32]*, [4 x i32]** %6
%129 = load i32, i32* %15
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds [4 x i32], [4 x i32]* %128, i64 %130
%132 = getelementptr inbounds [4 x i32], [4 x i32]* %131, i64 0, i64 1
%133 = load i32, i32* %132
%134 = sitofp i32 %133 to double
%135 = fmul double %127, %134
%136 = call double @llvm.fmuladd.f64(double %119, double %126, double %135)
%137 = load double, double* %12
%138 = load [4 x i32]*, [4 x i32]** %6
%139 = load i32, i32* %15
%140 = sext i32 %139 to i64
%141 = getelementptr inbounds [4 x i32], [4 x i32]* %138, i64 %140
%142 = getelementptr inbounds [4 x i32], [4 x i32]* %141, i64 0, i64 2
%143 = load i32, i32* %142
%144 = sitofp i32 %143 to double
%145 = call double @llvm.fmuladd.f64(double %137, double %144, double %136)
%146 = load double, double* %13
%147 = load [4 x i32]*, [4 x i32]** %6
%148 = load i32, i32* %15
%149 = sext i32 %148 to i64
%150 = getelementptr inbounds [4 x i32], [4 x i32]* %147, i64 %149
%151 = getelementptr inbounds [4 x i32], [4 x i32]* %150, i64 0, i64 3
%152 = load i32, i32* %151
%153 = sitofp i32 %152 to double
%154 = call double @llvm.fmuladd.f64(double %146, double %153, double %145)
%155 = load i32, i32* %15
%156 = sext i32 %155 to i64
%157 = getelementptr inbounds [4 x double], [4 x double]* %14, i64 0, i64 %156
store double %154, double* %157
br label %158
158: ; preds = %118
%159 = load i32, i32* %15
%160 = add nsw i32 %159, 1
store i32 %160, i32* %15
br label %115
161: ; preds = %115
br label %162
162: ; preds = %161
br label %163
163: ; preds = %162, %49
%164 = load double, double* %8
%165 = fadd double %164, 1.000000e+00
%166 = fptosi double %165 to i32
%167 = load double, double* %9
%168 = call double @cubic_convolution(i32 %166, double %167)
store double %168, double* %10
%169 = load double, double* %8
%170 = fptosi double %169 to i32
%171 = load double, double* %9
%172 = call double @cubic_convolution(i32 %170, double %171)
store double %172, double* %11
%173 = load double, double* %8
%174 = fsub double 1.000000e+00, %173
%175 = fptosi double %174 to i32
%176 = load double, double* %9
%177 = call double @cubic_convolution(i32 %175, double %176)
store double %177, double* %12
%178 = load double, double* %8
%179 = fsub double 2.000000e+00, %178
%180 = fptosi double %179 to i32
%181 = load double, double* %9
%182 = call double @cubic_convolution(i32 %180, double %181)
store double %182, double* %13
%183 = load double, double* %10
%184 = getelementptr inbounds [4 x double], [4 x double]* %14, i64 0, i64 0
%185 = load double, double* %184
%186 = load double, double* %11
%187 = getelementptr inbounds [4 x double], [4 x double]* %14, i64 0, i64 1
%188 = load double, double* %187
%189 = fmul double %186, %188
%190 = call double @llvm.fmuladd.f64(double %183, double %185, double %189)
%191 = load double, double* %12
%192 = getelementptr inbounds [4 x double], [4 x double]* %14, i64 0, i64 2
%193 = load double, double* %192
%194 = call double @llvm.fmuladd.f64(double %191, double %193, double %190)
%195 = load double, double* %13
%196 = getelementptr inbounds [4 x double], [4 x double]* %14, i64 0, i64 3
%197 = load double, double* %196
%198 = call double @llvm.fmuladd.f64(double %195, double %197, double %194)
store double %198, double* %16
%199 = load double, double* %16
%200 = fcmp olt double %199, 0.000000e+00
br i1 %200, label %201, label %202
201: ; preds = %163
br label %210
202: ; preds = %163
%203 = load double, double* %16
%204 = fcmp ogt double %203, 2.550000e+02
br i1 %204, label %205, label %206
205: ; preds = %202
br label %208
206: ; preds = %202
%207 = load double, double* %16
br label %208
208: ; preds = %206, %205
%209 = phi double [ 2.550000e+02, %205 ], [ %207, %206 ]
br label %210
210: ; preds = %208, %201
%211 = phi double [ 0.000000e+00, %201 ], [ %209, %208 ]
store double %211, double* %5
br label %212
212: ; preds = %210, %112, %22
%213 = load double, double* %5
ret double %213
}

LLVM IR (-O2):
define double @cubic([4 x i32]* nocapture %0, double %1, double %2, double %3) {
%5 = fcmp oeq double %1, 0.000000e+00
%6 = fcmp oeq double %2, 0.000000e+00
%7 = and i1 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 1, i64 1
%10 = load i32, i32* %9
%11 = sitofp i32 %10 to double
br label %150
12: ; preds = %4
br i1 %5, label %13, label %27
13: ; preds = %12
%14 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 0, i64 1
%15 = load i32, i32* %14
%16 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 1, i64 1
%17 = load i32, i32* %16
%18 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 2, i64 1
%19 = load i32, i32* %18
%20 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 3, i64 1
%21 = load i32, i32* %20
%22 = insertelement <4 x i32> poison, i32 %21, i64 0
%23 = insertelement <4 x i32> %22, i32 %19, i64 1
%24 = insertelement <4 x i32> %23, i32 %17, i64 2
%25 = insertelement <4 x i32> %24, i32 %15, i64 3
%26 = sitofp <4 x i32> %25 to <4 x double>
br label %125
27: ; preds = %12
%28 = fadd double %1, 1.000000e+00
%29 = fptosi double %28 to i32
%30 = tail call double @cubic_convolution(i32 %29, double %3)
%31 = fptosi double %1 to i32
%32 = tail call double @cubic_convolution(i32 %31, double %3)
%33 = fsub double 1.000000e+00, %1
%34 = fptosi double %33 to i32
%35 = tail call double @cubic_convolution(i32 %34, double %3)
%36 = fsub double 2.000000e+00, %1
%37 = fptosi double %36 to i32
%38 = tail call double @cubic_convolution(i32 %37, double %3)
br i1 %6, label %104, label %39
39: ; preds = %27
%40 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 0, i64 0
%41 = load i32, i32* %40
%42 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 0, i64 1
%43 = load i32, i32* %42
%44 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 0, i64 2
%45 = load i32, i32* %44
%46 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 0, i64 3
%47 = load i32, i32* %46
%48 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 1, i64 0
%49 = load i32, i32* %48
%50 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 1, i64 1
%51 = load i32, i32* %50
%52 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 1, i64 2
%53 = load i32, i32* %52
%54 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 1, i64 3
%55 = load i32, i32* %54
%56 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 2, i64 0
%57 = load i32, i32* %56
%58 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 2, i64 1
%59 = load i32, i32* %58
%60 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 2, i64 2
%61 = load i32, i32* %60
%62 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 2, i64 3
%63 = load i32, i32* %62
%64 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 3, i64 0
%65 = load i32, i32* %64
%66 = insertelement <4 x i32> poison, i32 %65, i64 0
%67 = insertelement <4 x i32> %66, i32 %57, i64 1
%68 = insertelement <4 x i32> %67, i32 %49, i64 2
%69 = insertelement <4 x i32> %68, i32 %41, i64 3
%70 = sitofp <4 x i32> %69 to <4 x double>
%71 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 3, i64 1
%72 = load i32, i32* %71
%73 = insertelement <4 x i32> poison, i32 %72, i64 0
%74 = insertelement <4 x i32> %73, i32 %59, i64 1
%75 = insertelement <4 x i32> %74, i32 %51, i64 2
%76 = insertelement <4 x i32> %75, i32 %43, i64 3
%77 = sitofp <4 x i32> %76 to <4 x double>
%78 = insertelement <4 x double> poison, double %32, i64 0
%79 = shufflevector <4 x double> %78, <4 x double> poison, <4 x i32> zeroinitializer
%80 = fmul <4 x double> %79, %77
%81 = insertelement <4 x double> poison, double %30, i64 0
%82 = shufflevector <4 x double> %81, <4 x double> poison, <4 x i32> zeroinitializer
%83 = call <4 x double> @llvm.fmuladd.v4f64(<4 x double> %82, <4 x double> %70, <4 x double> %80)
%84 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 3, i64 2
%85 = load i32, i32* %84
%86 = insertelement <4 x i32> poison, i32 %85, i64 0
%87 = insertelement <4 x i32> %86, i32 %61, i64 1
%88 = insertelement <4 x i32> %87, i32 %53, i64 2
%89 = insertelement <4 x i32> %88, i32 %45, i64 3
%90 = sitofp <4 x i32> %89 to <4 x double>
%91 = insertelement <4 x double> poison, double %35, i64 0
%92 = shufflevector <4 x double> %91, <4 x double> poison, <4 x i32> zeroinitializer
%93 = call <4 x double> @llvm.fmuladd.v4f64(<4 x double> %92, <4 x double> %90, <4 x double> %83)
%94 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 3, i64 3
%95 = load i32, i32* %94
%96 = insertelement <4 x i32> poison, i32 %95, i64 0
%97 = insertelement <4 x i32> %96, i32 %63, i64 1
%98 = insertelement <4 x i32> %97, i32 %55, i64 2
%99 = insertelement <4 x i32> %98, i32 %47, i64 3
%100 = sitofp <4 x i32> %99 to <4 x double>
%101 = insertelement <4 x double> poison, double %38, i64 0
%102 = shufflevector <4 x double> %101, <4 x double> poison, <4 x i32> zeroinitializer
%103 = call <4 x double> @llvm.fmuladd.v4f64(<4 x double> %102, <4 x double> %100, <4 x double> %93)
br label %125
104: ; preds = %27
%105 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 1, i64 0
%106 = load i32, i32* %105
%107 = sitofp i32 %106 to double
%108 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 1, i64 1
%109 = load i32, i32* %108
%110 = sitofp i32 %109 to double
%111 = fmul double %32, %110
%112 = tail call double @llvm.fmuladd.f64(double %30, double %107, double %111)
%113 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 1, i64 2
%114 = load i32, i32* %113
%115 = sitofp i32 %114 to double
%116 = tail call double @llvm.fmuladd.f64(double %35, double %115, double %112)
%117 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 1, i64 3
%118 = load i32, i32* %117
%119 = sitofp i32 %118 to double
%120 = tail call double @llvm.fmuladd.f64(double %38, double %119, double %116)
%121 = fcmp olt double %120, 0.000000e+00
%122 = fcmp ogt double %120, 2.550000e+02
%123 = select i1 %122, double 2.550000e+02, double %120
%124 = select i1 %121, double 0.000000e+00, double %123
br label %150
125: ; preds = %39, %13
%126 = phi <4 x double> [ %26, %13 ], [ %103, %39 ]
%127 = fadd double %2, 1.000000e+00
%128 = fptosi double %127 to i32
%129 = tail call double @cubic_convolution(i32 %128, double %3)
%130 = fptosi double %2 to i32
%131 = tail call double @cubic_convolution(i32 %130, double %3)
%132 = fsub double 1.000000e+00, %2
%133 = fptosi double %132 to i32
%134 = tail call double @cubic_convolution(i32 %133, double %3)
%135 = fsub double 2.000000e+00, %2
%136 = fptosi double %135 to i32
%137 = tail call double @cubic_convolution(i32 %136, double %3)
%138 = extractelement <4 x double> %126, i64 2
%139 = fmul double %131, %138
%140 = extractelement <4 x double> %126, i64 3
%141 = tail call double @llvm.fmuladd.f64(double %129, double %140, double %139)
%142 = extractelement <4 x double> %126, i64 1
%143 = tail call double @llvm.fmuladd.f64(double %134, double %142, double %141)
%144 = extractelement <4 x double> %126, i64 0
%145 = tail call double @llvm.fmuladd.f64(double %137, double %144, double %143)
%146 = fcmp olt double %145, 0.000000e+00
%147 = fcmp ogt double %145, 2.550000e+02
%148 = select i1 %147, double 2.550000e+02, double %145
%149 = select i1 %146, double 0.000000e+00, double %148
br label %150
150: ; preds = %125, %104, %8
%151 = phi double [ %11, %8 ], [ %149, %125 ], [ %124, %104 ]
ret double %151
}