#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 kawamura_value(const double r, const double *p, double *f) {
  double r6 = r * r * r;
  r6 = r6 * r6;
  *f = p[0] * p[1] / r +
       p[2] * (p[5] + p[6]) * exp((p[3] + p[4] - r) / (p[5] + p[6])) -
       p[7] * p[8] / r6;
}


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

x86 assembly (clang, -O2):
<kawamura_value>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  (%rdi),%xmm2
movsd  0x18(%rdi),%xmm1
mulsd  0x8(%rdi),%xmm2
divsd  %xmm0,%xmm2
movsd  %xmm2,0x8(%rsp)
movsd  0x28(%rdi),%xmm2
addsd  0x30(%rdi),%xmm2
movsd  0x10(%rdi),%xmm3
mulsd  %xmm2,%xmm3
movsd  %xmm3,(%rsp)
addsd  0x20(%rdi),%xmm1
subsd  %xmm0,%xmm1
divsd  %xmm2,%xmm1
movapd %xmm1,%xmm0
call   1030 <exp@plt>
mulsd  (%rsp),%xmm0
movsd  0x38(%rbx),%xmm1
mulsd  0x40(%rbx),%xmm1
addsd  0x8(%rsp),%xmm0
divsd  0x10(%rsp),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @kawamura_value(double %0, double* %1, double* %2) {
%4 = alloca double
%5 = alloca double*
%6 = alloca double*
%7 = alloca double
store double %0, double* %4
store double* %1, double** %5
store double* %2, double** %6
%8 = load double, double* %4
%9 = load double, double* %4
%10 = fmul double %8, %9
%11 = load double, double* %4
%12 = fmul double %10, %11
store double %12, double* %7
%13 = load double, double* %7
%14 = load double, double* %7
%15 = fmul double %13, %14
store double %15, double* %7
%16 = load double*, double** %5
%17 = getelementptr inbounds double, double* %16, i64 0
%18 = load double, double* %17
%19 = load double*, double** %5
%20 = getelementptr inbounds double, double* %19, i64 1
%21 = load double, double* %20
%22 = fmul double %18, %21
%23 = load double, double* %4
%24 = fdiv double %22, %23
%25 = load double*, double** %5
%26 = getelementptr inbounds double, double* %25, i64 2
%27 = load double, double* %26
%28 = load double*, double** %5
%29 = getelementptr inbounds double, double* %28, i64 5
%30 = load double, double* %29
%31 = load double*, double** %5
%32 = getelementptr inbounds double, double* %31, i64 6
%33 = load double, double* %32
%34 = fadd double %30, %33
%35 = fmul double %27, %34
%36 = load double*, double** %5
%37 = getelementptr inbounds double, double* %36, i64 3
%38 = load double, double* %37
%39 = load double*, double** %5
%40 = getelementptr inbounds double, double* %39, i64 4
%41 = load double, double* %40
%42 = fadd double %38, %41
%43 = load double, double* %4
%44 = fsub double %42, %43
%45 = load double*, double** %5
%46 = getelementptr inbounds double, double* %45, i64 5
%47 = load double, double* %46
%48 = load double*, double** %5
%49 = getelementptr inbounds double, double* %48, i64 6
%50 = load double, double* %49
%51 = fadd double %47, %50
%52 = fdiv double %44, %51
%53 = call double @exp(double %52)
%54 = call double @llvm.fmuladd.f64(double %35, double %53, double %24)
%55 = load double*, double** %5
%56 = getelementptr inbounds double, double* %55, i64 7
%57 = load double, double* %56
%58 = load double*, double** %5
%59 = getelementptr inbounds double, double* %58, i64 8
%60 = load double, double* %59
%61 = fmul double %57, %60
%62 = load double, double* %7
%63 = fdiv double %61, %62
%64 = fsub double %54, %63
%65 = load double*, double** %6
store double %64, double* %65
ret void
}

LLVM IR (-O2):
define void @kawamura_value(double %0, double* nocapture %1, double* nocapture writeonly %2) {
%4 = fmul double %0, %0
%5 = fmul double %4, %0
%6 = fmul double %5, %5
%7 = load double, double* %1
%8 = getelementptr inbounds double, double* %1, i64 1
%9 = load double, double* %8
%10 = fmul double %7, %9
%11 = fdiv double %10, %0
%12 = getelementptr inbounds double, double* %1, i64 2
%13 = load double, double* %12
%14 = getelementptr inbounds double, double* %1, i64 5
%15 = load double, double* %14
%16 = getelementptr inbounds double, double* %1, i64 6
%17 = load double, double* %16
%18 = fadd double %15, %17
%19 = fmul double %13, %18
%20 = getelementptr inbounds double, double* %1, i64 3
%21 = load double, double* %20
%22 = getelementptr inbounds double, double* %1, i64 4
%23 = load double, double* %22
%24 = fadd double %21, %23
%25 = fsub double %24, %0
%26 = fdiv double %25, %18
%27 = tail call double @exp(double %26)
%28 = tail call double @llvm.fmuladd.f64(double %19, double %27, double %11)
%29 = getelementptr inbounds double, double* %1, i64 7
%30 = load double, double* %29
%31 = getelementptr inbounds double, double* %1, i64 8
%32 = load double, double* %31
%33 = fmul double %30, %32
%34 = fdiv double %33, %6
%35 = fsub double %28, %34
store double %35, double* %2
ret void
}