#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 */
typedef int uint32_t;

/* Variables and functions */
double pow(double, int);
double sqrt(int);
double NormalDistribution(double Var, uint32_t Variance, uint32_t Mean) {
  return pow(((double)1) / (sqrt(2 * Variance * 3.14159265358979323846)),
             (-pow(Var - Mean, 2)) / (2 * Variance));
}


x86 assembly (clang, -O0):
<NormalDistribution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  0xec3(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xea3(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsi2sdl -0x10(%rbp),%xmm1
subsd  %xmm1,%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
cvtsi2sd %eax,%xmm2
divsd  %xmm2,%xmm1
cvttsd2si %xmm1,%edi
call   1030 <pow@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NormalDistribution>:
push   %rbx
sub    $0x20,%rsp
mov    %esi,%ebx
movsd  %xmm0,0x10(%rsp)
add    %edi,%edi
cvtsi2sd %edi,%xmm1
movsd  %xmm1,0x18(%rsp)
movsd  0xebf(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <sqrt@plt>
movsd  0xeb2(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
xorps  %xmm1,%xmm1
cvtsi2sd %ebx,%xmm1
movsd  0x10(%rsp),%xmm0
subsd  %xmm1,%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
xorpd  0xe8d(%rip),%xmm0
divsd  0x18(%rsp),%xmm0
cvttsd2si %xmm0,%edi
movsd  0x8(%rsp),%xmm0
add    $0x20,%rsp
pop    %rbx
jmp    1030 <pow@plt>

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

LLVM IR (-O2):
define double @NormalDistribution(double %0, i32 %1, i32 %2) {
%4 = shl nsw i32 %1, 1
%5 = sitofp i32 %4 to double
%6 = fmul double %5, 0x400921FB54442D18
%7 = fptosi double %6 to i32
%8 = tail call double @sqrt(i32 %7)
%9 = fdiv double 1.000000e+00, %8
%10 = sitofp i32 %2 to double
%11 = fsub double %0, %10
%12 = tail call double @pow(double %11, i32 2)
%13 = fneg double %12
%14 = fdiv double %13, %5
%15 = fptosi double %14 to i32
%16 = tail call double @pow(double %9, i32 %15)
ret double %16
}