#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 exp(double);
int /*<<< orphan*/ fisError(char *);
double fisGaussianMf(double x, double *params) {
  double sigma = params[0], c = params[1];
  double tmp;
  if (sigma == 0)
    fisError("Illegal parameters in fisGaussianMF() --> sigma = 0");
  tmp = (x - c) / sigma;
  return (exp(-tmp * tmp / 2));
}


x86 assembly (clang, -O0):
<fisGaussianMf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1170 <fisGaussianMf+0x50>
jp     1170 <fisGaussianMf+0x50>
lea    0xe9d(%rip),%rdi
call   1030 <fisError@plt>
movsd  -0x8(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  0xe53(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <exp@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fisGaussianMf>:
sub    $0x18,%rsp
movsd  (%rdi),%xmm2
movsd  0x8(%rdi),%xmm3
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm2
jne    1167 <fisGaussianMf+0x47>
jp     1167 <fisGaussianMf+0x47>
lea    0xec8(%rip),%rdi
movsd  %xmm0,0x10(%rsp)
movsd  %xmm2,0x8(%rsp)
movsd  %xmm3,(%rsp)
call   1030 <fisError@plt>
movsd  (%rsp),%xmm3
movsd  0x8(%rsp),%xmm2
movsd  0x10(%rsp),%xmm0
subsd  %xmm3,%xmm0
divsd  %xmm2,%xmm0
mulsd  %xmm0,%xmm0
mulsd  0xe85(%rip),%xmm0
add    $0x18,%rsp
jmp    1040 <exp@plt>

LLVM IR (-O0):
@.str = [52 x i8] c"Illegal parameters in fisGaussianMF() --> sigma = 0\00"
define double @fisGaussianMf(double %0, double* %1) {
%3 = alloca double
%4 = alloca double*
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %3
store double* %1, double** %4
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
store double %10, double* %5
%11 = load double*, double** %4
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
store double %13, double* %6
%14 = load double, double* %5
%15 = fcmp oeq double %14, 0.000000e+00
br i1 %15, label %16, label %18
16: ; preds = %2
%17 = call i32 @fisError(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %2
%19 = load double, double* %3
%20 = load double, double* %6
%21 = fsub double %19, %20
%22 = load double, double* %5
%23 = fdiv double %21, %22
store double %23, double* %7
%24 = load double, double* %7
%25 = fneg double %24
%26 = load double, double* %7
%27 = fmul double %25, %26
%28 = fdiv double %27, 2.000000e+00
%29 = call double @exp(double %28)
ret double %29
}

LLVM IR (-O2):
@.str = [52 x i8] c"Illegal parameters in fisGaussianMF() --> sigma = 0\00"
define double @fisGaussianMf(double %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = getelementptr inbounds double, double* %1, i64 1
%5 = load double, double* %4
%6 = fcmp oeq double %3, 0.000000e+00
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @fisError(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
%10 = fsub double %0, %5
%11 = fdiv double %10, %3
%12 = fneg double %11
%13 = fmul double %11, %12
%14 = fmul double %13, 5.000000e-01
%15 = tail call double @exp(double %14)
ret double %15
}