#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);
double pow(double, double);
double Calcprob(double x, double meancc, double stddevcc, double meangl,
                double stddevgl, double ratio_gl_cc) {
  double prob1, prob2, prob3, prob4;
  prob1 = (0.5) * pow(((x - meancc) / stddevcc), 2.0);
  prob2 = (0.5) * pow(((x - meangl) / stddevgl), 2.0);
  prob3 = stddevgl * exp(-prob1);
  prob4 = ratio_gl_cc * stddevcc * exp(-prob2);
  return (prob3) / (prob3 + prob4);
}


x86 assembly (clang, -O0):
<Calcprob>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  0xeab(%rip),%xmm1
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xe93(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
divsd  -0x28(%rbp),%xmm0
movsd  0xe7b(%rip),%xmm1
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xe63(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x60(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x30(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x40(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x58(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
addsd  -0x50(%rbp),%xmm1
divsd  %xmm1,%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Calcprob>:
sub    $0x28,%rsp
movsd  %xmm5,0x10(%rsp)
movsd  %xmm4,0x8(%rsp)
movsd  %xmm2,0x20(%rsp)
movapd %xmm0,%xmm5
subsd  %xmm1,%xmm0
divsd  %xmm2,%xmm0
mulsd  %xmm0,%xmm0
subsd  %xmm3,%xmm5
divsd  %xmm4,%xmm5
mulsd  %xmm5,%xmm5
movsd  %xmm5,0x18(%rsp)
mulsd  0xeb0(%rip),%xmm0
call   1030 <exp@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
mulsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x18(%rsp),%xmm0
mulsd  0xe7f(%rip),%xmm0
call   1030 <exp@plt>
mulsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
addsd  %xmm1,%xmm0
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @Calcprob(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%17 = load double, double* %7
%18 = load double, double* %8
%19 = fsub double %17, %18
%20 = load double, double* %9
%21 = fdiv double %19, %20
%22 = call double @pow(double %21, double 2.000000e+00)
%23 = fmul double 5.000000e-01, %22
store double %23, double* %13
%24 = load double, double* %7
%25 = load double, double* %10
%26 = fsub double %24, %25
%27 = load double, double* %11
%28 = fdiv double %26, %27
%29 = call double @pow(double %28, double 2.000000e+00)
%30 = fmul double 5.000000e-01, %29
store double %30, double* %14
%31 = load double, double* %11
%32 = load double, double* %13
%33 = fneg double %32
%34 = call double @exp(double %33)
%35 = fmul double %31, %34
store double %35, double* %15
%36 = load double, double* %12
%37 = load double, double* %9
%38 = fmul double %36, %37
%39 = load double, double* %14
%40 = fneg double %39
%41 = call double @exp(double %40)
%42 = fmul double %38, %41
store double %42, double* %16
%43 = load double, double* %15
%44 = load double, double* %15
%45 = load double, double* %16
%46 = fadd double %44, %45
%47 = fdiv double %43, %46
ret double %47
}

LLVM IR (-O2):
define double @Calcprob(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = fsub double %0, %1
%8 = fdiv double %7, %2
%9 = fmul double %8, %8
%10 = fsub double %0, %3
%11 = fdiv double %10, %4
%12 = fmul double %11, %11
%13 = fmul double %9, -5.000000e-01
%14 = tail call double @exp(double %13)
%15 = fmul double %14, %4
%16 = fmul double %2, %5
%17 = fmul double %12, -5.000000e-01
%18 = tail call double @exp(double %17)
%19 = fmul double %16, %18
%20 = fadd double %15, %19
%21 = fdiv double %15, %20
ret double %21
}