long double chdtril(df, y)
long double df, y;
{
  long double x;
  if ((y < 0.0L) || (y > 1.0L) || (df < 1.0L)) {
    mtherr("chdtril", 1);
    return (0.0L);
  }
  x = igamil(0.5L * df, y);
  return (2.0L * x);
}


x86 assembly (clang, -O0):
<chdtril>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%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     1172 <chdtril+0x52>
jmp    1148 <chdtril+0x28>
fldt   -0x30(%rbp)
fld1
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
ja     1172 <chdtril+0x52>
jmp    115e <chdtril+0x3e>
fldt   -0x20(%rbp)
fld1
fucomip %st(1),%st
fstp   %st(0)
jbe    118f <chdtril+0x6f>
jmp    1172 <chdtril+0x52>
lea    0xe8b(%rip),%rdi
xor    %eax,%eax
mov    $0x1,%esi
call   1040 <mtherr@plt>
fldz
fstpt  -0x10(%rbp)
jmp    11bd <chdtril+0x9d>
fldt   -0x20(%rbp)
flds   0xe68(%rip)
fmulp  %st,%st(1)
fldt   -0x30(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
xor    %eax,%eax
call   1030 <igamil@plt>
mov    %eax,-0x44(%rbp)
fildl  -0x44(%rbp)
fstpt  -0x40(%rbp)
fldt   -0x40(%rbp)
fadd   %st,%st(0)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chdtril>:
sub    $0x28,%rsp
fldt   0x40(%rsp)
fldt   0x30(%rsp)
fld1
fucomi %st(1),%st
ja     1169 <chdtril+0x49>
fldz
fucomip %st(3),%st
ja     1169 <chdtril+0x49>
fxch   %st(2)
fucomi %st(2),%st
fstp   %st(2)
fldz
ja     1169 <chdtril+0x49>
fstp   %st(0)
fmuls  0xeb6(%rip)
fxch   %st(1)
fstpt  0x10(%rsp)
fstpt  (%rsp)
xor    %eax,%eax
call   1030 <igamil@plt>
mov    %eax,0x24(%rsp)
fildl  0x24(%rsp)
fadd   %st,%st(0)
add    $0x28,%rsp
ret
fstp   %st(2)
fstp   %st(0)
fstp   %st(0)
lea    0xe8e(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <mtherr@plt>
fldz
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"chdtril\00"
define x86_fp80 @chdtril(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
%5 = alloca x86_fp80
%6 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %4
store x86_fp80 %1, x86_fp80* %5
%7 = load x86_fp80, x86_fp80* %5
%8 = fcmp olt x86_fp80 %7, 0xK00000000000000000000
br i1 %8, label %15, label %9
9: ; preds = %2
%10 = load x86_fp80, x86_fp80* %5
%11 = fcmp ogt x86_fp80 %10, 0xK3FFF8000000000000000
br i1 %11, label %15, label %12
12: ; preds = %9
%13 = load x86_fp80, x86_fp80* %4
%14 = fcmp olt x86_fp80 %13, 0xK3FFF8000000000000000
br i1 %14, label %15, label %17
15: ; preds = %12, %9, %2
%16 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @mtherr to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 1)
store x86_fp80 0xK00000000000000000000, x86_fp80* %3
br label %25
17: ; preds = %12
%18 = load x86_fp80, x86_fp80* %4
%19 = fmul x86_fp80 0xK3FFE8000000000000000, %18
%20 = load x86_fp80, x86_fp80* %5
%21 = call i32 (x86_fp80, x86_fp80, ...) bitcast (i32 (...)* @igamil to i32 (x86_fp80, x86_fp80, ...)*)(x86_fp80 %19, x86_fp80 %20)
%22 = sitofp i32 %21 to x86_fp80
store x86_fp80 %22, x86_fp80* %6
%23 = load x86_fp80, x86_fp80* %6
%24 = fmul x86_fp80 0xK40008000000000000000, %23
store x86_fp80 %24, x86_fp80* %3
br label %25
25: ; preds = %17, %15
%26 = load x86_fp80, x86_fp80* %3
ret x86_fp80 %26
}

LLVM IR (-O2):
@.str = [8 x i8] c"chdtril\00"
define x86_fp80 @chdtril(x86_fp80 %0, x86_fp80 %1) {
%3 = fcmp olt x86_fp80 %1, 0xK00000000000000000000
%4 = fcmp ogt x86_fp80 %1, 0xK3FFF8000000000000000
%5 = or i1 %3, %4
%6 = fcmp olt x86_fp80 %0, 0xK3FFF8000000000000000
%7 = or i1 %6, %5
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @mtherr to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 1)
br label %15
10: ; preds = %2
%11 = fmul x86_fp80 %0, 0xK3FFE8000000000000000
%12 = tail call i32 (x86_fp80, x86_fp80, ...) bitcast (i32 (...)* @igamil to i32 (x86_fp80, x86_fp80, ...)*)(x86_fp80 %11, x86_fp80 %1)
%13 = sitofp i32 %12 to x86_fp80
%14 = fmul x86_fp80 %13, 0xK40008000000000000000
br label %15
15: ; preds = %10, %8
%16 = phi x86_fp80 [ 0xK00000000000000000000, %8 ], [ %14, %10 ]
ret x86_fp80 %16
}