double _orbita_models_plummer_psi(const void *par, const double *pos) {
  double M = *((double *)par), b = *((double *)par + 1);
  double R_sq =
      ((pos)[0] * (pos)[0] + (pos)[1] * (pos)[1] + (pos)[2] * (pos)[2]);
  return -M / sqrt(R_sq + ((b) * (b)));
}


x86 assembly (clang, -O0):
<_orbita_models_plummer_psi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x20(%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,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_orbita_models_plummer_psi>:
sub    $0x18,%rsp
movsd  0x8(%rdi),%xmm0
movsd  (%rsi),%xmm1
movsd  0x8(%rsi),%xmm2
mulsd  %xmm2,%xmm2
mulsd  %xmm1,%xmm1
addsd  %xmm2,%xmm1
movsd  0x10(%rsi),%xmm2
mulsd  %xmm2,%xmm2
addsd  %xmm1,%xmm2
movsd  (%rdi),%xmm3
xorpd  0xeb9(%rip),%xmm3
mulsd  %xmm0,%xmm0
addsd  %xmm2,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     115f <_orbita_models_plummer_psi+0x4f>
sqrtsd %xmm0,%xmm0
jmp    116e <_orbita_models_plummer_psi+0x5e>
movapd %xmm3,(%rsp)
call   1030 <sqrt@plt>
movapd (%rsp),%xmm3
divsd  %xmm0,%xmm3
movapd %xmm3,%xmm0
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define double @_orbita_models_plummer_psi(i8* nocapture %0, double* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = getelementptr inbounds i8, i8* %0, i64 8
%6 = bitcast i8* %5 to double*
%7 = load double, double* %6
%8 = load double, double* %1
%9 = getelementptr inbounds double, double* %1, i64 1
%10 = load double, double* %9
%11 = fmul double %10, %10
%12 = tail call double @llvm.fmuladd.f64(double %8, double %8, double %11)
%13 = getelementptr inbounds double, double* %1, i64 2
%14 = load double, double* %13
%15 = tail call double @llvm.fmuladd.f64(double %14, double %14, double %12)
%16 = fneg double %4
%17 = tail call double @llvm.fmuladd.f64(double %7, double %7, double %15)
%18 = tail call double @sqrt(double %17)
%19 = fdiv double %16, %18
ret double %19
}