#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 bessi0_salahat(double);
double bessi0_salahat_exponScaled(double);
double bessi0_spd(double);
double bessi0_spd_exponScaled(double);
void __R_bessi0(double *x, int *expon, double *val) {
  if (*expon)
    *val = (*x) < (1E31) ? (bessi0_spd_exponScaled(*x))
                         : (bessi0_salahat_exponScaled(*x));
  else
    *val = (*x) < (1E31) ? (bessi0_spd(*x)) : (bessi0_salahat(*x));
}


x86 assembly (clang, -O0):
<__R_bessi0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
je     11b2 <__R_bessi0+0x72>
mov    -0x8(%rbp),%rax
movsd  0xe93(%rip),%xmm0
ucomisd (%rax),%xmm0
jbe    118e <__R_bessi0+0x4e>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1060 <bessi0_spd_exponScaled@plt>
movsd  %xmm0,-0x20(%rbp)
jmp    11a0 <__R_bessi0+0x60>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <bessi0_salahat_exponScaled@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    11fe <__R_bessi0+0xbe>
mov    -0x8(%rbp),%rax
movsd  0xe42(%rip),%xmm0
ucomisd (%rax),%xmm0
jbe    11df <__R_bessi0+0x9f>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1050 <bessi0_spd@plt>
movsd  %xmm0,-0x28(%rbp)
jmp    11f1 <__R_bessi0+0xb1>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1040 <bessi0_salahat@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__R_bessi0>:
push   %rbx
mov    %rdx,%rbx
cmpl   $0x0,(%rsi)
movsd  (%rdi),%xmm0
movsd  0xead(%rip),%xmm1
je     1162 <__R_bessi0+0x22>
ucomisd %xmm0,%xmm1
jbe    116f <__R_bessi0+0x2f>
call   1060 <bessi0_spd_exponScaled@plt>
jmp    117b <__R_bessi0+0x3b>
ucomisd %xmm0,%xmm1
jbe    1176 <__R_bessi0+0x36>
call   1050 <bessi0_spd@plt>
jmp    117b <__R_bessi0+0x3b>
call   1030 <bessi0_salahat_exponScaled@plt>
jmp    117b <__R_bessi0+0x3b>
call   1040 <bessi0_salahat@plt>
movsd  %xmm0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @__R_bessi0(double* %0, i32* %1, double* %2) {
%4 = alloca double*
%5 = alloca i32*
%6 = alloca double*
store double* %0, double** %4
store i32* %1, i32** %5
store double* %2, double** %6
%7 = load i32*, i32** %5
%8 = load i32, i32* %7
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %25
10: ; preds = %3
%11 = load double*, double** %4
%12 = load double, double* %11
%13 = fcmp olt double %12, 1.000000e+31
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load double*, double** %4
%16 = load double, double* %15
%17 = call double @bessi0_spd_exponScaled(double %16)
br label %22
18: ; preds = %10
%19 = load double*, double** %4
%20 = load double, double* %19
%21 = call double @bessi0_salahat_exponScaled(double %20)
br label %22
22: ; preds = %18, %14
%23 = phi double [ %17, %14 ], [ %21, %18 ]
%24 = load double*, double** %6
store double %23, double* %24
br label %40
25: ; preds = %3
%26 = load double*, double** %4
%27 = load double, double* %26
%28 = fcmp olt double %27, 1.000000e+31
br i1 %28, label %29, label %33
29: ; preds = %25
%30 = load double*, double** %4
%31 = load double, double* %30
%32 = call double @bessi0_spd(double %31)
br label %37
33: ; preds = %25
%34 = load double*, double** %4
%35 = load double, double* %34
%36 = call double @bessi0_salahat(double %35)
br label %37
37: ; preds = %33, %29
%38 = phi double [ %32, %29 ], [ %36, %33 ]
%39 = load double*, double** %6
store double %38, double* %39
br label %40
40: ; preds = %37, %22
ret void
}

LLVM IR (-O2):
define void @__R_bessi0(double* nocapture %0, i32* nocapture %1, double* nocapture writeonly %2) {
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 0
%6 = load double, double* %0
%7 = fcmp olt double %6, 1.000000e+31
br i1 %5, label %13, label %8
8: ; preds = %3
br i1 %7, label %9, label %11
9: ; preds = %8
%10 = tail call double @bessi0_spd_exponScaled(double %6)
br label %18
11: ; preds = %8
%12 = tail call double @bessi0_salahat_exponScaled(double %6)
br label %18
13: ; preds = %3
br i1 %7, label %14, label %16
14: ; preds = %13
%15 = tail call double @bessi0_spd(double %6)
br label %18
16: ; preds = %13
%17 = tail call double @bessi0_salahat(double %6)
br label %18
18: ; preds = %14, %16, %9, %11
%19 = phi double [ %10, %9 ], [ %12, %11 ], [ %15, %14 ], [ %17, %16 ]
store double %19, double* %2
ret void
}