#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 get_dp(double const, double const);
double get_dV(const double *xp, const double *xm) {
  double r = .5 * (xp[0] + xm[0]);
  double dr = xp[0] - xm[0];
  double dphi = get_dp(xp[1], xm[1]);
  double dz = xp[2] - xm[2];
  return (r * dr * dphi * dz);
}


x86 assembly (clang, -O0):
<get_dV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
addsd  (%rax),%xmm1
movsd  0xec8(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm1
call   1030 <get_dp@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_dV>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  (%rdi),%xmm4
movsd  0x8(%rdi),%xmm0
movsd  (%rsi),%xmm2
movsd  0x8(%rsi),%xmm1
movapd %xmm4,%xmm3
addsd  %xmm2,%xmm3
mulsd  0xec4(%rip),%xmm3
subsd  %xmm2,%xmm4
mulsd  %xmm3,%xmm4
movsd  %xmm4,(%rsp)
call   1030 <get_dp@plt>
movsd  0x10(%rbx),%xmm1
subsd  0x10(%r14),%xmm1
mulsd  (%rsp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define double @get_dV(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%9 = load double*, double** %3
%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 0
%14 = load double, double* %13
%15 = fadd double %11, %14
%16 = fmul double 5.000000e-01, %15
store double %16, double* %5
%17 = load double*, double** %3
%18 = getelementptr inbounds double, double* %17, i64 0
%19 = load double, double* %18
%20 = load double*, double** %4
%21 = getelementptr inbounds double, double* %20, i64 0
%22 = load double, double* %21
%23 = fsub double %19, %22
store double %23, double* %6
%24 = load double*, double** %3
%25 = getelementptr inbounds double, double* %24, i64 1
%26 = load double, double* %25
%27 = load double*, double** %4
%28 = getelementptr inbounds double, double* %27, i64 1
%29 = load double, double* %28
%30 = call double @get_dp(double %26, double %29)
store double %30, double* %7
%31 = load double*, double** %3
%32 = getelementptr inbounds double, double* %31, i64 2
%33 = load double, double* %32
%34 = load double*, double** %4
%35 = getelementptr inbounds double, double* %34, i64 2
%36 = load double, double* %35
%37 = fsub double %33, %36
store double %37, double* %8
%38 = load double, double* %5
%39 = load double, double* %6
%40 = fmul double %38, %39
%41 = load double, double* %7
%42 = fmul double %40, %41
%43 = load double, double* %8
%44 = fmul double %42, %43
ret double %44
}

LLVM IR (-O2):
define double @get_dV(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fadd double %3, %4
%6 = fmul double %5, 5.000000e-01
%7 = fsub double %3, %4
%8 = getelementptr inbounds double, double* %0, i64 1
%9 = load double, double* %8
%10 = getelementptr inbounds double, double* %1, i64 1
%11 = load double, double* %10
%12 = tail call double @get_dp(double %9, double %11)
%13 = getelementptr inbounds double, double* %0, i64 2
%14 = load double, double* %13
%15 = getelementptr inbounds double, double* %1, i64 2
%16 = load double, double* %15
%17 = fsub double %14, %16
%18 = fmul double %7, %6
%19 = fmul double %18, %12
%20 = fmul double %19, %17
ret double %20
}