#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 */
float igamif(double, float);
int /*<<< orphan*/ mtherrf(char *, int);
float chdtrif(float dff, float yy) {
  float y, df, x;
  y = yy;
  df = dff;
  if ((y < 0.0) || (y > 1.0) || (df < 1.0)) {
    mtherrf("chdtrif", 1);
    return (0.0);
  }
  x = igamif(0.5 * df, y);
  return (2.0 * x);
}


x86 assembly (clang, -O0):
<chdtrif>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
ja     1192 <chdtrif+0x72>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe93(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     1192 <chdtrif+0x72>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe78(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11b0 <chdtrif+0x90>
lea    0xe7f(%rip),%rdi
mov    $0x1,%esi
call   1040 <mtherrf@plt>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    11f2 <chdtrif+0xd2>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe4f(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x10(%rbp),%xmm1
call   1030 <igamif@plt>
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe23(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chdtrif>:
push   %rax
movss  0xed7(%rip),%xmm2
ucomiss %xmm0,%xmm2
ja     1156 <chdtrif+0x36>
xorps  %xmm2,%xmm2
ucomiss %xmm1,%xmm2
ja     1156 <chdtrif+0x36>
ucomiss 0xec3(%rip),%xmm1
ja     1156 <chdtrif+0x36>
cvtss2sd %xmm0,%xmm0
mulsd  0xebd(%rip),%xmm0
call   1030 <igamif@plt>
addss  %xmm0,%xmm0
pop    %rax
ret
lea    0xeb3(%rip),%rdi
mov    $0x1,%esi
call   1040 <mtherrf@plt>
xorps  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [8 x i8] c"chdtrif\00"
define float @chdtrif(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %4
store float %1, float* %5
%9 = load float, float* %5
store float %9, float* %6
%10 = load float, float* %4
store float %10, float* %7
%11 = load float, float* %6
%12 = fpext float %11 to double
%13 = fcmp olt double %12, 0.000000e+00
br i1 %13, label %22, label %14
14: ; preds = %2
%15 = load float, float* %6
%16 = fpext float %15 to double
%17 = fcmp ogt double %16, 1.000000e+00
br i1 %17, label %22, label %18
18: ; preds = %14
%19 = load float, float* %7
%20 = fpext float %19 to double
%21 = fcmp olt double %20, 1.000000e+00
br i1 %21, label %22, label %24
22: ; preds = %18, %14, %2
%23 = call i32 @mtherrf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 1)
store float 0.000000e+00, float* %3
br label %34
24: ; preds = %18
%25 = load float, float* %7
%26 = fpext float %25 to double
%27 = fmul double 5.000000e-01, %26
%28 = load float, float* %6
%29 = call float @igamif(double %27, float %28)
store float %29, float* %8
%30 = load float, float* %8
%31 = fpext float %30 to double
%32 = fmul double 2.000000e+00, %31
%33 = fptrunc double %32 to float
store float %33, float* %3
br label %34
34: ; preds = %24, %22
%35 = load float, float* %3
ret float %35
}

LLVM IR (-O2):
@.str = [8 x i8] c"chdtrif\00"
define float @chdtrif(float %0, float %1) {
%3 = fcmp olt float %1, 0.000000e+00
%4 = fcmp ogt float %1, 1.000000e+00
%5 = or i1 %3, %4
%6 = fcmp olt float %0, 1.000000e+00
%7 = or i1 %6, %5
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @mtherrf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 1)
br label %15
10: ; preds = %2
%11 = fpext float %0 to double
%12 = fmul double %11, 5.000000e-01
%13 = tail call float @igamif(double %12, float %1)
%14 = fmul float %13, 2.000000e+00
br label %15
15: ; preds = %10, %8
%16 = phi float [ 0.000000e+00, %8 ], [ %14, %10 ]
ret float %16
}