#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 */
int /*<<< orphan*/ isfinite(double);
double sqrt(double);
int _orbita_models_pseudo_isothermal_f(const void *par, const double *pos,
                                       double *F) {
  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]),
         R = sqrt(R_sq);
  double Fr_R = -Vc_sq / Rc_sq / (1. + R_sq / Rc_sq);
  if (!isfinite(Fr_R))
    Fr_R = 0;
  F[0] = Fr_R * pos[0], F[1] = Fr_R * pos[1], F[2] = Fr_R * pos[2];
  return 0;
}


x86 assembly (clang, -O0):
<_orbita_models_pseudo_isothermal_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x28(%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,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1040 <sqrt@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
divsd  -0x28(%rbp),%xmm2
movsd  0xe26(%rip),%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
call   1030 <isfinite@plt>
cmp    $0x0,%eax
jne    1202 <_orbita_models_pseudo_isothermal_f+0xe2>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mulsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x40(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x40(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x10(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x10(%rax)
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_orbita_models_pseudo_isothermal_f>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
movsd  (%rsi),%xmm0
movsd  0x8(%rsi),%xmm1
movsd  0x10(%rsi),%xmm2
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm2
addsd  %xmm0,%xmm2
movsd  (%rdi),%xmm0
xorpd  0xeb5(%rip),%xmm0
movsd  0x8(%rdi),%xmm1
unpcklpd %xmm2,%xmm0
unpcklpd %xmm1,%xmm1
divpd  %xmm1,%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
addsd  0xea4(%rip),%xmm1
divsd  %xmm1,%xmm0
movapd %xmm0,(%rsp)
call   1030 <isfinite@plt>
xorpd  %xmm0,%xmm0
test   %eax,%eax
je     1187 <_orbita_models_pseudo_isothermal_f+0x77>
movapd (%rsp),%xmm0
movsd  (%rbx),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%r14)
movsd  0x8(%rbx),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%r14)
mulsd  0x10(%rbx),%xmm0
movsd  %xmm0,0x10(%r14)
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @_orbita_models_pseudo_isothermal_f(i8* nocapture %0, double* nocapture %1, double* nocapture writeonly %2) {
%4 = bitcast i8* %0 to double*
%5 = load double, double* %4
%6 = getelementptr inbounds i8, i8* %0, i64 8
%7 = bitcast i8* %6 to double*
%8 = load double, double* %7
%9 = load double, double* %1
%10 = getelementptr inbounds double, double* %1, i64 1
%11 = load double, double* %10
%12 = getelementptr inbounds double, double* %1, i64 2
%13 = load double, double* %12
%14 = fmul double %11, %11
%15 = tail call double @llvm.fmuladd.f64(double %9, double %9, double %14)
%16 = tail call double @llvm.fmuladd.f64(double %13, double %13, double %15)
%17 = fneg double %5
%18 = insertelement <2 x double> poison, double %17, i64 0
%19 = insertelement <2 x double> %18, double %16, i64 1
%20 = insertelement <2 x double> poison, double %8, i64 0
%21 = shufflevector <2 x double> %20, <2 x double> poison, <2 x i32> zeroinitializer
%22 = fdiv <2 x double> %19, %21
%23 = extractelement <2 x double> %22, i64 1
%24 = fadd double %23, 1.000000e+00
%25 = extractelement <2 x double> %22, i64 0
%26 = fdiv double %25, %24
%27 = tail call i32 @isfinite(double %26)
%28 = icmp eq i32 %27, 0
%29 = select i1 %28, double 0.000000e+00, double %26
%30 = load double, double* %1
%31 = fmul double %30, %29
store double %31, double* %2
%32 = load double, double* %10
%33 = fmul double %29, %32
%34 = getelementptr inbounds double, double* %2, i64 1
store double %33, double* %34
%35 = load double, double* %12
%36 = fmul double %29, %35
%37 = getelementptr inbounds double, double* %2, i64 2
store double %36, double* %37
ret i32 0
}