int _orbita_models_homogeneous_sphere_f(const void *par, const double *R,
                                        double *F) {
  double Rsq = ((R[0]) * (R[0])) + ((R[1]) * (R[1])) + ((R[2]) * (R[2])),
         Rt = sqrt(Rsq);
  double Fr_Rt = -_orbita_models_homogeneous_sphere_Mr(par, Rt) / Rsq / Rt;
  if (!isfinite(Fr_Rt))
    Fr_Rt = 0.;
  F[0] = Fr_Rt * R[0], F[1] = Fr_Rt * R[1], F[2] = Fr_Rt * R[2];
  return 0;
}


x86 assembly (clang, -O0):
<_orbita_models_homogeneous_sphere_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1050 <sqrt@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x28(%rbp),%xmm0
mov    $0x1,%al
call   1040 <_orbita_models_homogeneous_sphere_Mr@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
divsd  -0x20(%rbp),%xmm0
divsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
mov    $0x1,%al
call   1030 <isfinite@plt>
cmp    $0x0,%eax
jne    11e2 <_orbita_models_homogeneous_sphere_f+0xb2>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mulsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x30(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x30(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x10(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x10(%rax)
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_orbita_models_homogeneous_sphere_f>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
movsd  (%rsi),%xmm2
movsd  0x8(%rsi),%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm2,%xmm2
addsd  %xmm1,%xmm2
movsd  0x10(%rsi),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm2,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
movsd  %xmm0,(%rsp)
jb     1179 <_orbita_models_homogeneous_sphere_f+0x49>
sqrtsd %xmm0,%xmm0
jmp    117e <_orbita_models_homogeneous_sphere_f+0x4e>
call   1050 <sqrt@plt>
mov    %r15,%rdi
movsd  %xmm0,0x8(%rsp)
mov    $0x1,%al
call   1040 <_orbita_models_homogeneous_sphere_Mr@plt>
neg    %eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  (%rsp),%xmm0
divsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%rsp)
mov    $0x1,%al
call   1030 <isfinite@plt>
test   %eax,%eax
xorpd  %xmm1,%xmm1
je     11bb <_orbita_models_homogeneous_sphere_f+0x8b>
movsd  (%rsp),%xmm1
movsd  (%rbx),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,(%r14)
movsd  0x8(%rbx),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%r14)
mulsd  0x10(%rbx),%xmm1
movsd  %xmm1,0x10(%r14)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @_orbita_models_homogeneous_sphere_f(i8* %0, double* %1, double* %2) {
%4 = alloca i8*
%5 = alloca double*
%6 = alloca double*
%7 = alloca double
%8 = alloca double
%9 = alloca double
store i8* %0, i8** %4
store double* %1, double** %5
store double* %2, double** %6
%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 0
%15 = load double, double* %14
%16 = load double*, double** %5
%17 = getelementptr inbounds double, double* %16, i64 1
%18 = load double, double* %17
%19 = load double*, double** %5
%20 = getelementptr inbounds double, double* %19, i64 1
%21 = load double, double* %20
%22 = fmul double %18, %21
%23 = call double @llvm.fmuladd.f64(double %12, double %15, double %22)
%24 = load double*, double** %5
%25 = getelementptr inbounds double, double* %24, i64 2
%26 = load double, double* %25
%27 = load double*, double** %5
%28 = getelementptr inbounds double, double* %27, i64 2
%29 = load double, double* %28
%30 = call double @llvm.fmuladd.f64(double %26, double %29, double %23)
store double %30, double* %7
%31 = load double, double* %7
%32 = call double @sqrt(double %31)
store double %32, double* %8
%33 = load i8*, i8** %4
%34 = load double, double* %8
%35 = call i32 (i8*, double, ...) bitcast (i32 (...)* @_orbita_models_homogeneous_sphere_Mr to i32 (i8*, double, ...)*)(i8* %33, double %34)
%36 = sub nsw i32 0, %35
%37 = sitofp i32 %36 to double
%38 = load double, double* %7
%39 = fdiv double %37, %38
%40 = load double, double* %8
%41 = fdiv double %39, %40
store double %41, double* %9
%42 = load double, double* %9
%43 = call i32 (double, ...) bitcast (i32 (...)* @isfinite to i32 (double, ...)*)(double %42)
%44 = icmp ne i32 %43, 0
br i1 %44, label %46, label %45
45: ; preds = %3
store double 0.000000e+00, double* %9
br label %46
46: ; preds = %45, %3
%47 = load double, double* %9
%48 = load double*, double** %5
%49 = getelementptr inbounds double, double* %48, i64 0
%50 = load double, double* %49
%51 = fmul double %47, %50
%52 = load double*, double** %6
%53 = getelementptr inbounds double, double* %52, i64 0
store double %51, double* %53
%54 = load double, double* %9
%55 = load double*, double** %5
%56 = getelementptr inbounds double, double* %55, i64 1
%57 = load double, double* %56
%58 = fmul double %54, %57
%59 = load double*, double** %6
%60 = getelementptr inbounds double, double* %59, i64 1
store double %58, double* %60
%61 = load double, double* %9
%62 = load double*, double** %5
%63 = getelementptr inbounds double, double* %62, i64 2
%64 = load double, double* %63
%65 = fmul double %61, %64
%66 = load double*, double** %6
%67 = getelementptr inbounds double, double* %66, i64 2
store double %65, double* %67
ret i32 0
}

LLVM IR (-O2):
define i32 @_orbita_models_homogeneous_sphere_f(i8* %0, double* nocapture %1, double* nocapture writeonly %2) {
%4 = load double, double* %1
%5 = getelementptr inbounds double, double* %1, i64 1
%6 = load double, double* %5
%7 = fmul double %6, %6
%8 = tail call double @llvm.fmuladd.f64(double %4, double %4, double %7)
%9 = getelementptr inbounds double, double* %1, i64 2
%10 = load double, double* %9
%11 = tail call double @llvm.fmuladd.f64(double %10, double %10, double %8)
%12 = tail call double @sqrt(double %11)
%13 = tail call i32 (i8*, double, ...) bitcast (i32 (...)* @_orbita_models_homogeneous_sphere_Mr to i32 (i8*, double, ...)*)(i8* %0, double %12)
%14 = sub nsw i32 0, %13
%15 = sitofp i32 %14 to double
%16 = fdiv double %15, %11
%17 = fdiv double %16, %12
%18 = tail call i32 (double, ...) bitcast (i32 (...)* @isfinite to i32 (double, ...)*)(double %17)
%19 = icmp eq i32 %18, 0
%20 = select i1 %19, double 0.000000e+00, double %17
%21 = load double, double* %1
%22 = fmul double %21, %20
store double %22, double* %2
%23 = load double, double* %5
%24 = fmul double %20, %23
%25 = getelementptr inbounds double, double* %2, i64 1
store double %24, double* %25
%26 = load double, double* %9
%27 = fmul double %20, %26
%28 = getelementptr inbounds double, double* %2, i64 2
store double %27, double* %28
ret i32 0
}