#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 M_PI;
float exp(double);
float normal(double x, double mu, double sigma) {
  return (float)(1.0 / (2.0 * M_PI * sigma * sigma)) *
         exp(-1.0 * (((x - mu) * (x - mu)) / (2.0 * sigma * sigma)));
}


x86 assembly (clang, -O0):
<normal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  0xed9(%rip),%xmm1
mov    0x2eb2(%rip),%rax
mulsd  (%rax),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
movsd  0xec4(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
movsd  -0x8(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xe8f(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
divsd  %xmm0,%xmm1
movsd  0xe71(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movss  -0x1c(%rbp),%xmm0
mulss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<normal>:
push   %rax
mov    0x2ed0(%rip),%rax
movsd  (%rax),%xmm3
addsd  %xmm3,%xmm3
mulsd  %xmm2,%xmm3
mulsd  %xmm2,%xmm3
movsd  0xed0(%rip),%xmm4
divsd  %xmm3,%xmm4
xorps  %xmm3,%xmm3
cvtsd2ss %xmm4,%xmm3
movss  %xmm3,0x4(%rsp)
subsd  %xmm1,%xmm0
movapd %xmm2,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm1
movapd 0xeb7(%rip),%xmm2
xorpd  %xmm0,%xmm2
mulsd  %xmm2,%xmm0
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
mulss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define float @normal(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* @M_PI
%8 = fmul double 2.000000e+00, %7
%9 = load double, double* %6
%10 = fmul double %8, %9
%11 = load double, double* %6
%12 = fmul double %10, %11
%13 = fdiv double 1.000000e+00, %12
%14 = fptrunc double %13 to float
%15 = load double, double* %4
%16 = load double, double* %5
%17 = fsub double %15, %16
%18 = load double, double* %4
%19 = load double, double* %5
%20 = fsub double %18, %19
%21 = fmul double %17, %20
%22 = load double, double* %6
%23 = fmul double 2.000000e+00, %22
%24 = load double, double* %6
%25 = fmul double %23, %24
%26 = fdiv double %21, %25
%27 = fmul double -1.000000e+00, %26
%28 = call float @exp(double %27)
%29 = fmul float %14, %28
ret float %29
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define float @normal(double %0, double %1, double %2) {
%4 = load double, double* @M_PI
%5 = fmul double %4, 2.000000e+00
%6 = fmul double %5, %2
%7 = fmul double %6, %2
%8 = fdiv double 1.000000e+00, %7
%9 = fptrunc double %8 to float
%10 = fsub double %0, %1
%11 = fmul double %2, 2.000000e+00
%12 = fmul double %11, %2
%13 = fneg double %10
%14 = fmul double %10, %13
%15 = fdiv double %14, %12
%16 = tail call float @exp(double %15)
%17 = fmul float %16, %9
ret float %17
}