#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 */
float loglogbesseli0(float);
float powf(float, float);
float sqrtf(int);
float kaiser(unsigned int _n, unsigned int _N, float _beta) {
  float t = (float)_n - (float)(_N - 1) / 2;
  float r = 2.0f * t / (float)(_N);
  float log2a = powf(2.0f, loglogbesseli0(_beta * sqrtf(1 - r * r)));
  float log2b = powf(2.0f, loglogbesseli0(_beta));
  float w = powf(2.0f, log2a - log2b);
  return w;
}


x86 assembly (clang, -O0):
<kaiser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2ss %rax,%xmm0
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
cvtsi2ss %rax,%xmm1
movss  0xeaa(%rip),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
addss  %xmm0,%xmm0
mov    -0x8(%rbp),%eax
cvtsi2ss %rax,%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x14(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm1,%xmm0
movss  0xe52(%rip),%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%edi
call   1050 <sqrtf@plt>
movaps %xmm0,%xmm1
movss  -0x24(%rbp),%xmm0
mulss  %xmm1,%xmm0
call   1040 <loglogbesseli0@plt>
movaps %xmm0,%xmm1
movss  0xe25(%rip),%xmm0
call   1030 <powf@plt>
movss  %xmm0,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
call   1040 <loglogbesseli0@plt>
movaps %xmm0,%xmm1
movss  0xe06(%rip),%xmm0
call   1030 <powf@plt>
movss  %xmm0,-0x1c(%rbp)
movss  -0x18(%rbp),%xmm1
subss  -0x1c(%rbp),%xmm1
movss  0xdea(%rip),%xmm0
call   1030 <powf@plt>
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kaiser>:
push   %rax
mov    %edi,%eax
cvtsi2ss %rax,%xmm1
lea    -0x1(%rsi),%eax
cvtsi2ss %rax,%xmm2
movss  %xmm0,(%rsp)
mulss  0xeb3(%rip),%xmm2
mov    %esi,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
addss  %xmm1,%xmm2
addss  %xmm2,%xmm2
divss  %xmm0,%xmm2
mulss  %xmm2,%xmm2
movss  0xe95(%rip),%xmm0
subss  %xmm2,%xmm0
cvttss2si %xmm0,%edi
call   1050 <sqrtf@plt>
mulss  (%rsp),%xmm0
call   1030 <loglogbesseli0@plt>
call   1040 <exp2f@plt>
movss  %xmm0,0x4(%rsp)
movss  (%rsp),%xmm0
call   1030 <loglogbesseli0@plt>
call   1040 <exp2f@plt>
movss  0x4(%rsp),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
jmp    1040 <exp2f@plt>

LLVM IR (-O0):
define float @kaiser(i32 %0, i32 %1, float %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
store i32 %0, i32* %4
store i32 %1, i32* %5
store float %2, float* %6
%12 = load i32, i32* %4
%13 = uitofp i32 %12 to float
%14 = load i32, i32* %5
%15 = sub i32 %14, 1
%16 = uitofp i32 %15 to float
%17 = fdiv float %16, 2.000000e+00
%18 = fsub float %13, %17
store float %18, float* %7
%19 = load float, float* %7
%20 = fmul float 2.000000e+00, %19
%21 = load i32, i32* %5
%22 = uitofp i32 %21 to float
%23 = fdiv float %20, %22
store float %23, float* %8
%24 = load float, float* %6
%25 = load float, float* %8
%26 = load float, float* %8
%27 = fneg float %25
%28 = call float @llvm.fmuladd.f32(float %27, float %26, float 1.000000e+00)
%29 = fptosi float %28 to i32
%30 = call float @sqrtf(i32 %29)
%31 = fmul float %24, %30
%32 = call float @loglogbesseli0(float %31)
%33 = call float @powf(float 2.000000e+00, float %32)
store float %33, float* %9
%34 = load float, float* %6
%35 = call float @loglogbesseli0(float %34)
%36 = call float @powf(float 2.000000e+00, float %35)
store float %36, float* %10
%37 = load float, float* %9
%38 = load float, float* %10
%39 = fsub float %37, %38
%40 = call float @powf(float 2.000000e+00, float %39)
store float %40, float* %11
%41 = load float, float* %11
ret float %41
}

LLVM IR (-O2):
define float @kaiser(i32 %0, i32 %1, float %2) {
%4 = uitofp i32 %0 to float
%5 = add i32 %1, -1
%6 = uitofp i32 %5 to float
%7 = fmul float %6, 5.000000e-01
%8 = fsub float %4, %7
%9 = fmul float %8, 2.000000e+00
%10 = uitofp i32 %1 to float
%11 = fdiv float %9, %10
%12 = fneg float %11
%13 = tail call float @llvm.fmuladd.f32(float %12, float %11, float 1.000000e+00)
%14 = fptosi float %13 to i32
%15 = tail call float @sqrtf(i32 %14)
%16 = fmul float %15, %2
%17 = tail call float @loglogbesseli0(float %16)
%18 = tail call float @exp2f(float %17)
%19 = tail call float @loglogbesseli0(float %2)
%20 = tail call float @exp2f(float %19)
%21 = fsub float %18, %20
%22 = tail call float @exp2f(float %21)
ret float %22
}