#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 */
scalar_t__ M_PI;
float cosf(float);
float blackman(float n, float N, float a) {
  return 0.5f * (1.0f - a) - 0.5f * cosf(2.0f * (float)M_PI * n / (N - 1.0f)) +
         0.5f * a * cosf(4.0f * (float)M_PI * n / (N - 1.0f));
}


x86 assembly (clang, -O0):
<blackman>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  0xed1(%rip),%xmm0
subss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    0x2ea8(%rip),%rax
cvtsi2ssq (%rax),%xmm1
movss  0xebf(%rip),%xmm0
mulss  %xmm1,%xmm0
mulss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  0xe9d(%rip),%xmm2
subss  %xmm2,%xmm1
divss  %xmm1,%xmm0
call   1030 <cosf@plt>
movaps %xmm0,%xmm2
movss  -0x18(%rbp),%xmm0
movss  0xe88(%rip),%xmm1
mulss  %xmm2,%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
movss  0xe6f(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xe5a(%rip),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    0x2e29(%rip),%rax
cvtsi2ssq (%rax),%xmm1
movss  0xe38(%rip),%xmm0
mulss  %xmm1,%xmm0
mulss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  0xe1e(%rip),%xmm2
subss  %xmm2,%xmm1
divss  %xmm1,%xmm0
call   1030 <cosf@plt>
movss  -0x14(%rbp),%xmm1
movaps %xmm0,%xmm2
movss  -0x10(%rbp),%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blackman>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm2,0x4(%rsp)
movaps %xmm0,%xmm3
movss  %xmm0,0xc(%rsp)
movss  0xed4(%rip),%xmm0
subss  %xmm2,%xmm0
movss  %xmm0,(%rsp)
mov    0x2eac(%rip),%rbx
xorps  %xmm0,%xmm0
cvtsi2ssq (%rbx),%xmm0
addss  %xmm0,%xmm0
mulss  %xmm3,%xmm0
addss  0xeb0(%rip),%xmm1
movss  %xmm1,0x8(%rsp)
divss  %xmm1,%xmm0
call   1030 <cosf@plt>
mulss  0xe9d(%rip),%xmm0
movss  0xe99(%rip),%xmm2
movss  (%rsp),%xmm1
mulss  %xmm2,%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,(%rsp)
movss  0x4(%rsp),%xmm1
mulss  %xmm2,%xmm1
movss  %xmm1,0x4(%rsp)
xorps  %xmm0,%xmm0
cvtsi2ssq (%rbx),%xmm0
mulss  0xe6b(%rip),%xmm0
mulss  0xc(%rsp),%xmm0
divss  0x8(%rsp),%xmm0
call   1030 <cosf@plt>
mulss  0x4(%rsp),%xmm0
addss  (%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@M_PI = global i64 0
define float @blackman(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %6
%8 = fsub float 1.000000e+00, %7
%9 = load i64, i64* @M_PI
%10 = sitofp i64 %9 to float
%11 = fmul float 2.000000e+00, %10
%12 = load float, float* %4
%13 = fmul float %11, %12
%14 = load float, float* %5
%15 = fsub float %14, 1.000000e+00
%16 = fdiv float %13, %15
%17 = call float @cosf(float %16)
%18 = fmul float 5.000000e-01, %17
%19 = fneg float %18
%20 = call float @llvm.fmuladd.f32(float 5.000000e-01, float %8, float %19)
%21 = load float, float* %6
%22 = fmul float 5.000000e-01, %21
%23 = load i64, i64* @M_PI
%24 = sitofp i64 %23 to float
%25 = fmul float 4.000000e+00, %24
%26 = load float, float* %4
%27 = fmul float %25, %26
%28 = load float, float* %5
%29 = fsub float %28, 1.000000e+00
%30 = fdiv float %27, %29
%31 = call float @cosf(float %30)
%32 = call float @llvm.fmuladd.f32(float %22, float %31, float %20)
ret float %32
}

LLVM IR (-O2):
@M_PI = global i64 0
define float @blackman(float %0, float %1, float %2) {
%4 = fsub float 1.000000e+00, %2
%5 = load i64, i64* @M_PI
%6 = sitofp i64 %5 to float
%7 = fmul float %6, 2.000000e+00
%8 = fmul float %7, %0
%9 = fadd float %1, -1.000000e+00
%10 = fdiv float %8, %9
%11 = tail call float @cosf(float %10)
%12 = fmul float %11, -5.000000e-01
%13 = tail call float @llvm.fmuladd.f32(float %4, float 5.000000e-01, float %12)
%14 = fmul float %2, 5.000000e-01
%15 = load i64, i64* @M_PI
%16 = sitofp i64 %15 to float
%17 = fmul float %16, 4.000000e+00
%18 = fmul float %17, %0
%19 = fdiv float %18, %9
%20 = tail call float @cosf(float %19)
%21 = tail call float @llvm.fmuladd.f32(float %14, float %20, float %13)
ret float %21
}