#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 cos(double const);
double const exp(double const);
int /*<<< orphan*/ power_1(double *, double const *, double const *);
void eopp_exp_value(const double r, const double *p, double *f) {
  double power = 0.0;
  power_1(&power, &r, &p[3]);
  *f = p[0] * exp(-p[1] * r) + (p[2] / power) * cos(p[4] * r + p[5]);
}


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

x86 assembly (clang, -O2):
<eopp_exp_value>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  %xmm0,(%rsp)
movq   $0x0,0x8(%rsp)
lea    0x18(%rdi),%rdx
lea    0x8(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <power_1@plt>
movsd  (%rbx),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0x8(%rbx),%xmm0
xorpd  0xe8d(%rip),%xmm0
mulsd  (%rsp),%xmm0
call   1040 <exp@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x10(%rbx),%xmm1
movsd  0x20(%rbx),%xmm0
divsd  0x8(%rsp),%xmm1
movsd  %xmm1,0x10(%rsp)
mulsd  (%rsp),%xmm0
addsd  0x28(%rbx),%xmm0
call   1050 <cos@plt>
mulsd  0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
mulsd  0x20(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%r14)
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @eopp_exp_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
store double 0.000000e+00, double* %7
%8 = load double*, double** %5
%9 = getelementptr inbounds double, double* %8, i64 3
%10 = call i32 @power_1(double* %7, double* %4, double* %9)
%11 = load double*, double** %5
%12 = getelementptr inbounds double, double* %11, i64 0
%13 = load double, double* %12
%14 = load double*, double** %5
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = fneg double %16
%18 = load double, double* %4
%19 = fmul double %17, %18
%20 = call double @exp(double %19)
%21 = load double*, double** %5
%22 = getelementptr inbounds double, double* %21, i64 2
%23 = load double, double* %22
%24 = load double, double* %7
%25 = fdiv double %23, %24
%26 = load double*, double** %5
%27 = getelementptr inbounds double, double* %26, i64 4
%28 = load double, double* %27
%29 = load double, double* %4
%30 = load double*, double** %5
%31 = getelementptr inbounds double, double* %30, i64 5
%32 = load double, double* %31
%33 = call double @llvm.fmuladd.f64(double %28, double %29, double %32)
%34 = call double @cos(double %33)
%35 = fmul double %25, %34
%36 = call double @llvm.fmuladd.f64(double %13, double %20, double %35)
%37 = load double*, double** %6
store double %36, double* %37
ret void
}

LLVM IR (-O2):
define void @eopp_exp_value(double %0, double* %1, double* nocapture writeonly %2) {
%4 = alloca double
%5 = alloca double
store double %0, double* %4
%6 = bitcast double* %5 to i8*
store double 0.000000e+00, double* %5
%7 = getelementptr inbounds double, double* %1, i64 3
%8 = call i32 @power_1(double* %5, double* %4, double* %7)
%9 = load double, double* %1
%10 = getelementptr inbounds double, double* %1, i64 1
%11 = load double, double* %10
%12 = fneg double %11
%13 = load double, double* %4
%14 = fmul double %13, %12
%15 = call double @exp(double %14)
%16 = getelementptr inbounds double, double* %1, i64 2
%17 = load double, double* %16
%18 = load double, double* %5
%19 = fdiv double %17, %18
%20 = getelementptr inbounds double, double* %1, i64 4
%21 = load double, double* %20
%22 = load double, double* %4
%23 = getelementptr inbounds double, double* %1, i64 5
%24 = load double, double* %23
%25 = call double @llvm.fmuladd.f64(double %21, double %22, double %24)
%26 = call double @cos(double %25)
%27 = fmul double %19, %26
%28 = call double @llvm.fmuladd.f64(double %9, double %15, double %27)
store double %28, double* %2
ret void
}