#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(int);
double bp_sw_ExtremeValueP(float x, float mu, float lambda) {
  double y;
  y = exp(-1. * lambda * (x - mu));
  if (y < 1e-7)
    return y;
  else
    return (1.0 - exp(-1. * y));
}


x86 assembly (clang, -O0):
<bp_sw_ExtremeValueP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xed0(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0xc(%rbp),%xmm1
subss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <exp@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  0xe9c(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    117e <bp_sw_ExtremeValueP+0x6e>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11a8 <bp_sw_ExtremeValueP+0x98>
movsd  0xe82(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  0xe71(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bp_sw_ExtremeValueP>:
push   %rax
cvtss2sd %xmm2,%xmm2
xorps  0xee4(%rip),%xmm2
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  %xmm2,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <exp@plt>
movsd  0xed7(%rip),%xmm1
ucomisd %xmm0,%xmm1
ja     1164 <bp_sw_ExtremeValueP+0x54>
movapd 0xeb9(%rip),%xmm1
xorpd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1030 <exp@plt>
movapd %xmm0,%xmm1
movsd  0xeb8(%rip),%xmm0
subsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @bp_sw_ExtremeValueP(float %0, float %1, float %2) {
%4 = alloca double
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca double
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
%9 = load float, float* %7
%10 = fpext float %9 to double
%11 = fmul double -1.000000e+00, %10
%12 = load float, float* %5
%13 = load float, float* %6
%14 = fsub float %12, %13
%15 = fpext float %14 to double
%16 = fmul double %11, %15
%17 = fptosi double %16 to i32
%18 = call double @exp(i32 %17)
store double %18, double* %8
%19 = load double, double* %8
%20 = fcmp olt double %19, 0x3E7AD7F29ABCAF48
br i1 %20, label %21, label %23
21: ; preds = %3
%22 = load double, double* %8
store double %22, double* %4
br label %29
23: ; preds = %3
%24 = load double, double* %8
%25 = fmul double -1.000000e+00, %24
%26 = fptosi double %25 to i32
%27 = call double @exp(i32 %26)
%28 = fsub double 1.000000e+00, %27
store double %28, double* %4
br label %29
29: ; preds = %23, %21
%30 = load double, double* %4
ret double %30
}

LLVM IR (-O2):
define double @bp_sw_ExtremeValueP(float %0, float %1, float %2) {
%4 = fpext float %2 to double
%5 = fneg double %4
%6 = fsub float %0, %1
%7 = fpext float %6 to double
%8 = fmul double %5, %7
%9 = fptosi double %8 to i32
%10 = tail call double @exp(i32 %9)
%11 = fcmp olt double %10, 0x3E7AD7F29ABCAF48
br i1 %11, label %17, label %12
12: ; preds = %3
%13 = fneg double %10
%14 = fptosi double %13 to i32
%15 = tail call double @exp(i32 %14)
%16 = fsub double 1.000000e+00, %15
br label %17
17: ; preds = %3, %12
%18 = phi double [ %16, %12 ], [ %10, %3 ]
ret double %18
}