#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);
int sin(double);
double get_dV(const double *xp, const double *xm) {
  double r2 = (xp[0] * xp[0] + xp[0] * xm[0] + xm[0] * xm[0]) / 3.0;
  double dr = xp[0] - xm[0];
  double dphi = get_dp(xp[1], xm[1]);
  double sinth = sin(0.5 * (xp[2] + xm[2]));
  double sindth = 2 * sin(0.5 * (xp[2] - xm[2]));
  return r2 * sinth * dr * sindth * dphi;
}


x86 assembly (clang, -O0):
<get_dV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  (%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe90(%rip),%xmm1
divsd  %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   1040 <get_dp@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm1
mov    -0x10(%rbp),%rax
addsd  0x10(%rax),%xmm1
movsd  0xe34(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <sin@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm1
mov    -0x10(%rbp),%rax
subsd  0x10(%rax),%xmm1
movsd  0xe08(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <sin@plt>
shl    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_dV>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  (%rdi),%xmm4
movsd  0x8(%rdi),%xmm0
movsd  (%rsi),%xmm5
movsd  0x8(%rsi),%xmm1
movapd %xmm4,%xmm2
mulsd  %xmm5,%xmm2
movapd %xmm4,%xmm3
mulsd  %xmm4,%xmm3
addsd  %xmm2,%xmm3
subsd  %xmm5,%xmm4
movsd  %xmm4,(%rsp)
mulsd  %xmm5,%xmm5
addsd  %xmm3,%xmm5
divsd  0xe94(%rip),%xmm5
movsd  %xmm5,0x8(%rsp)
call   1040 <get_dp@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x10(%rbx),%xmm0
addsd  0x10(%r14),%xmm0
mulsd  0xe78(%rip),%xmm0
call   1030 <sin@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x8(%rsp),%xmm0
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x10(%rbx),%xmm0
subsd  0x10(%r14),%xmm0
mulsd  0xe49(%rip),%xmm0
call   1030 <sin@plt>
add    %eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  (%rsp),%xmm0
mulsd  0x10(%rsp),%xmm0
add    $0x18,%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
%9 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%10 = load double*, double** %3
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
%13 = load double*, double** %3
%14 = getelementptr inbounds double, double* %13, i64 0
%15 = load double, double* %14
%16 = load double*, double** %3
%17 = getelementptr inbounds double, double* %16, i64 0
%18 = load double, double* %17
%19 = load double*, double** %4
%20 = getelementptr inbounds double, double* %19, i64 0
%21 = load double, double* %20
%22 = fmul double %18, %21
%23 = call double @llvm.fmuladd.f64(double %12, double %15, double %22)
%24 = load double*, double** %4
%25 = getelementptr inbounds double, double* %24, i64 0
%26 = load double, double* %25
%27 = load double*, double** %4
%28 = getelementptr inbounds double, double* %27, i64 0
%29 = load double, double* %28
%30 = call double @llvm.fmuladd.f64(double %26, double %29, double %23)
%31 = fdiv double %30, 3.000000e+00
store double %31, double* %5
%32 = load double*, double** %3
%33 = getelementptr inbounds double, double* %32, i64 0
%34 = load double, double* %33
%35 = load double*, double** %4
%36 = getelementptr inbounds double, double* %35, i64 0
%37 = load double, double* %36
%38 = fsub double %34, %37
store double %38, double* %6
%39 = load double*, double** %3
%40 = getelementptr inbounds double, double* %39, i64 1
%41 = load double, double* %40
%42 = load double*, double** %4
%43 = getelementptr inbounds double, double* %42, i64 1
%44 = load double, double* %43
%45 = call double @get_dp(double %41, double %44)
store double %45, double* %7
%46 = load double*, double** %3
%47 = getelementptr inbounds double, double* %46, i64 2
%48 = load double, double* %47
%49 = load double*, double** %4
%50 = getelementptr inbounds double, double* %49, i64 2
%51 = load double, double* %50
%52 = fadd double %48, %51
%53 = fmul double 5.000000e-01, %52
%54 = call i32 @sin(double %53)
%55 = sitofp i32 %54 to double
store double %55, double* %8
%56 = load double*, double** %3
%57 = getelementptr inbounds double, double* %56, i64 2
%58 = load double, double* %57
%59 = load double*, double** %4
%60 = getelementptr inbounds double, double* %59, i64 2
%61 = load double, double* %60
%62 = fsub double %58, %61
%63 = fmul double 5.000000e-01, %62
%64 = call i32 @sin(double %63)
%65 = mul nsw i32 2, %64
%66 = sitofp i32 %65 to double
store double %66, double* %9
%67 = load double, double* %5
%68 = load double, double* %8
%69 = fmul double %67, %68
%70 = load double, double* %6
%71 = fmul double %69, %70
%72 = load double, double* %9
%73 = fmul double %71, %72
%74 = load double, double* %7
%75 = fmul double %73, %74
ret double %75
}

LLVM IR (-O2):
define double @get_dV(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fmul double %3, %4
%6 = tail call double @llvm.fmuladd.f64(double %3, double %3, double %5)
%7 = tail call double @llvm.fmuladd.f64(double %4, double %4, double %6)
%8 = fdiv double %7, 3.000000e+00
%9 = fsub double %3, %4
%10 = getelementptr inbounds double, double* %0, i64 1
%11 = load double, double* %10
%12 = getelementptr inbounds double, double* %1, i64 1
%13 = load double, double* %12
%14 = tail call double @get_dp(double %11, double %13)
%15 = getelementptr inbounds double, double* %0, i64 2
%16 = load double, double* %15
%17 = getelementptr inbounds double, double* %1, i64 2
%18 = load double, double* %17
%19 = fadd double %16, %18
%20 = fmul double %19, 5.000000e-01
%21 = tail call i32 @sin(double %20)
%22 = sitofp i32 %21 to double
%23 = load double, double* %15
%24 = load double, double* %17
%25 = fsub double %23, %24
%26 = fmul double %25, 5.000000e-01
%27 = tail call i32 @sin(double %26)
%28 = shl nsw i32 %27, 1
%29 = sitofp i32 %28 to double
%30 = fmul double %8, %22
%31 = fmul double %9, %30
%32 = fmul double %31, %29
%33 = fmul double %14, %32
ret double %33
}