#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 zs_to_p(double zs) {
  double e, z;
  z = (zs - 50.0) / 10.0;
  if (z > 400.0)
    return 0.0;
  e = exp(-1.28254983016186409554 * z - 0.57721566490153286060);
  return (e > .01 ? 1.0 - exp(-e) : e);
}


x86 assembly (clang, -O0):
<zs_to_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xee6(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xed2(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xeb4(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1163 <zs_to_p+0x53>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11ef <zs_to_p+0xdf>
movsd  -0x20(%rbp),%xmm0
movsd  0xeb0(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeac(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe81(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11db <zs_to_p+0xcb>
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  0xe63(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    11e5 <zs_to_p+0xd5>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zs_to_p>:
push   %rax
movapd %xmm0,%xmm1
addsd  0xee3(%rip),%xmm1
divsd  0xee3(%rip),%xmm1
xorpd  %xmm0,%xmm0
ucomisd 0xedf(%rip),%xmm1
ja     117b <zs_to_p+0x6b>
mulsd  0xedd(%rip),%xmm1
addsd  0xedd(%rip),%xmm1
movapd %xmm1,%xmm0
call   1030 <exp@plt>
ucomisd 0xed4(%rip),%xmm0
jbe    117b <zs_to_p+0x6b>
movapd 0xee2(%rip),%xmm1
xorpd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <exp@plt>
movapd %xmm0,%xmm1
movsd  0xeb9(%rip),%xmm0
subsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @zs_to_p(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
%6 = load double, double* %3
%7 = fsub double %6, 5.000000e+01
%8 = fdiv double %7, 1.000000e+01
store double %8, double* %5
%9 = load double, double* %5
%10 = fcmp ogt double %9, 4.000000e+02
br i1 %10, label %11, label %12
11: ; preds = %1
store double 0.000000e+00, double* %2
br label %27
12: ; preds = %1
%13 = load double, double* %5
%14 = call double @llvm.fmuladd.f64(double 0xBFF48552F88091A8, double %13, double 0xBFE2788CFC6FB619)
%15 = call double @exp(double %14)
store double %15, double* %4
%16 = load double, double* %4
%17 = fcmp ogt double %16, 1.000000e-02
br i1 %17, label %18, label %23
18: ; preds = %12
%19 = load double, double* %4
%20 = fneg double %19
%21 = call double @exp(double %20)
%22 = fsub double 1.000000e+00, %21
br label %25
23: ; preds = %12
%24 = load double, double* %4
br label %25
25: ; preds = %23, %18
%26 = phi double [ %22, %18 ], [ %24, %23 ]
store double %26, double* %2
br label %27
27: ; preds = %25, %11
%28 = load double, double* %2
ret double %28
}

LLVM IR (-O2):
define double @zs_to_p(double %0) {
%2 = fadd double %0, -5.000000e+01
%3 = fdiv double %2, 1.000000e+01
%4 = fcmp ogt double %3, 4.000000e+02
br i1 %4, label %13, label %5
5: ; preds = %1
%6 = tail call double @llvm.fmuladd.f64(double %3, double 0xBFF48552F88091A8, double 0xBFE2788CFC6FB619)
%7 = tail call double @exp(double %6)
%8 = fcmp ogt double %7, 1.000000e-02
br i1 %8, label %9, label %13
9: ; preds = %5
%10 = fneg double %7
%11 = tail call double @exp(double %10)
%12 = fsub double 1.000000e+00, %11
br label %13
13: ; preds = %9, %5, %1
%14 = phi double [ 0.000000e+00, %1 ], [ %12, %9 ], [ %7, %5 ]
ret double %14
}