#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 BsplnWght6(long i, double x) {
  x = fabs(x - (double)i);
  if (x < 0.5) {
    x *= x;
    return (x * (x * (7.0 / 48.0 - x * (1.0 / 36.0)) - 77.0 / 192.0) +
            5887.0 / 11520.0);
  }
  if (x < 1.5)
    return (
        x * (x * (x * (x * (x * (x * (1.0 / 48.0) - 7.0 / 48.0) + 0.328125) -
                       35.0 / 288.0) -
                  91.0 / 256.0) -
             7.0 / 768.0) +
        7861.0 / 15360.0);
  if (x < 2.5)
    return (
        x * (x * (x * (x * (x * (7.0 / 60.0 - x * (1.0 / 120.0)) - 0.65625) +
                       133.0 / 72.0) -
                  2.5703125) +
             1267.0 / 960.0) +
        1379.0 / 7680.0);
  if (x < 3.5) {
    x -= 3.5;
    x *= x * x;
    return (x * x * (1.0 / 720.0));
  }
  return (0.0);
}


x86 assembly (clang, -O0):
<BsplnWght6>:
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 0xf9d(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xecc(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    11b6 <BsplnWght6+0xb6>
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
movsd  0xf2c(%rip),%xmm3
mulsd  %xmm3,%xmm2
movsd  0xf28(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xf08(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xef0(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1378 <BsplnWght6+0x278>
movsd  0xe4a(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1259 <BsplnWght6+0x159>
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm3
movsd  -0x18(%rbp),%xmm4
movsd  -0x18(%rbp),%xmm5
movsd  0xe99(%rip),%xmm6
mulsd  %xmm6,%xmm5
movsd  0xe95(%rip),%xmm6
addsd  %xmm6,%xmm5
mulsd  %xmm5,%xmm4
movsd  0xe75(%rip),%xmm5
addsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm3
movsd  0xe5d(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xe45(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe2d(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe15(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1378 <BsplnWght6+0x278>
movsd  0xdaf(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1313 <BsplnWght6+0x213>
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm3
movsd  -0x18(%rbp),%xmm4
movsd  -0x18(%rbp),%xmm5
movq   %xmm5,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm5
movsd  0xda7(%rip),%xmm6
mulsd  %xmm6,%xmm5
movsd  0xda3(%rip),%xmm6
addsd  %xmm6,%xmm5
mulsd  %xmm5,%xmm4
movsd  0xd83(%rip),%xmm5
addsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm3
movsd  0xd6b(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xd53(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xd3b(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd23(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1378 <BsplnWght6+0x278>
movsd  0xcfd(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1370 <BsplnWght6+0x270>
movsd  -0x18(%rbp),%xmm0
movsd  0xce5(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  0xcbe(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1378 <BsplnWght6+0x278>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<BsplnWght6>:
cvtsi2sd %rdi,%xmm1
subsd  %xmm1,%xmm0
movapd 0xeef(%rip),%xmm1
andpd  %xmm0,%xmm1
movsd  0xef3(%rip),%xmm2
ucomisd %xmm1,%xmm2
jbe    1158 <BsplnWght6+0x58>
mulsd  %xmm0,%xmm0
movsd  0xf81(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xf7d(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xf79(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xf75(%rip),%xmm1
movapd %xmm1,%xmm0
ret
movsd  0xeb8(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11b7 <BsplnWght6+0xb7>
movsd  0xf0a(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xf06(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xf02(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xefe(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xefa(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xef6(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xef2(%rip),%xmm0
ret
movsd  0xe61(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1216 <BsplnWght6+0x116>
movsd  0xe73(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xe6f(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xe6b(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xe67(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xe63(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xe5f(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xe5b(%rip),%xmm0
ret
xorpd  %xmm0,%xmm0
movsd  0xe06(%rip),%xmm2
ucomisd %xmm1,%xmm2
jbe    1248 <BsplnWght6+0x148>
addsd  0xe00(%rip),%xmm1
movapd %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm0,%xmm0
mulsd  0xdf0(%rip),%xmm0
ret

LLVM IR (-O0):
define double @BsplnWght6(i64 %0, double %1) {
%3 = alloca double
%4 = alloca i64
%5 = alloca double
store i64 %0, i64* %4
store double %1, double* %5
%6 = load double, double* %5
%7 = load i64, i64* %4
%8 = sitofp i64 %7 to double
%9 = fsub double %6, %8
%10 = call double @llvm.fabs.f64(double %9)
store double %10, double* %5
%11 = load double, double* %5
%12 = fcmp olt double %11, 5.000000e-01
br i1 %12, label %13, label %24
13: ; preds = %2
%14 = load double, double* %5
%15 = load double, double* %5
%16 = fmul double %15, %14
store double %16, double* %5
%17 = load double, double* %5
%18 = load double, double* %5
%19 = load double, double* %5
%20 = fneg double %19
%21 = call double @llvm.fmuladd.f64(double %20, double 0x3F9C71C71C71C71C, double 0x3FC2AAAAAAAAAAAB)
%22 = call double @llvm.fmuladd.f64(double %18, double %21, double 0xBFD9AAAAAAAAAAAB)
%23 = call double @llvm.fmuladd.f64(double %17, double %22, double 0x3FE05A4FA4FA4FA5)
store double %23, double* %3
br label %73
24: ; preds = %2
%25 = load double, double* %5
%26 = fcmp olt double %25, 1.500000e+00
br i1 %26, label %27, label %40
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 = load double, double* %5
%34 = call double @llvm.fmuladd.f64(double %33, double 0x3F95555555555555, double 0xBFC2AAAAAAAAAAAB)
%35 = call double @llvm.fmuladd.f64(double %32, double %34, double 3.281250e-01)
%36 = call double @llvm.fmuladd.f64(double %31, double %35, double 0xBFBF1C71C71C71C7)
%37 = call double @llvm.fmuladd.f64(double %30, double %36, double 0xBFD6C00000000000)
%38 = call double @llvm.fmuladd.f64(double %29, double %37, double 0xBF82AAAAAAAAAAAB)
%39 = call double @llvm.fmuladd.f64(double %28, double %38, double 0x3FE0608888888889)
store double %39, double* %3
br label %73
40: ; preds = %24
%41 = load double, double* %5
%42 = fcmp olt double %41, 2.500000e+00
br i1 %42, label %43, label %57
43: ; preds = %40
%44 = load double, double* %5
%45 = load double, double* %5
%46 = load double, double* %5
%47 = load double, double* %5
%48 = load double, double* %5
%49 = load double, double* %5
%50 = fneg double %49
%51 = call double @llvm.fmuladd.f64(double %50, double 0x3F81111111111111, double 0x3FBDDDDDDDDDDDDE)
%52 = call double @llvm.fmuladd.f64(double %48, double %51, double -6.562500e-01)
%53 = call double @llvm.fmuladd.f64(double %47, double %52, double 0x3FFD8E38E38E38E4)
%54 = call double @llvm.fmuladd.f64(double %46, double %53, double 0xC004900000000000)
%55 = call double @llvm.fmuladd.f64(double %45, double %54, double 0x3FF51DDDDDDDDDDE)
%56 = call double @llvm.fmuladd.f64(double %44, double %55, double 0x3FC6FBBBBBBBBBBC)
store double %56, double* %3
br label %73
57: ; preds = %40
%58 = load double, double* %5
%59 = fcmp olt double %58, 3.500000e+00
br i1 %59, label %60, label %72
60: ; preds = %57
%61 = load double, double* %5
%62 = fsub double %61, 3.500000e+00
store double %62, double* %5
%63 = load double, double* %5
%64 = load double, double* %5
%65 = fmul double %63, %64
%66 = load double, double* %5
%67 = fmul double %66, %65
store double %67, double* %5
%68 = load double, double* %5
%69 = load double, double* %5
%70 = fmul double %68, %69
%71 = fmul double %70, 0x3F56C16C16C16C17
store double %71, double* %3
br label %73
72: ; preds = %57
store double 0.000000e+00, double* %3
br label %73
73: ; preds = %72, %60, %43, %27, %13
%74 = load double, double* %3
ret double %74
}

LLVM IR (-O2):
define double @BsplnWght6(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, 5.000000e-01
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = fmul double %4, %4
%9 = fneg double %8
%10 = tail call double @llvm.fmuladd.f64(double %9, double 0x3F9C71C71C71C71C, double 0x3FC2AAAAAAAAAAAB)
%11 = tail call double @llvm.fmuladd.f64(double %8, double %10, double 0xBFD9AAAAAAAAAAAB)
%12 = tail call double @llvm.fmuladd.f64(double %8, double %11, double 0x3FE05A4FA4FA4FA5)
br label %40
13: ; preds = %2
%14 = fcmp olt double %5, 1.500000e+00
br i1 %14, label %15, label %22
15: ; preds = %13
%16 = tail call double @llvm.fmuladd.f64(double %5, double 0x3F95555555555555, double 0xBFC2AAAAAAAAAAAB)
%17 = tail call double @llvm.fmuladd.f64(double %5, double %16, double 3.281250e-01)
%18 = tail call double @llvm.fmuladd.f64(double %5, double %17, double 0xBFBF1C71C71C71C7)
%19 = tail call double @llvm.fmuladd.f64(double %5, double %18, double 0xBFD6C00000000000)
%20 = tail call double @llvm.fmuladd.f64(double %5, double %19, double 0xBF82AAAAAAAAAAAB)
%21 = tail call double @llvm.fmuladd.f64(double %5, double %20, double 0x3FE0608888888889)
br label %40
22: ; preds = %13
%23 = fcmp olt double %5, 2.500000e+00
br i1 %23, label %24, label %32
24: ; preds = %22
%25 = fneg double %5
%26 = tail call double @llvm.fmuladd.f64(double %25, double 0x3F81111111111111, double 0x3FBDDDDDDDDDDDDE)
%27 = tail call double @llvm.fmuladd.f64(double %5, double %26, double -6.562500e-01)
%28 = tail call double @llvm.fmuladd.f64(double %5, double %27, double 0x3FFD8E38E38E38E4)
%29 = tail call double @llvm.fmuladd.f64(double %5, double %28, double 0xC004900000000000)
%30 = tail call double @llvm.fmuladd.f64(double %5, double %29, double 0x3FF51DDDDDDDDDDE)
%31 = tail call double @llvm.fmuladd.f64(double %5, double %30, double 0x3FC6FBBBBBBBBBBC)
br label %40
32: ; preds = %22
%33 = fcmp olt double %5, 3.500000e+00
br i1 %33, label %34, label %40
34: ; preds = %32
%35 = fadd double %5, -3.500000e+00
%36 = fmul double %35, %35
%37 = fmul double %35, %36
%38 = fmul double %37, %37
%39 = fmul double %38, 0x3F56C16C16C16C17
br label %40
40: ; preds = %32, %34, %24, %15, %7
%41 = phi double [ %12, %7 ], [ %21, %15 ], [ %31, %24 ], [ %39, %34 ], [ 0.000000e+00, %32 ]
ret double %41
}