long double chdtrl(df, x)
long double df, x;
{
  if ((x < 0.0L) || (df < 1.0L)) {
    mtherr("chdtrl", 1);
    return (0.0L);
  }
  return (igaml(0.5L * df, 0.5L * x));
}


x86 assembly (clang, -O0):
<chdtrl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x20(%rbp)
fstpt  -0x30(%rbp)
fldt   -0x30(%rbp)
fldz
fucomip %st(1),%st
fstp   %st(0)
ja     115c <chdtrl+0x3c>
jmp    1148 <chdtrl+0x28>
fldt   -0x20(%rbp)
fld1
fucomip %st(1),%st
fstp   %st(0)
jbe    1179 <chdtrl+0x59>
jmp    115c <chdtrl+0x3c>
lea    0xea1(%rip),%rdi
xor    %eax,%eax
mov    $0x1,%esi
call   1040 <mtherr@plt>
fldz
fstpt  -0x10(%rbp)
jmp    11a1 <chdtrl+0x81>
fldt   -0x20(%rbp)
flds   0xe7e(%rip)
fmul   %st,%st(1)
fldt   -0x30(%rbp)
fmulp  %st,%st(1)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
xor    %eax,%eax
call   1030 <igaml@plt>
mov    %eax,-0x34(%rbp)
fildl  -0x34(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chdtrl>:
sub    $0x28,%rsp
fldt   0x40(%rsp)
fldt   0x30(%rsp)
fld1
fucomip %st(1),%st
ja     115f <chdtrl+0x3f>
fldz
fucomip %st(2),%st
ja     115f <chdtrl+0x3f>
flds   0xec2(%rip)
fmul   %st,%st(1)
fmulp  %st,%st(2)
fxch   %st(1)
fstpt  0x10(%rsp)
fstpt  (%rsp)
xor    %eax,%eax
call   1030 <igaml@plt>
mov    %eax,0x24(%rsp)
fildl  0x24(%rsp)
add    $0x28,%rsp
ret
fstp   %st(1)
fstp   %st(0)
lea    0xe9a(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <mtherr@plt>
fldz
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"chdtrl\00"
define x86_fp80 @chdtrl(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
%5 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %4
store x86_fp80 %1, x86_fp80* %5
%6 = load x86_fp80, x86_fp80* %5
%7 = fcmp olt x86_fp80 %6, 0xK00000000000000000000
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load x86_fp80, x86_fp80* %4
%10 = fcmp olt x86_fp80 %9, 0xK3FFF8000000000000000
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 x86_fp80 0xK00000000000000000000, x86_fp80* %3
br label %20
13: ; preds = %8
%14 = load x86_fp80, x86_fp80* %4
%15 = fmul x86_fp80 0xK3FFE8000000000000000, %14
%16 = load x86_fp80, x86_fp80* %5
%17 = fmul x86_fp80 0xK3FFE8000000000000000, %16
%18 = call i32 (x86_fp80, x86_fp80, ...) bitcast (i32 (...)* @igaml to i32 (x86_fp80, x86_fp80, ...)*)(x86_fp80 %15, x86_fp80 %17)
%19 = sitofp i32 %18 to x86_fp80
store x86_fp80 %19, x86_fp80* %3
br label %20
20: ; preds = %13, %11
%21 = load x86_fp80, x86_fp80* %3
ret x86_fp80 %21
}

LLVM IR (-O2):
@.str = [7 x i8] c"chdtrl\00"
define x86_fp80 @chdtrl(x86_fp80 %0, x86_fp80 %1) {
%3 = fcmp olt x86_fp80 %1, 0xK00000000000000000000
%4 = fcmp olt x86_fp80 %0, 0xK3FFF8000000000000000
%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 x86_fp80 %0, 0xK3FFE8000000000000000
%10 = fmul x86_fp80 %1, 0xK3FFE8000000000000000
%11 = tail call i32 (x86_fp80, x86_fp80, ...) bitcast (i32 (...)* @igaml to i32 (x86_fp80, x86_fp80, ...)*)(x86_fp80 %9, x86_fp80 %10)
%12 = sitofp i32 %11 to x86_fp80
br label %13
13: ; preds = %8, %6
%14 = phi x86_fp80 [ 0xK00000000000000000000, %6 ], [ %12, %8 ]
ret x86_fp80 %14
}