#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 fabs(double);
double BsplnDDWght7(long i, double x) {
  double g;
  x = fabs(x - (double)i);
  if (x < 1.0) {
    g = x * x;
    return (g * (g * (x * (7.0 / 24.0) - 5.0 / 6.0) + 4.0 / 3.0) - 2.0 / 3.0);
  }
  if (x < 2.0)
    return (
        x * (x * (x * (x * (1.5 - x * 0.175) - 14.0 / 3.0) + 6.0) - 7.0 / 3.0) -
        0.2);
  if (x < 3.0)
    return (x * (x * (x * (x * (x * (7.0 / 120.0) - 5.0 / 6.0) + 14.0 / 3.0) -
                      38.0 / 3.0) +
                 49.0 / 3.0) -
            23.0 / 3.0);
  if (x < 4.0) {
    x -= 4.0;
    g = x * x;
    return (x * g * g * (-1.0 / 120.0));
  }
  return (0.0);
}


x86 assembly (clang, -O0):
<BsplnDDWght7>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
subsd  %xmm1,%xmm0
movaps 0xf7d(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xecc(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    119f <BsplnDDWght7+0x9f>
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  0xf33(%rip),%xmm3
mulsd  %xmm3,%xmm2
movsd  0xedf(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xf0f(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xef7(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1337 <BsplnDDWght7+0x237>
movsd  0xe61(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1244 <BsplnDDWght7+0x144>
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm3
movsd  -0x18(%rbp),%xmm4
movq   %xmm4,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm4
movsd  0xe8e(%rip),%xmm5
mulsd  %xmm5,%xmm4
movsd  0xe8a(%rip),%xmm5
addsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm3
movsd  0xe6a(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xe52(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe3a(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe22(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1337 <BsplnDDWght7+0x237>
movsd  0xdc4(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    12d2 <BsplnDDWght7+0x1d2>
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm3
movsd  -0x18(%rbp),%xmm4
movsd  0xdd0(%rip),%xmm5
mulsd  %xmm5,%xmm4
movsd  0xdcc(%rip),%xmm5
addsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm3
movsd  0xdac(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xd94(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xd7c(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd64(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1337 <BsplnDDWght7+0x237>
movsd  0xd3e(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    132f <BsplnDDWght7+0x22f>
movsd  -0x18(%rbp),%xmm0
movsd  0xd26(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  0xcff(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1337 <BsplnDDWght7+0x237>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<BsplnDDWght7>:
cvtsi2sd %rdi,%xmm1
subsd  %xmm1,%xmm0
movapd 0xeef(%rip),%xmm2
andpd  %xmm0,%xmm2
movsd  0xef3(%rip),%xmm1
ucomisd %xmm2,%xmm1
jbe    1158 <BsplnDDWght7+0x58>
movsd  0xf75(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xf11(%rip),%xmm1
mulsd  %xmm0,%xmm0
mulsd  %xmm0,%xmm1
addsd  0xf61(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xf5d(%rip),%xmm1
movapd %xmm1,%xmm0
ret
movsd  0xeb8(%rip),%xmm0
ucomisd %xmm2,%xmm0
jbe    11ab <BsplnDDWght7+0xab>
movsd  0xf02(%rip),%xmm0
mulsd  %xmm2,%xmm0
addsd  0xefe(%rip),%xmm0
mulsd  %xmm2,%xmm0
addsd  0xefa(%rip),%xmm0
mulsd  %xmm2,%xmm0
addsd  0xef6(%rip),%xmm0
mulsd  %xmm2,%xmm0
addsd  0xef2(%rip),%xmm0
mulsd  %xmm2,%xmm0
addsd  0xeee(%rip),%xmm0
ret
movsd  0xe6d(%rip),%xmm0
ucomisd %xmm2,%xmm0
jbe    11fe <BsplnDDWght7+0xfe>
movsd  0xe7f(%rip),%xmm0
mulsd  %xmm2,%xmm0
addsd  0xe7b(%rip),%xmm0
mulsd  %xmm2,%xmm0
addsd  0xe77(%rip),%xmm0
mulsd  %xmm2,%xmm0
addsd  0xe73(%rip),%xmm0
mulsd  %xmm2,%xmm0
addsd  0xe6f(%rip),%xmm0
mulsd  %xmm2,%xmm0
addsd  0xe6b(%rip),%xmm0
ret
xorpd  %xmm0,%xmm0
movsd  0xe1e(%rip),%xmm1
ucomisd %xmm2,%xmm1
jbe    1234 <BsplnDDWght7+0x134>
movsd  0xe18(%rip),%xmm0
addsd  %xmm2,%xmm0
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  0xe04(%rip),%xmm0
ret

LLVM IR (-O0):
define double @BsplnDDWght7(i64 %0, double %1) {
%3 = alloca double
%4 = alloca i64
%5 = alloca double
%6 = alloca double
store i64 %0, i64* %4
store double %1, double* %5
%7 = load double, double* %5
%8 = load i64, i64* %4
%9 = sitofp i64 %8 to double
%10 = fsub double %7, %9
%11 = call double @llvm.fabs.f64(double %10)
store double %11, double* %5
%12 = load double, double* %5
%13 = fcmp olt double %12, 1.000000e+00
br i1 %13, label %14, label %24
14: ; preds = %2
%15 = load double, double* %5
%16 = load double, double* %5
%17 = fmul double %15, %16
store double %17, double* %6
%18 = load double, double* %6
%19 = load double, double* %6
%20 = load double, double* %5
%21 = call double @llvm.fmuladd.f64(double %20, double 0x3FD2AAAAAAAAAAAB, double 0xBFEAAAAAAAAAAAAB)
%22 = call double @llvm.fmuladd.f64(double %19, double %21, double 0x3FF5555555555555)
%23 = call double @llvm.fmuladd.f64(double %18, double %22, double 0xBFE5555555555555)
store double %23, double* %3
br label %69
24: ; preds = %2
%25 = load double, double* %5
%26 = fcmp olt double %25, 2.000000e+00
br i1 %26, label %27, label %39
27: ; preds = %24
%28 = load double, double* %5
%29 = load double, double* %5
%30 = load double, double* %5
%31 = load double, double* %5
%32 = load double, double* %5
%33 = fneg double %32
%34 = call double @llvm.fmuladd.f64(double %33, double 1.750000e-01, double 1.500000e+00)
%35 = call double @llvm.fmuladd.f64(double %31, double %34, double 0xC012AAAAAAAAAAAB)
%36 = call double @llvm.fmuladd.f64(double %30, double %35, double 6.000000e+00)
%37 = call double @llvm.fmuladd.f64(double %29, double %36, double 0xC002AAAAAAAAAAAB)
%38 = call double @llvm.fmuladd.f64(double %28, double %37, double -2.000000e-01)
store double %38, double* %3
br label %69
39: ; preds = %24
%40 = load double, double* %5
%41 = fcmp olt double %40, 3.000000e+00
br i1 %41, label %42, label %53
42: ; preds = %39
%43 = load double, double* %5
%44 = load double, double* %5
%45 = load double, double* %5
%46 = load double, double* %5
%47 = load double, double* %5
%48 = call double @llvm.fmuladd.f64(double %47, double 0x3FADDDDDDDDDDDDE, double 0xBFEAAAAAAAAAAAAB)
%49 = call double @llvm.fmuladd.f64(double %46, double %48, double 0x4012AAAAAAAAAAAB)
%50 = call double @llvm.fmuladd.f64(double %45, double %49, double 0xC029555555555555)
%51 = call double @llvm.fmuladd.f64(double %44, double %50, double 0x4030555555555555)
%52 = call double @llvm.fmuladd.f64(double %43, double %51, double 0xC01EAAAAAAAAAAAB)
store double %52, double* %3
br label %69
53: ; preds = %39
%54 = load double, double* %5
%55 = fcmp olt double %54, 4.000000e+00
br i1 %55, label %56, label %68
56: ; preds = %53
%57 = load double, double* %5
%58 = fsub double %57, 4.000000e+00
store double %58, double* %5
%59 = load double, double* %5
%60 = load double, double* %5
%61 = fmul double %59, %60
store double %61, double* %6
%62 = load double, double* %5
%63 = load double, double* %6
%64 = fmul double %62, %63
%65 = load double, double* %6
%66 = fmul double %64, %65
%67 = fmul double %66, 0xBF81111111111111
store double %67, double* %3
br label %69
68: ; preds = %53
store double 0.000000e+00, double* %3
br label %69
69: ; preds = %68, %56, %42, %27, %14
%70 = load double, double* %3
ret double %70
}

LLVM IR (-O2):
define double @BsplnDDWght7(i64 %0, double %1) {
%3 = sitofp i64 %0 to double
%4 = fsub double %1, %3
%5 = tail call double @llvm.fabs.f64(double %4)
%6 = fcmp olt double %5, 1.000000e+00
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = fmul double %4, %4
%9 = tail call double @llvm.fmuladd.f64(double %5, double 0x3FD2AAAAAAAAAAAB, double 0xBFEAAAAAAAAAAAAB)
%10 = tail call double @llvm.fmuladd.f64(double %8, double %9, double 0x3FF5555555555555)
%11 = tail call double @llvm.fmuladd.f64(double %8, double %10, double 0xBFE5555555555555)
br label %37
12: ; preds = %2
%13 = fcmp olt double %5, 2.000000e+00
br i1 %13, label %14, label %21
14: ; preds = %12
%15 = fneg double %5
%16 = tail call double @llvm.fmuladd.f64(double %15, double 1.750000e-01, double 1.500000e+00)
%17 = tail call double @llvm.fmuladd.f64(double %5, double %16, double 0xC012AAAAAAAAAAAB)
%18 = tail call double @llvm.fmuladd.f64(double %5, double %17, double 6.000000e+00)
%19 = tail call double @llvm.fmuladd.f64(double %5, double %18, double 0xC002AAAAAAAAAAAB)
%20 = tail call double @llvm.fmuladd.f64(double %5, double %19, double -2.000000e-01)
br label %37
21: ; preds = %12
%22 = fcmp olt double %5, 3.000000e+00
br i1 %22, label %23, label %29
23: ; preds = %21
%24 = tail call double @llvm.fmuladd.f64(double %5, double 0x3FADDDDDDDDDDDDE, double 0xBFEAAAAAAAAAAAAB)
%25 = tail call double @llvm.fmuladd.f64(double %5, double %24, double 0x4012AAAAAAAAAAAB)
%26 = tail call double @llvm.fmuladd.f64(double %5, double %25, double 0xC029555555555555)
%27 = tail call double @llvm.fmuladd.f64(double %5, double %26, double 0x4030555555555555)
%28 = tail call double @llvm.fmuladd.f64(double %5, double %27, double 0xC01EAAAAAAAAAAAB)
br label %37
29: ; preds = %21
%30 = fcmp olt double %5, 4.000000e+00
br i1 %30, label %31, label %37
31: ; preds = %29
%32 = fadd double %5, -4.000000e+00
%33 = fmul double %32, %32
%34 = fmul double %32, %33
%35 = fmul double %33, %34
%36 = fmul double %35, 0xBF81111111111111
br label %37
37: ; preds = %29, %31, %23, %14, %7
%38 = phi double [ %11, %7 ], [ %20, %14 ], [ %28, %23 ], [ %36, %31 ], [ 0.000000e+00, %29 ]
ret double %38
}