#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 sinc(double);
double Lanczos3_filter(double t) {
  if (t < 0)
    t = -t;
  if (t < 3.0)
    return (sinc(t) * sinc(t / 3.0));
  return (0.0);
}


x86 assembly (clang, -O0):
<Lanczos3_filter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    114c <Lanczos3_filter+0x3c>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xeac(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    119a <Lanczos3_filter+0x8a>
movsd  -0x10(%rbp),%xmm0
call   1030 <sinc@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe85(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <sinc@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11a2 <Lanczos3_filter+0x92>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Lanczos3_filter>:
sub    $0x28,%rsp
movapd %xmm0,%xmm1
movapd 0xee0(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm0,%xmm0
movapd %xmm1,%xmm3
cmpltsd %xmm0,%xmm3
andpd  %xmm3,%xmm2
andnpd %xmm1,%xmm3
orpd   %xmm2,%xmm3
movsd  0xecb(%rip),%xmm1
ucomisd %xmm3,%xmm1
jbe    1179 <Lanczos3_filter+0x69>
movapd %xmm3,%xmm0
movapd %xmm3,0x10(%rsp)
call   1030 <sinc@plt>
movsd  %xmm0,0x8(%rsp)
movapd 0x10(%rsp),%xmm0
divsd  0xea2(%rip),%xmm0
call   1030 <sinc@plt>
mulsd  0x8(%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @Lanczos3_filter(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %3
%8 = fneg double %7
store double %8, double* %3
br label %9
9: ; preds = %6, %1
%10 = load double, double* %3
%11 = fcmp olt double %10, 3.000000e+00
br i1 %11, label %12, label %19
12: ; preds = %9
%13 = load double, double* %3
%14 = call double @sinc(double %13)
%15 = load double, double* %3
%16 = fdiv double %15, 3.000000e+00
%17 = call double @sinc(double %16)
%18 = fmul double %14, %17
store double %18, double* %2
br label %20
19: ; preds = %9
store double 0.000000e+00, double* %2
br label %20
20: ; preds = %19, %12
%21 = load double, double* %2
ret double %21
}

LLVM IR (-O2):
define double @Lanczos3_filter(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
%5 = fcmp olt double %4, 3.000000e+00
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = tail call double @sinc(double %4)
%8 = fdiv double %4, 3.000000e+00
%9 = tail call double @sinc(double %8)
%10 = fmul double %7, %9
br label %11
11: ; preds = %1, %6
%12 = phi double [ %10, %6 ], [ 0.000000e+00, %1 ]
ret double %12
}