#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(int);
int pow(double, int);
double sqrt(int);
double prob_norm(double mean, double sd, double x) {
  double norm;
  norm =
      (1 / (sd * sqrt(2 * M_PI))) * exp(-(pow(x - mean, 2) / (2 * pow(sd, 2))));
  return norm;
}


x86 assembly (clang, -O0):
<prob_norm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
shl    $0x1,%edi
call   1050 <sqrt@plt>
movsd  -0x38(%rbp),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xe8d(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
mov    %eax,-0x2c(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
mov    %eax,%ecx
mov    -0x2c(%rbp),%eax
shl    $0x1,%ecx
cltd
idiv   %ecx
xor    %edi,%edi
sub    %eax,%edi
call   1030 <exp@plt>
movsd  -0x28(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prob_norm>:
push   %rbx
sub    $0x20,%rsp
movsd  %xmm2,0x10(%rsp)
movsd  %xmm1,(%rsp)
movsd  %xmm0,0x8(%rsp)
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
add    %edi,%edi
call   1050 <sqrt@plt>
mulsd  (%rsp),%xmm0
movsd  0xe9d(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x18(%rsp)
movsd  0x10(%rsp),%xmm0
subsd  0x8(%rsp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
mov    %eax,%ebx
movsd  (%rsp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
mov    %eax,%ecx
add    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
neg    %eax
mov    %eax,%edi
call   1030 <exp@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x18(%rsp),%xmm0
add    $0x20,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@M_PI = global i32 0
define double @prob_norm(double %0, double %1, double %2) {
%4 = load i32, i32* @M_PI
%5 = shl nsw i32 %4, 1
%6 = tail call double @sqrt(i32 %5)
%7 = fmul double %6, %1
%8 = fdiv double 1.000000e+00, %7
%9 = fsub double %2, %0
%10 = tail call i32 @pow(double %9, i32 2)
%11 = tail call i32 @pow(double %1, i32 2)
%12 = shl nsw i32 %11, 1
%13 = sdiv i32 %10, %12
%14 = sub nsw i32 0, %13
%15 = tail call i32 @exp(i32 %14)
%16 = sitofp i32 %15 to double
%17 = fmul double %8, %16
ret double %17
}