double cephes_chdtrc(df, x)
double df, x;
{
  if ((x < 0.0) || (df < 1.0)) {
    mtherr("chdtrc", 1);
    return (0.0);
  }
  return (cephes_igamc(df / 2.0, x / 2.0));
}


x86 assembly (clang, -O0):
<cephes_chdtrc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
ja     1153 <cephes_chdtrc+0x33>
movsd  0xeb8(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1173 <cephes_chdtrc+0x53>
lea    0xeb6(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1040 <mtherr@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11a5 <cephes_chdtrc+0x85>
movsd  -0x10(%rbp),%xmm0
movsd  0xe88(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xe77(%rip),%xmm2
divsd  %xmm2,%xmm1
mov    $0x2,%al
call   1030 <cephes_igamc@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cephes_chdtrc>:
push   %rax
movsd  0xed7(%rip),%xmm2
ucomisd %xmm0,%xmm2
ja     1159 <cephes_chdtrc+0x39>
xorpd  %xmm2,%xmm2
ucomisd %xmm1,%xmm2
ja     1159 <cephes_chdtrc+0x39>
movsd  0xec7(%rip),%xmm2
mulsd  %xmm2,%xmm0
mulsd  %xmm2,%xmm1
mov    $0x2,%al
call   1030 <cephes_igamc@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret
lea    0xeb0(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <mtherr@plt>
xorpd  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"chdtrc\00"
define double @cephes_chdtrc(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %5
%7 = fcmp olt double %6, 0.000000e+00
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load double, double* %4
%10 = fcmp olt double %9, 1.000000e+00
br i1 %10, label %11, label %13
11: ; preds = %8, %2
%12 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @mtherr to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 1)
store double 0.000000e+00, double* %3
br label %20
13: ; preds = %8
%14 = load double, double* %4
%15 = fdiv double %14, 2.000000e+00
%16 = load double, double* %5
%17 = fdiv double %16, 2.000000e+00
%18 = call i32 (double, double, ...) bitcast (i32 (...)* @cephes_igamc to i32 (double, double, ...)*)(double %15, double %17)
%19 = sitofp i32 %18 to double
store double %19, double* %3
br label %20
20: ; preds = %13, %11
%21 = load double, double* %3
ret double %21
}

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