#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 */
double betai(double, double, double);
int /*<<< orphan*/ fatalx(char *);
int /*<<< orphan*/ finite(double);
double betaix(double a, double b, double lo, double hi) {
  double y1, y2;
  y1 = betai(a, b, lo);
  y2 = betai(a, b, hi);
  if (!finite(y1))
    fatalx("bad y1\n");
  if (!finite(y2))
    fatalx("bad y2\n");
  return y2 - y1;
}


x86 assembly (clang, -O0):
<betaix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1040 <betai@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
call   1040 <betai@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
movaps 0xe96(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  0xe7a(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    119c <betaix+0x7c>
lea    0xe89(%rip),%rdi
call   1030 <fatalx@plt>
movsd  -0x30(%rbp),%xmm0
movaps 0xe68(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  0xe4c(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    11ca <betaix+0xaa>
lea    0xe63(%rip),%rdi
call   1030 <fatalx@plt>
movsd  -0x30(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<betaix>:
sub    $0x38,%rsp
movsd  %xmm3,(%rsp)
movsd  %xmm1,0x18(%rsp)
movsd  %xmm0,0x10(%rsp)
call   1040 <betai@plt>
movaps %xmm0,0x20(%rsp)
movsd  0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
movsd  (%rsp),%xmm2
call   1040 <betai@plt>
movapd 0xea3(%rip),%xmm1
andpd  0x20(%rsp),%xmm1
ucomisd 0xea5(%rip),%xmm1
jne    1183 <betaix+0x63>
lea    0xea4(%rip),%rdi
movapd %xmm0,(%rsp)
call   1030 <fatalx@plt>
movapd (%rsp),%xmm0
movapd 0xe75(%rip),%xmm1
andpd  %xmm0,%xmm1
ucomisd 0xe79(%rip),%xmm1
jne    11af <betaix+0x8f>
lea    0xe80(%rip),%rdi
movapd %xmm0,(%rsp)
call   1030 <fatalx@plt>
movapd (%rsp),%xmm0
subsd  0x20(%rsp),%xmm0
add    $0x38,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"bad y1\0A\00"
@.str.1 = [8 x i8] c"bad y2\0A\00"
define double @betaix(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%11 = load double, double* %5
%12 = load double, double* %6
%13 = load double, double* %7
%14 = call double @betai(double %11, double %12, double %13)
store double %14, double* %9
%15 = load double, double* %5
%16 = load double, double* %6
%17 = load double, double* %8
%18 = call double @betai(double %15, double %16, double %17)
store double %18, double* %10
%19 = load double, double* %9
%20 = call double @llvm.fabs.f64(double %19)
%21 = fcmp one double %20, 0x7FF0000000000000
br i1 %21, label %24, label %22
22: ; preds = %4
%23 = call i32 @fatalx(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %24
24: ; preds = %22, %4
%25 = load double, double* %10
%26 = call double @llvm.fabs.f64(double %25)
%27 = fcmp one double %26, 0x7FF0000000000000
br i1 %27, label %30, label %28
28: ; preds = %24
%29 = call i32 @fatalx(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %30
30: ; preds = %28, %24
%31 = load double, double* %10
%32 = load double, double* %9
%33 = fsub double %31, %32
ret double %33
}

LLVM IR (-O2):
@.str = [8 x i8] c"bad y1\0A\00"
@.str.1 = [8 x i8] c"bad y2\0A\00"
define double @betaix(double %0, double %1, double %2, double %3) {
%5 = tail call double @betai(double %0, double %1, double %2)
%6 = tail call double @betai(double %0, double %1, double %3)
%7 = tail call double @llvm.fabs.f64(double %5)
%8 = fcmp ueq double %7, 0x7FF0000000000000
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = tail call i32 @fatalx(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %4
%12 = tail call double @llvm.fabs.f64(double %6)
%13 = fcmp ueq double %12, 0x7FF0000000000000
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = tail call i32 @fatalx(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %16
16: ; preds = %14, %11
%17 = fsub double %6, %5
ret double %17
}