double _orbita_models_homogeneous_sphere_rho(const void *par, const double *R) {
  double Rt = sqrt(((R[0]) * (R[0])) + ((R[1]) * (R[1])) + ((R[2]) * (R[2])));
  if (Rt < (((double *)par)[1]))
    return ((double *)par)[0];
  else
    return 0.;
}


x86 assembly (clang, -O0):
<_orbita_models_homogeneous_sphere_rho>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm1
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1198 <_orbita_models_homogeneous_sphere_rho+0x88>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11a0 <_orbita_models_homogeneous_sphere_rho+0x90>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_orbita_models_homogeneous_sphere_rho>:
push   %rbx
mov    %rdi,%rbx
movsd  (%rsi),%xmm1
movsd  0x8(%rsi),%xmm0
mulsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rsi),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jb     1146 <_orbita_models_homogeneous_sphere_rho+0x36>
sqrtsd %xmm0,%xmm0
jmp    114f <_orbita_models_homogeneous_sphere_rho+0x3f>
call   1030 <sqrt@plt>
xorpd  %xmm2,%xmm2
movsd  0x8(%rbx),%xmm1
ucomisd %xmm0,%xmm1
jbe    115e <_orbita_models_homogeneous_sphere_rho+0x4e>
movsd  (%rbx),%xmm2
movapd %xmm2,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @_orbita_models_homogeneous_sphere_rho(i8* %0, double* %1) {
%3 = alloca double
%4 = alloca i8*
%5 = alloca double*
%6 = alloca double
store i8* %0, i8** %4
store double* %1, double** %5
%7 = load double*, double** %5
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = load double, double* %8
%10 = load double*, double** %5
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
%13 = load double*, double** %5
%14 = getelementptr inbounds double, double* %13, i64 1
%15 = load double, double* %14
%16 = load double*, double** %5
%17 = getelementptr inbounds double, double* %16, i64 1
%18 = load double, double* %17
%19 = fmul double %15, %18
%20 = call double @llvm.fmuladd.f64(double %9, double %12, double %19)
%21 = load double*, double** %5
%22 = getelementptr inbounds double, double* %21, i64 2
%23 = load double, double* %22
%24 = load double*, double** %5
%25 = getelementptr inbounds double, double* %24, i64 2
%26 = load double, double* %25
%27 = call double @llvm.fmuladd.f64(double %23, double %26, double %20)
%28 = call double @sqrt(double %27)
store double %28, double* %6
%29 = load double, double* %6
%30 = load i8*, i8** %4
%31 = bitcast i8* %30 to double*
%32 = getelementptr inbounds double, double* %31, i64 1
%33 = load double, double* %32
%34 = fcmp olt double %29, %33
br i1 %34, label %35, label %40
35: ; preds = %2
%36 = load i8*, i8** %4
%37 = bitcast i8* %36 to double*
%38 = getelementptr inbounds double, double* %37, i64 0
%39 = load double, double* %38
store double %39, double* %3
br label %41
40: ; preds = %2
store double 0.000000e+00, double* %3
br label %41
41: ; preds = %40, %35
%42 = load double, double* %3
ret double %42
}

LLVM IR (-O2):
define double @_orbita_models_homogeneous_sphere_rho(i8* nocapture %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = getelementptr inbounds double, double* %1, i64 1
%5 = load double, double* %4
%6 = fmul double %5, %5
%7 = tail call double @llvm.fmuladd.f64(double %3, double %3, double %6)
%8 = getelementptr inbounds double, double* %1, i64 2
%9 = load double, double* %8
%10 = tail call double @llvm.fmuladd.f64(double %9, double %9, double %7)
%11 = tail call double @sqrt(double %10)
%12 = getelementptr inbounds i8, i8* %0, i64 8
%13 = bitcast i8* %12 to double*
%14 = load double, double* %13
%15 = fcmp olt double %11, %14
br i1 %15, label %16, label %19
16: ; preds = %2
%17 = bitcast i8* %0 to double*
%18 = load double, double* %17
br label %19
19: ; preds = %2, %16
%20 = phi double [ %18, %16 ], [ 0.000000e+00, %2 ]
ret double %20
}