#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 const exp(double const);
void buck_value(const double r, const double *p, double *f) {
  double x = (p[1] * p[1]) / (r * r);
  double y = x * x * x;
  *f = p[0] * exp(-r / p[1]) - p[2] * y;
}


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

x86 assembly (clang, -O2):
<buck_value>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  (%rdi),%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  0x8(%rdi),%xmm1
movapd %xmm0,%xmm2
xorpd  0xec8(%rip),%xmm0
divsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm1
mulsd  %xmm2,%xmm2
divsd  %xmm2,%xmm1
movapd %xmm1,%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm2
movsd  %xmm2,0x8(%rsp)
call   1030 <exp@plt>
movsd  0x8(%rsp),%xmm1
mulsd  0x10(%rbx),%xmm1
mulsd  0x10(%rsp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

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

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