#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 */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ sph_bessel_arec(double, int, double *, double *);
int /*<<< orphan*/ sph_bessel_asym(double, int, double *, double *);
int /*<<< orphan*/ sph_bessel_drec(double, int, double *, double *);
void ERI_Spherical_Bessel(double x, int l, double *sb, double *dsb) {
  const double xmin = 1e-10;
  const double xthresh = 100.0;
  assert(x >= 0.0);
  assert(l >= 0);
  if (x < xmin) {
    sph_bessel_asym(x, l, sb, dsb);
  } else if (x < xthresh) {
    sph_bessel_drec(x, l, sb, dsb);
  } else {
    sph_bessel_arec(x, l, sb, dsb);
  }
}


x86 assembly (clang, -O0):
<ERI_Spherical_Bessel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movsd  0xea0(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe9b(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
cmpl   $0x0,-0xc(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
movsd  0xe5c(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    11c9 <ERI_Spherical_Bessel+0x89>
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1050 <sph_bessel_asym@plt>
jmp    1210 <ERI_Spherical_Bessel+0xd0>
movsd  0xe37(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    11f6 <ERI_Spherical_Bessel+0xb6>
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <sph_bessel_drec@plt>
jmp    120b <ERI_Spherical_Bessel+0xcb>
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <sph_bessel_arec@plt>
jmp    1210 <ERI_Spherical_Bessel+0xd0>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ERI_Spherical_Bessel>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
movsd  %xmm0,0x8(%rsp)
xorpd  %xmm1,%xmm1
xor    %edi,%edi
ucomisd %xmm1,%xmm0
setae  %dil
call   1060 <assert@plt>
mov    %ebp,%edi
not    %edi
shr    $0x1f,%edi
call   1060 <assert@plt>
movsd  0x8(%rsp),%xmm0
movsd  0xe7d(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    119e <ERI_Spherical_Bessel+0x5e>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <sph_bessel_asym@plt>
movsd  0xe62(%rip),%xmm1
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x10,%rsp
ucomisd %xmm0,%xmm1
jbe    11c1 <ERI_Spherical_Bessel+0x81>
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <sph_bessel_drec@plt>
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <sph_bessel_arec@plt>

LLVM IR (-O0):
define void @ERI_Spherical_Bessel(double %0, i32 %1, double* %2, double* %3) {
%5 = alloca double
%6 = alloca i32
%7 = alloca double*
%8 = alloca double*
%9 = alloca double
%10 = alloca double
store double %0, double* %5
store i32 %1, i32* %6
store double* %2, double** %7
store double* %3, double** %8
store double 1.000000e-10, double* %9
store double 1.000000e+02, double* %10
%11 = load double, double* %5
%12 = fcmp oge double %11, 0.000000e+00
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i32, i32* %6
%16 = icmp sge i32 %15, 0
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = load double, double* %5
%20 = fcmp olt double %19, 1.000000e-10
br i1 %20, label %21, label %27
21: ; preds = %4
%22 = load double, double* %5
%23 = load i32, i32* %6
%24 = load double*, double** %7
%25 = load double*, double** %8
%26 = call i32 @sph_bessel_asym(double %22, i32 %23, double* %24, double* %25)
br label %43
27: ; preds = %4
%28 = load double, double* %5
%29 = fcmp olt double %28, 1.000000e+02
br i1 %29, label %30, label %36
30: ; preds = %27
%31 = load double, double* %5
%32 = load i32, i32* %6
%33 = load double*, double** %7
%34 = load double*, double** %8
%35 = call i32 @sph_bessel_drec(double %31, i32 %32, double* %33, double* %34)
br label %42
36: ; preds = %27
%37 = load double, double* %5
%38 = load i32, i32* %6
%39 = load double*, double** %7
%40 = load double*, double** %8
%41 = call i32 @sph_bessel_arec(double %37, i32 %38, double* %39, double* %40)
br label %42
42: ; preds = %36, %30
br label %43
43: ; preds = %42, %21
ret void
}

LLVM IR (-O2):
define void @ERI_Spherical_Bessel(double %0, i32 %1, double* %2, double* %3) {
%5 = fcmp oge double %0, 0.000000e+00
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = xor i32 %1, -1
%9 = lshr i32 %8, 31
%10 = tail call i32 @assert(i32 %9)
%11 = fcmp olt double %0, 1.000000e-10
br i1 %11, label %12, label %14
12: ; preds = %4
%13 = tail call i32 @sph_bessel_asym(double %0, i32 %1, double* %2, double* %3)
br label %20
14: ; preds = %4
%15 = fcmp olt double %0, 1.000000e+02
br i1 %15, label %16, label %18
16: ; preds = %14
%17 = tail call i32 @sph_bessel_drec(double %0, i32 %1, double* %2, double* %3)
br label %20
18: ; preds = %14
%19 = tail call i32 @sph_bessel_arec(double %0, i32 %1, double* %2, double* %3)
br label %20
20: ; preds = %16, %18, %12
ret void
}