#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 exp(double const);
double gaussian_filter_calc_with_sigma(const double x, const double y,
                                       const double sigma) {
  double two_sigma_square = 2 * sigma * sigma;
  return 1 / (3.1415 * two_sigma_square) *
         exp(-((x * x) + (y * y)) / two_sigma_square);
}


x86 assembly (clang, -O0):
<gaussian_filter_calc_with_sigma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  0xee1(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xec2(%rip),%xmm1
mulsd  -0x20(%rbp),%xmm1
movsd  0xead(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0x20(%rbp),%xmm0
call   1030 <exp@plt>
movsd  -0x28(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gaussian_filter_calc_with_sigma>:
push   %rax
movapd %xmm2,%xmm3
addsd  %xmm2,%xmm3
mulsd  %xmm2,%xmm3
movsd  0xedb(%rip),%xmm2
mulsd  %xmm3,%xmm2
movsd  0xed7(%rip),%xmm4
divsd  %xmm2,%xmm4
movsd  %xmm4,(%rsp)
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  0xec2(%rip),%xmm0
divsd  %xmm3,%xmm0
call   1030 <exp@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @gaussian_filter_calc_with_sigma(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* %6
%9 = fmul double 2.000000e+00, %8
%10 = load double, double* %6
%11 = fmul double %9, %10
store double %11, double* %7
%12 = load double, double* %7
%13 = fmul double 3.141500e+00, %12
%14 = fdiv double 1.000000e+00, %13
%15 = load double, double* %4
%16 = load double, double* %4
%17 = load double, double* %5
%18 = load double, double* %5
%19 = fmul double %17, %18
%20 = call double @llvm.fmuladd.f64(double %15, double %16, double %19)
%21 = fneg double %20
%22 = load double, double* %7
%23 = fdiv double %21, %22
%24 = call i32 @exp(double %23)
%25 = sitofp i32 %24 to double
%26 = fmul double %14, %25
ret double %26
}

LLVM IR (-O2):
define double @gaussian_filter_calc_with_sigma(double %0, double %1, double %2) {
%4 = fmul double %2, 2.000000e+00
%5 = fmul double %4, %2
%6 = fmul double %5, 3.141500e+00
%7 = fdiv double 1.000000e+00, %6
%8 = fmul double %1, %1
%9 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %8)
%10 = fneg double %9
%11 = fdiv double %10, %5
%12 = tail call i32 @exp(double %11)
%13 = sitofp i32 %12 to double
%14 = fmul double %7, %13
ret double %14
}