#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 sqrt(double);
double isochrone_value(double *pars, double *q) {
  double R2;
  R2 = q[0] * q[0] + q[1] * q[1] + q[2] * q[2];
  return -pars[0] * pars[1] / (sqrt(R2 + pars[2] * pars[2]) + pars[2]);
}


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

x86 assembly (clang, -O2):
<isochrone_value>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
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
movsd  (%rdi),%xmm2
xorpd  0xeba(%rip),%xmm2
mulsd  0x8(%rdi),%xmm2
movsd  0x10(%rdi),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1168 <isochrone_value+0x58>
sqrtsd %xmm0,%xmm0
jmp    1177 <isochrone_value+0x67>
movapd %xmm2,(%rsp)
call   1030 <sqrt@plt>
movapd (%rsp),%xmm2
addsd  0x10(%rbx),%xmm0
divsd  %xmm0,%xmm2
movapd %xmm2,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define double @isochrone_value(double* 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 = load double, double* %0
%12 = fneg double %11
%13 = getelementptr inbounds double, double* %0, i64 1
%14 = load double, double* %13
%15 = fmul double %14, %12
%16 = getelementptr inbounds double, double* %0, i64 2
%17 = load double, double* %16
%18 = tail call double @llvm.fmuladd.f64(double %17, double %17, double %10)
%19 = tail call double @sqrt(double %18)
%20 = load double, double* %16
%21 = fadd double %19, %20
%22 = fdiv double %15, %21
ret double %22
}