#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);
double rq_pricing_density(double x, double y, double ad, double bd,
                          double rho) {
  double r =
      ad * (2 * x - ad) + bd * (2 * y - bd) + 2.0 * rho * (x - ad) * (y - bd);
  return exp(r);
}


x86 assembly (clang, -O0):
<rq_pricing_density>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
addsd  %xmm2,%xmm2
addsd  %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm3
movsd  -0x20(%rbp),%xmm4
movq   %xmm4,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm4
addsd  %xmm3,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xe5f(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
subsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
movsd  -0x10(%rbp),%xmm2
subsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1030 <exp@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rq_pricing_density>:
movapd %xmm0,%xmm5
addsd  %xmm0,%xmm5
subsd  %xmm2,%xmm5
movapd %xmm1,%xmm6
addsd  %xmm1,%xmm6
subsd  %xmm3,%xmm6
mulsd  %xmm3,%xmm6
mulsd  %xmm2,%xmm5
addsd  %xmm6,%xmm5
addsd  %xmm4,%xmm4
subsd  %xmm2,%xmm0
mulsd  %xmm4,%xmm0
subsd  %xmm3,%xmm1
mulsd  %xmm1,%xmm0
addsd  %xmm5,%xmm0
jmp    1030 <exp@plt>

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

LLVM IR (-O2):
define double @rq_pricing_density(double %0, double %1, double %2, double %3, double %4) {
%6 = fneg double %2
%7 = tail call double @llvm.fmuladd.f64(double %0, double 2.000000e+00, double %6)
%8 = fneg double %3
%9 = tail call double @llvm.fmuladd.f64(double %1, double 2.000000e+00, double %8)
%10 = fmul double %9, %3
%11 = tail call double @llvm.fmuladd.f64(double %2, double %7, double %10)
%12 = fmul double %4, 2.000000e+00
%13 = fsub double %0, %2
%14 = fmul double %13, %12
%15 = fsub double %1, %3
%16 = tail call double @llvm.fmuladd.f64(double %14, double %15, double %11)
%17 = tail call double @exp(double %16)
ret double %17
}