#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 sinx(float, float);
float window_hann_mag(float pidetune, float sinpidetune) {
  return (0.5 * sinx(pidetune, sinpidetune) -
          0.5 * 0.5 *
              (sinx(pidetune + 3.14159265, sinpidetune) +
               sinx(pidetune - 3.14159265, sinpidetune)));
}


x86 assembly (clang, -O0):
<window_hann_mag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <sinx@plt>
movsd  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec9(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <sinx@plt>
movsd  %xmm0,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea1(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <sinx@plt>
movsd  -0x18(%rbp),%xmm2
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
addsd  %xmm1,%xmm2
movsd  0xe6e(%rip),%xmm1
mulsd  %xmm2,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xe43(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<window_hann_mag>:
sub    $0x28,%rsp
movss  %xmm1,0xc(%rsp)
movss  %xmm0,0x10(%rsp)
call   1030 <sinx@plt>
movsd  %xmm0,0x20(%rsp)
movss  0x10(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  %xmm1,0x18(%rsp)
movsd  0xeba(%rip),%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  0xc(%rsp),%xmm1
call   1030 <sinx@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x18(%rsp),%xmm0
addsd  0xe9b(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  0xc(%rsp),%xmm1
call   1030 <sinx@plt>
addsd  0x10(%rsp),%xmm0
mulsd  0xe86(%rip),%xmm0
movsd  0x20(%rsp),%xmm1
mulsd  0xe80(%rip),%xmm1
addsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define float @window_hann_mag(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call double @sinx(float %5, float %6)
%8 = load float, float* %3
%9 = fpext float %8 to double
%10 = fadd double %9, 0x400921FB53C8D4F1
%11 = fptrunc double %10 to float
%12 = load float, float* %4
%13 = call double @sinx(float %11, float %12)
%14 = load float, float* %3
%15 = fpext float %14 to double
%16 = fsub double %15, 0x400921FB53C8D4F1
%17 = fptrunc double %16 to float
%18 = load float, float* %4
%19 = call double @sinx(float %17, float %18)
%20 = fadd double %13, %19
%21 = fmul double 2.500000e-01, %20
%22 = fneg double %21
%23 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %7, double %22)
%24 = fptrunc double %23 to float
ret float %24
}

LLVM IR (-O2):
define float @window_hann_mag(float %0, float %1) {
%3 = tail call double @sinx(float %0, float %1)
%4 = fpext float %0 to double
%5 = fadd double %4, 0x400921FB53C8D4F1
%6 = fptrunc double %5 to float
%7 = tail call double @sinx(float %6, float %1)
%8 = fadd double %4, 0xC00921FB53C8D4F1
%9 = fptrunc double %8 to float
%10 = tail call double @sinx(float %9, float %1)
%11 = fadd double %7, %10
%12 = fmul double %11, -2.500000e-01
%13 = tail call double @llvm.fmuladd.f64(double %3, double 5.000000e-01, double %12)
%14 = fptrunc double %13 to float
ret float %14
}