#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 lognormalcdf(double, double, double);
double lognormalpdf(double, double, double);
double lognormalhrf(double x, double a, double b) {
  if ((x == 0.0) || (x > 70000))
    return 0.0;
  else
    return lognormalpdf(x, a, b) / (1.0 - lognormalcdf(x, a, b));
}


x86 assembly (clang, -O0):
<lognormalhrf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1154 <lognormalhrf+0x34>
jp     1154 <lognormalhrf+0x34>
jmp    116b <lognormalhrf+0x4b>
movsd  -0x10(%rbp),%xmm0
movsd  0xe9f(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1178 <lognormalhrf+0x58>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11c2 <lognormalhrf+0xa2>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
call   1040 <lognormalpdf@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
call   1030 <lognormalcdf@plt>
movaps %xmm0,%xmm2
movsd  -0x28(%rbp),%xmm0
movsd  0xe53(%rip),%xmm1
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lognormalhrf>:
sub    $0x28,%rsp
movapd %xmm0,%xmm3
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm3
jne    1134 <lognormalhrf+0x14>
jnp    118c <lognormalhrf+0x6c>
ucomisd 0xec4(%rip),%xmm3
ja     118c <lognormalhrf+0x6c>
movapd %xmm3,%xmm0
movsd  %xmm1,0x10(%rsp)
movsd  %xmm2,0x18(%rsp)
movsd  %xmm3,0x8(%rsp)
call   1040 <lognormalpdf@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
call   1030 <lognormalcdf@plt>
movsd  0xe8a(%rip),%xmm1
subsd  %xmm0,%xmm1
movsd  0x20(%rsp),%xmm0
divsd  %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @lognormalhrf(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%8 = load double, double* %5
%9 = fcmp oeq double %8, 0.000000e+00
br i1 %9, label %13, label %10
10: ; preds = %3
%11 = load double, double* %5
%12 = fcmp ogt double %11, 7.000000e+04
br i1 %12, label %13, label %14
13: ; preds = %10, %3
store double 0.000000e+00, double* %4
br label %25
14: ; preds = %10
%15 = load double, double* %5
%16 = load double, double* %6
%17 = load double, double* %7
%18 = call double @lognormalpdf(double %15, double %16, double %17)
%19 = load double, double* %5
%20 = load double, double* %6
%21 = load double, double* %7
%22 = call double @lognormalcdf(double %19, double %20, double %21)
%23 = fsub double 1.000000e+00, %22
%24 = fdiv double %18, %23
store double %24, double* %4
br label %25
25: ; preds = %14, %13
%26 = load double, double* %4
ret double %26
}

LLVM IR (-O2):
define double @lognormalhrf(double %0, double %1, double %2) {
%4 = fcmp oeq double %0, 0.000000e+00
%5 = fcmp ogt double %0, 7.000000e+04
%6 = or i1 %4, %5
br i1 %6, label %12, label %7
7: ; preds = %3
%8 = tail call double @lognormalpdf(double %0, double %1, double %2)
%9 = tail call double @lognormalcdf(double %0, double %1, double %2)
%10 = fsub double 1.000000e+00, %9
%11 = fdiv double %8, %10
br label %12
12: ; preds = %3, %7
%13 = phi double [ %11, %7 ], [ 0.000000e+00, %3 ]
ret double %13
}