double rj1(x)
double x;
{
  double v, w;
  v = x;
  if (x < 0.0)
    x = -x;
  if (x < 8.0)
    return (v * jone(x));
  else {
    w = sqrt(0.63661977236758134307553505349005744 / x) *
        (pone(x) * cos(x - 2.35619449019234492884698253745962716) -
         8.0 / x * qone(x) * sin(x - 2.35619449019234492884698253745962716));
    if (v < 0.0)
      w = -w;
    return (w);
  }
}


x86 assembly (clang, -O0):
<rj1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    11a6 <rj1+0x46>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xe52(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    11e6 <rj1+0x86>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x1,%al
call   1040 <jone@plt>
movsd  -0x28(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    12ef <rj1+0x18f>
movsd  0xe22(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1080 <sqrt@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x1,%al
call   1030 <pone@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xde9(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1070 <cos@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  0xdcb(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x1,%al
call   1060 <qone@plt>
movsd  -0x50(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xd9e(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1050 <sin@plt>
movsd  -0x48(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm3
movaps %xmm0,%xmm4
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm4,%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    12e5 <rj1+0x185>
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rj1>:
sub    $0x68,%rsp
movapd %xmm0,%xmm2
movapd 0xe90(%rip),%xmm0
xorpd  %xmm2,%xmm0
xorpd  %xmm1,%xmm1
movapd %xmm2,%xmm3
cmpltsd %xmm1,%xmm3
andpd  %xmm3,%xmm0
andnpd %xmm2,%xmm3
orpd   %xmm0,%xmm3
movsd  0xe7b(%rip),%xmm0
ucomisd %xmm3,%xmm0
movapd %xmm2,0x40(%rsp)
jbe    11c2 <rj1+0x62>
movapd %xmm3,%xmm0
mov    $0x1,%al
call   1040 <jone@plt>
movapd 0x40(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
add    $0x68,%rsp
ret
movsd  0xe4e(%rip),%xmm0
divsd  %xmm3,%xmm0
ucomisd %xmm1,%xmm0
movapd %xmm3,0x10(%rsp)
jb     11e0 <rj1+0x80>
sqrtsd %xmm0,%xmm0
jmp    11eb <rj1+0x8b>
call   1080 <sqrt@plt>
movapd 0x10(%rsp),%xmm3
movsd  %xmm0,0x8(%rsp)
movapd %xmm3,%xmm0
mov    $0x1,%al
call   1030 <pone@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x38(%rsp)
movsd  0xe0f(%rip),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x30(%rsp)
call   1070 <cos@plt>
movapd %xmm0,0x50(%rsp)
movaps 0x10(%rsp),%xmm0
mov    $0x1,%al
call   1060 <qone@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x28(%rsp)
movsd  0x30(%rsp),%xmm0
call   1050 <sin@plt>
movsd  0xdd4(%rip),%xmm1
divsd  0x10(%rsp),%xmm1
mulsd  0x28(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movapd 0x50(%rsp),%xmm0
mulsd  0x38(%rsp),%xmm0
addsd  %xmm1,%xmm0
mulsd  0x8(%rsp),%xmm0
movapd 0xd7e(%rip),%xmm2
xorpd  %xmm0,%xmm2
movapd %xmm0,%xmm3
xorpd  %xmm1,%xmm1
movapd 0x40(%rsp),%xmm0
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm1
andnpd %xmm3,%xmm1
andpd  %xmm2,%xmm0
orpd   %xmm1,%xmm0
add    $0x68,%rsp
ret

LLVM IR (-O0):
define double @rj1(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
%6 = load double, double* %3
store double %6, double* %4
%7 = load double, double* %3
%8 = fcmp olt double %7, 0.000000e+00
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load double, double* %3
%11 = fneg double %10
store double %11, double* %3
br label %12
12: ; preds = %9, %1
%13 = load double, double* %3
%14 = fcmp olt double %13, 8.000000e+00
br i1 %14, label %15, label %21
15: ; preds = %12
%16 = load double, double* %4
%17 = load double, double* %3
%18 = call i32 (double, ...) bitcast (i32 (...)* @jone to i32 (double, ...)*)(double %17)
%19 = sitofp i32 %18 to double
%20 = fmul double %16, %19
store double %20, double* %2
br label %51
21: ; preds = %12
%22 = load double, double* %3
%23 = fdiv double 0x3FE45F306DC9C883, %22
%24 = call double @sqrt(double %23)
%25 = load double, double* %3
%26 = call i32 (double, ...) bitcast (i32 (...)* @pone to i32 (double, ...)*)(double %25)
%27 = sitofp i32 %26 to double
%28 = load double, double* %3
%29 = fsub double %28, 0x4002D97C7F3321D2
%30 = call double @cos(double %29)
%31 = load double, double* %3
%32 = fdiv double 8.000000e+00, %31
%33 = load double, double* %3
%34 = call i32 (double, ...) bitcast (i32 (...)* @qone to i32 (double, ...)*)(double %33)
%35 = sitofp i32 %34 to double
%36 = fmul double %32, %35
%37 = load double, double* %3
%38 = fsub double %37, 0x4002D97C7F3321D2
%39 = call double @sin(double %38)
%40 = fmul double %36, %39
%41 = fneg double %40
%42 = call double @llvm.fmuladd.f64(double %27, double %30, double %41)
%43 = fmul double %24, %42
store double %43, double* %5
%44 = load double, double* %4
%45 = fcmp olt double %44, 0.000000e+00
br i1 %45, label %46, label %49
46: ; preds = %21
%47 = load double, double* %5
%48 = fneg double %47
store double %48, double* %5
br label %49
49: ; preds = %46, %21
%50 = load double, double* %5
store double %50, double* %2
br label %51
51: ; preds = %49, %15
%52 = load double, double* %2
ret double %52
}

LLVM IR (-O2):
define double @rj1(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
%5 = fcmp olt double %4, 8.000000e+00
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = tail call i32 (double, ...) bitcast (i32 (...)* @jone to i32 (double, ...)*)(double %4)
%8 = sitofp i32 %7 to double
%9 = fmul double %8, %0
br label %27
10: ; preds = %1
%11 = fdiv double 0x3FE45F306DC9C883, %4
%12 = tail call double @sqrt(double %11)
%13 = tail call i32 (double, ...) bitcast (i32 (...)* @pone to i32 (double, ...)*)(double %4)
%14 = sitofp i32 %13 to double
%15 = fadd double %4, 0xC002D97C7F3321D2
%16 = tail call double @cos(double %15)
%17 = tail call i32 (double, ...) bitcast (i32 (...)* @qone to i32 (double, ...)*)(double %4)
%18 = sitofp i32 %17 to double
%19 = tail call double @sin(double %15)
%20 = fdiv double -8.000000e+00, %4
%21 = fmul double %20, %18
%22 = fmul double %19, %21
%23 = tail call double @llvm.fmuladd.f64(double %14, double %16, double %22)
%24 = fmul double %12, %23
%25 = fneg double %24
%26 = select i1 %2, double %25, double %24
br label %27
27: ; preds = %10, %6
%28 = phi double [ %9, %6 ], [ %26, %10 ]
ret double %28
}