#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 */
int M_PI;
int exp(double);
int fabs(double const);
int sqrt(int);
double gsl_ran_gaussian_pdf(const double x, const double sigma) {
  double u = x / fabs(sigma);
  double p = (1 / (sqrt(2 * M_PI) * fabs(sigma))) * exp(-u * u / 2);
  return p;
}


x86 assembly (clang, -O0):
<gsl_ran_gaussian_pdf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <fabs@plt>
movsd  -0x30(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
shl    $0x1,%edi
call   1050 <sqrt@plt>
mov    %eax,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <fabs@plt>
mov    -0x28(%rbp),%ecx
imul   %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
mov    %eax,-0x24(%rbp)
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  0xe40(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <exp@plt>
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
imul   %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsl_ran_gaussian_pdf>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
movaps %xmm1,%xmm0
call   1030 <fabs@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
add    %edi,%edi
call   1050 <sqrt@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
call   1030 <fabs@plt>
imul   %ebx,%eax
lea    0x1(%rax),%ecx
xor    %ebx,%ebx
cmp    $0x3,%ecx
cmovb  %eax,%ebx
movsd  (%rsp),%xmm0
mulsd  %xmm0,%xmm0
mulsd  0xe67(%rip),%xmm0
call   1040 <exp@plt>
imul   %ebx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@M_PI = global i32 0
define double @gsl_ran_gaussian_pdf(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %3
%8 = load double, double* %4
%9 = call i32 @fabs(double %8)
%10 = sitofp i32 %9 to double
%11 = fdiv double %7, %10
store double %11, double* %5
%12 = load i32, i32* @M_PI
%13 = mul nsw i32 2, %12
%14 = call i32 @sqrt(i32 %13)
%15 = load double, double* %4
%16 = call i32 @fabs(double %15)
%17 = mul nsw i32 %14, %16
%18 = sdiv i32 1, %17
%19 = load double, double* %5
%20 = fneg double %19
%21 = load double, double* %5
%22 = fmul double %20, %21
%23 = fdiv double %22, 2.000000e+00
%24 = call i32 @exp(double %23)
%25 = mul nsw i32 %18, %24
%26 = sitofp i32 %25 to double
store double %26, double* %6
%27 = load double, double* %6
ret double %27
}

LLVM IR (-O2):
@M_PI = global i32 0
define double @gsl_ran_gaussian_pdf(double %0, double %1) {
%3 = tail call i32 @fabs(double %1)
%4 = sitofp i32 %3 to double
%5 = fdiv double %0, %4
%6 = load i32, i32* @M_PI
%7 = shl nsw i32 %6, 1
%8 = tail call i32 @sqrt(i32 %7)
%9 = tail call i32 @fabs(double %1)
%10 = mul nsw i32 %9, %8
%11 = add i32 %10, 1
%12 = icmp ult i32 %11, 3
%13 = select i1 %12, i32 %10, i32 0
%14 = fneg double %5
%15 = fmul double %5, %14
%16 = fmul double %15, 5.000000e-01
%17 = tail call i32 @exp(double %16)
%18 = mul nsw i32 %13, %17
%19 = sitofp i32 %18 to double
ret double %19
}