#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 igamcf(double, double);
int /*<<< orphan*/ mtherr(char *, int);
float chdtrcf(float dff, float xx) {
  float df, x;
  df = dff;
  x = xx;
  if ((x < 0.0) || (df < 1.0)) {
    mtherr("chdtrcf", 1);
    return (0.0);
  }
  return (igamcf(0.5 * df, 0.5 * x));
}


x86 assembly (clang, -O0):
<chdtrcf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
ja     1177 <chdtrcf+0x57>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe93(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1195 <chdtrcf+0x75>
lea    0xe92(%rip),%rdi
mov    $0x1,%esi
call   1040 <mtherr@plt>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    11c9 <chdtrcf+0xa9>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe62(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x14(%rbp),%xmm1
cvtss2sd %xmm1,%xmm2
movsd  0xe4d(%rip),%xmm1
mulsd  %xmm2,%xmm1
call   1030 <igamcf@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chdtrcf>:
push   %rax
movss  0xed7(%rip),%xmm2
ucomiss %xmm0,%xmm2
ja     1154 <chdtrcf+0x34>
xorps  %xmm2,%xmm2
ucomiss %xmm1,%xmm2
ja     1154 <chdtrcf+0x34>
cvtss2sd %xmm1,%xmm1
cvtss2sd %xmm0,%xmm0
movsd  0xec2(%rip),%xmm2
mulsd  %xmm2,%xmm0
mulsd  %xmm2,%xmm1
pop    %rax
jmp    1030 <igamcf@plt>
lea    0xeb5(%rip),%rdi
mov    $0x1,%esi
call   1040 <mtherr@plt>
xorps  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [8 x i8] c"chdtrcf\00"
define float @chdtrcf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %4
store float %1, float* %5
%8 = load float, float* %4
store float %8, float* %6
%9 = load float, float* %5
store float %9, float* %7
%10 = load float, float* %7
%11 = fpext float %10 to double
%12 = fcmp olt double %11, 0.000000e+00
br i1 %12, label %17, label %13
13: ; preds = %2
%14 = load float, float* %6
%15 = fpext float %14 to double
%16 = fcmp olt double %15, 1.000000e+00
br i1 %16, label %17, label %19
17: ; preds = %13, %2
%18 = call i32 @mtherr(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 %27
19: ; preds = %13
%20 = load float, float* %6
%21 = fpext float %20 to double
%22 = fmul double 5.000000e-01, %21
%23 = load float, float* %7
%24 = fpext float %23 to double
%25 = fmul double 5.000000e-01, %24
%26 = call float @igamcf(double %22, double %25)
store float %26, float* %3
br label %27
27: ; preds = %19, %17
%28 = load float, float* %3
ret float %28
}

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