#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 pow(double const, int);
double const sqrt(int);
double dnorm(const double x, const double mu, const double sigma) {
  double a =
      1.0 /
      ((sqrt(2 * 3.141592653589793238462643383279502884197169399375)) * sigma);
  double b = pow(x - mu, 2) / (2.0 * sigma * sigma);
  return a * exp(-b);
}


x86 assembly (clang, -O0):
<dnorm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    $0x6,%edi
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
mulsd  -0x18(%rbp),%xmm1
movsd  0xea7(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movsd  0xe7a(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dnorm>:
sub    $0x28,%rsp
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,0x18(%rsp)
movsd  %xmm0,0x10(%rsp)
mov    $0x6,%edi
call   1050 <sqrt@plt>
mulsd  0x8(%rsp),%xmm0
movsd  0xea2(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x20(%rsp)
movsd  0x10(%rsp),%xmm0
subsd  0x18(%rsp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movsd  0x8(%rsp),%xmm2
movapd %xmm2,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm1
xorpd  0xe78(%rip),%xmm0
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
mulsd  0x20(%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @dnorm(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%9 = call double @sqrt(i32 6)
%10 = load double, double* %6
%11 = fmul double %9, %10
%12 = fdiv double 1.000000e+00, %11
store double %12, double* %7
%13 = load double, double* %4
%14 = load double, double* %5
%15 = fsub double %13, %14
%16 = call double @pow(double %15, i32 2)
%17 = load double, double* %6
%18 = fmul double 2.000000e+00, %17
%19 = load double, double* %6
%20 = fmul double %18, %19
%21 = fdiv double %16, %20
store double %21, double* %8
%22 = load double, double* %7
%23 = load double, double* %8
%24 = fneg double %23
%25 = call double @exp(double %24)
%26 = fmul double %22, %25
ret double %26
}

LLVM IR (-O2):
define double @dnorm(double %0, double %1, double %2) {
%4 = tail call double @sqrt(i32 6)
%5 = fmul double %4, %2
%6 = fdiv double 1.000000e+00, %5
%7 = fsub double %0, %1
%8 = tail call double @pow(double %7, i32 2)
%9 = fmul double %2, 2.000000e+00
%10 = fmul double %9, %2
%11 = fneg double %8
%12 = fdiv double %11, %10
%13 = tail call double @exp(double %12)
%14 = fmul double %6, %13
ret double %14
}