#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__ pow(double, double);
double llz_kaiser_atten2beta(double atten) {
  double beta;
  if (atten <= 21.)
    beta = 0.;
  else if (atten < 50.)
    beta = (double)0.5842 * (double)pow(atten - 21., 0.4) +
           (double)0.07886 * (double)(atten - 21.);
  else
    beta = (double)0.1102 * (double)(atten - 8.7);
  return beta;
}


x86 assembly (clang, -O0):
<llz_kaiser_atten2beta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jb     113d <llz_kaiser_atten2beta+0x2d>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    11d1 <llz_kaiser_atten2beta+0xc1>
movsd  0xec3(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    11aa <llz_kaiser_atten2beta+0x9a>
movsd  -0x8(%rbp),%xmm0
movsd  0xea3(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xec7(%rip),%xmm1
call   1030 <pow@plt>
cvtsi2sd %rax,%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  0xe80(%rip),%xmm1
subsd  %xmm1,%xmm2
movsd  0xe9c(%rip),%xmm1
mulsd  %xmm2,%xmm1
movsd  0xe88(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    11cc <llz_kaiser_atten2beta+0xbc>
movsd  -0x8(%rbp),%xmm1
movsd  0xe61(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xe4d(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    11d1 <llz_kaiser_atten2beta+0xc1>
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<llz_kaiser_atten2beta>:
push   %rax
movapd %xmm0,%xmm2
xorpd  %xmm0,%xmm0
movsd  0xedf(%rip),%xmm1
ucomisd %xmm2,%xmm1
jae    118a <llz_kaiser_atten2beta+0x7a>
movsd  0xed9(%rip),%xmm0
ucomisd %xmm2,%xmm0
jbe    1176 <llz_kaiser_atten2beta+0x66>
addsd  0xee3(%rip),%xmm2
movsd  %xmm2,(%rsp)
movsd  0xede(%rip),%xmm1
movapd %xmm2,%xmm0
call   1030 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  (%rsp),%xmm1
mulsd  0xec8(%rip),%xmm1
mulsd  0xec8(%rip),%xmm0
addsd  %xmm1,%xmm0
pop    %rax
ret
addsd  0xe92(%rip),%xmm2
mulsd  0xe92(%rip),%xmm2
movapd %xmm2,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @llz_kaiser_atten2beta(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fcmp ole double %4, 2.100000e+01
br i1 %5, label %6, label %7
6: ; preds = %1
store double 0.000000e+00, double* %3
br label %24
7: ; preds = %1
%8 = load double, double* %2
%9 = fcmp olt double %8, 5.000000e+01
br i1 %9, label %10, label %19
10: ; preds = %7
%11 = load double, double* %2
%12 = fsub double %11, 2.100000e+01
%13 = call i64 @pow(double %12, double 4.000000e-01)
%14 = sitofp i64 %13 to double
%15 = load double, double* %2
%16 = fsub double %15, 2.100000e+01
%17 = fmul double 0x3FB4302B40F66A55, %16
%18 = call double @llvm.fmuladd.f64(double 5.842000e-01, double %14, double %17)
store double %18, double* %3
br label %23
19: ; preds = %7
%20 = load double, double* %2
%21 = fsub double %20, 0x4021666666666666
%22 = fmul double 1.102000e-01, %21
store double %22, double* %3
br label %23
23: ; preds = %19, %10
br label %24
24: ; preds = %23, %6
%25 = load double, double* %3
ret double %25
}

LLVM IR (-O2):
define double @llz_kaiser_atten2beta(double %0) {
%2 = fcmp ugt double %0, 2.100000e+01
br i1 %2, label %3, label %14
3: ; preds = %1
%4 = fcmp olt double %0, 5.000000e+01
br i1 %4, label %5, label %11
5: ; preds = %3
%6 = fadd double %0, -2.100000e+01
%7 = tail call i64 @pow(double %6, double 4.000000e-01)
%8 = sitofp i64 %7 to double
%9 = fmul double %6, 0x3FB4302B40F66A55
%10 = tail call double @llvm.fmuladd.f64(double %8, double 5.842000e-01, double %9)
br label %14
11: ; preds = %3
%12 = fadd double %0, 0xC021666666666666
%13 = fmul double %12, 1.102000e-01
br label %14
14: ; preds = %1, %5, %11
%15 = phi double [ %10, %5 ], [ %13, %11 ], [ 0.000000e+00, %1 ]
ret double %15
}