void halfSincKaiser(double *win, int L, double fc, double alpha) {
  int i, minus1 = L - 1;
  for (i = 0; i < L >> 1; ++i) {
    double filter = fc * sinc(fc * ((0.5 + i) - L * 0.5));
    win[i] = filter * getKaiser((double)(2 * i - minus1) / minus1, alpha);
  }
}


x86 assembly (clang, -O0):
<halfSincKaiser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x28(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    $0x1,%ecx
cmp    %ecx,%eax
jge    1217 <halfSincKaiser+0xf7>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x18(%rbp),%xmm0
cvtsi2sdl -0x24(%rbp),%xmm1
movsd  0xe8a(%rip),%xmm2
addsd  %xmm1,%xmm2
cvtsi2sdl -0xc(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xe62(%rip),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    $0x1,%al
call   1040 <sinc@plt>
movsd  -0x40(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x24(%rbp),%eax
shl    $0x1,%eax
sub    -0x28(%rbp),%eax
cvtsi2sd %eax,%xmm0
cvtsi2sdl -0x28(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
mov    $0x2,%al
call   1030 <getKaiser@plt>
movsd  -0x38(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1149 <halfSincKaiser+0x29>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<halfSincKaiser>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x38,%rsp
movsd  %xmm1,0x10(%rsp)
cmp    $0x2,%esi
jl     11f0 <halfSincKaiser+0xd0>
movapd %xmm0,%xmm1
mov    %rdi,%r14
lea    -0x1(%rsi),%eax
mov    %esi,%r15d
xorps  %xmm0,%xmm0
cvtsi2sd %esi,%xmm0
xorpd  0xeab(%rip),%xmm0
shr    %r15d
cvtsi2sd %eax,%xmm2
movsd  %xmm2,0x8(%rsp)
mov    $0x1,%ebp
sub    %esi,%ebp
xor    %ebx,%ebx
mulsd  0xe9d(%rip),%xmm0
movapd %xmm0,0x20(%rsp)
movsd  %xmm1,(%rsp)
xchg   %ax,%ax
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
addsd  0xe81(%rip),%xmm0
addsd  0x20(%rsp),%xmm0
mulsd  %xmm1,%xmm0
mov    $0x1,%al
call   1040 <sinc@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  (%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
divsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mov    $0x2,%al
call   1030 <getKaiser@plt>
movsd  (%rsp),%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x18(%rsp),%xmm0
movsd  %xmm0,(%r14,%rbx,8)
add    $0x1,%rbx
add    $0x2,%ebp
cmp    %rbx,%r15
jne    1180 <halfSincKaiser+0x60>
add    $0x38,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @halfSincKaiser(double* %0, i32 %1, double %2, double %3) {
%5 = alloca double*
%6 = alloca i32
%7 = alloca double
%8 = alloca double
%9 = alloca i32
%10 = alloca i32
%11 = alloca double
store double* %0, double** %5
store i32 %1, i32* %6
store double %2, double* %7
store double %3, double* %8
%12 = load i32, i32* %6
%13 = sub nsw i32 %12, 1
store i32 %13, i32* %10
store i32 0, i32* %9
br label %14
14: ; preds = %50, %4
%15 = load i32, i32* %9
%16 = load i32, i32* %6
%17 = ashr i32 %16, 1
%18 = icmp slt i32 %15, %17
br i1 %18, label %19, label %53
19: ; preds = %14
%20 = load double, double* %7
%21 = load double, double* %7
%22 = load i32, i32* %9
%23 = sitofp i32 %22 to double
%24 = fadd double 5.000000e-01, %23
%25 = load i32, i32* %6
%26 = sitofp i32 %25 to double
%27 = fneg double %26
%28 = call double @llvm.fmuladd.f64(double %27, double 5.000000e-01, double %24)
%29 = fmul double %21, %28
%30 = call i32 (double, ...) bitcast (i32 (...)* @sinc to i32 (double, ...)*)(double %29)
%31 = sitofp i32 %30 to double
%32 = fmul double %20, %31
store double %32, double* %11
%33 = load double, double* %11
%34 = load i32, i32* %9
%35 = mul nsw i32 2, %34
%36 = load i32, i32* %10
%37 = sub nsw i32 %35, %36
%38 = sitofp i32 %37 to double
%39 = load i32, i32* %10
%40 = sitofp i32 %39 to double
%41 = fdiv double %38, %40
%42 = load double, double* %8
%43 = call i32 (double, double, ...) bitcast (i32 (...)* @getKaiser to i32 (double, double, ...)*)(double %41, double %42)
%44 = sitofp i32 %43 to double
%45 = fmul double %33, %44
%46 = load double*, double** %5
%47 = load i32, i32* %9
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds double, double* %46, i64 %48
store double %45, double* %49
br label %50
50: ; preds = %19
%51 = load i32, i32* %9
%52 = add nsw i32 %51, 1
store i32 %52, i32* %9
br label %14
53: ; preds = %14
ret void
}

LLVM IR (-O2):
define void @halfSincKaiser(double* nocapture writeonly %0, i32 %1, double %2, double %3) {
%5 = add nsw i32 %1, -1
%6 = icmp sgt i32 %1, 1
br i1 %6, label %7, label %34
7: ; preds = %4
%8 = lshr i32 %1, 1
%9 = sitofp i32 %1 to double
%10 = fneg double %9
%11 = sitofp i32 %5 to double
%12 = zext i32 %8 to i64
br label %13
13: ; preds = %7, %13
%14 = phi i64 [ 0, %7 ], [ %32, %13 ]
%15 = trunc i64 %14 to i32
%16 = sitofp i32 %15 to double
%17 = fadd double %16, 5.000000e-01
%18 = tail call double @llvm.fmuladd.f64(double %10, double 5.000000e-01, double %17)
%19 = fmul double %18, %2
%20 = tail call i32 (double, ...) bitcast (i32 (...)* @sinc to i32 (double, ...)*)(double %19)
%21 = sitofp i32 %20 to double
%22 = fmul double %21, %2
%23 = trunc i64 %14 to i32
%24 = shl i32 %23, 1
%25 = sub i32 %24, %5
%26 = sitofp i32 %25 to double
%27 = fdiv double %26, %11
%28 = tail call i32 (double, double, ...) bitcast (i32 (...)* @getKaiser to i32 (double, double, ...)*)(double %27, double %3)
%29 = sitofp i32 %28 to double
%30 = fmul double %22, %29
%31 = getelementptr inbounds double, double* %0, i64 %14
store double %30, double* %31
%32 = add nuw nsw i64 %14, 1
%33 = icmp eq i64 %32, %12
br i1 %33, label %34, label %13
34: ; preds = %13, %4
ret void
}