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


x86 assembly (clang, -O0):
<morse_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  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movsd  0xec2(%rip),%xmm0
mulsd  0x8(%rax),%xmm0
movsd  -0x8(%rbp),%xmm1
mov    -0x10(%rbp),%rax
subsd  0x10(%rax),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x8(%rbp),%xmm1
mov    -0x10(%rbp),%rax
subsd  0x10(%rax),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  -0x28(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
addsd  %xmm2,%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

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

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

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