#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 log(int);
double _orbita_models_pseudo_isothermal_psi(const void *par,
                                            const double *pos) {
  double Vc_sq = *((double *)par), Rc_sq = *((double *)par + 1);
  double R_sq =
      ((pos)[0] * (pos)[0] + (pos)[1] * (pos)[1] + (pos)[2] * (pos)[2]);
  return 0.5 * Vc_sq * log(1. + R_sq / Rc_sq);
}


x86 assembly (clang, -O0):
<_orbita_models_pseudo_isothermal_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  0xe7c(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm1
divsd  -0x20(%rbp),%xmm1
movsd  0xe58(%rip),%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_orbita_models_pseudo_isothermal_psi>:
push   %rax
movsd  (%rdi),%xmm2
movsd  (%rsi),%xmm0
movsd  0x8(%rsi),%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0x10(%rsi),%xmm1
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
mulsd  0xec1(%rip),%xmm2
movsd  %xmm2,(%rsp)
divsd  0x8(%rdi),%xmm1
addsd  0xeb7(%rip),%xmm1
cvttsd2si %xmm1,%edi
call   1030 <log@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @_orbita_models_pseudo_isothermal_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 = fmul double 5.000000e-01, %36
%38 = load double, double* %7
%39 = load double, double* %6
%40 = fdiv double %38, %39
%41 = fadd double 1.000000e+00, %40
%42 = fptosi double %41 to i32
%43 = call double @log(i32 %42)
%44 = fmul double %37, %43
ret double %44
}

LLVM IR (-O2):
define double @_orbita_models_pseudo_isothermal_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 = fmul double %4, 5.000000e-01
%17 = fdiv double %15, %7
%18 = fadd double %17, 1.000000e+00
%19 = fptosi double %18 to i32
%20 = tail call double @log(i32 %19)
%21 = fmul double %16, %20
ret double %21
}