#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 */
int /*<<< orphan*/ error(char *);
double unifpdf(double x, double a, double b) {
  if (b < a)
    error("Parameter b is smaller than a.");
  if (x < a || x > b)
    return 0.0;
  return 1.0 / (b - a);
}


x86 assembly (clang, -O0):
<unifpdf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1147 <unifpdf+0x37>
lea    0xec6(%rip),%rdi
call   1030 <error@plt>
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
ja     116b <unifpdf+0x5b>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1178 <unifpdf+0x68>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1193 <unifpdf+0x83>
movsd  -0x20(%rbp),%xmm1
subsd  -0x18(%rbp),%xmm1
movsd  0xe76(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unifpdf>:
sub    $0x18,%rsp
movapd %xmm0,%xmm3
ucomisd %xmm2,%xmm1
jbe    114c <unifpdf+0x3c>
lea    0xee3(%rip),%rdi
movsd  %xmm2,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm3,(%rsp)
call   1030 <error@plt>
movsd  (%rsp),%xmm3
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
ucomisd %xmm3,%xmm1
xorpd  %xmm0,%xmm0
ja     116c <unifpdf+0x5c>
ucomisd %xmm2,%xmm3
ja     116c <unifpdf+0x5c>
subsd  %xmm1,%xmm2
movsd  0xe98(%rip),%xmm0
divsd  %xmm2,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Parameter b is smaller than a.\00"
define double @unifpdf(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%8 = load double, double* %7
%9 = load double, double* %6
%10 = fcmp olt double %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = call i32 @error(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %3
%14 = load double, double* %5
%15 = load double, double* %6
%16 = fcmp olt double %14, %15
br i1 %16, label %21, label %17
17: ; preds = %13
%18 = load double, double* %5
%19 = load double, double* %7
%20 = fcmp ogt double %18, %19
br i1 %20, label %21, label %22
21: ; preds = %17, %13
store double 0.000000e+00, double* %4
br label %27
22: ; preds = %17
%23 = load double, double* %7
%24 = load double, double* %6
%25 = fsub double %23, %24
%26 = fdiv double 1.000000e+00, %25
store double %26, double* %4
br label %27
27: ; preds = %22, %21
%28 = load double, double* %4
ret double %28
}

LLVM IR (-O2):
@.str = [31 x i8] c"Parameter b is smaller than a.\00"
define double @unifpdf(double %0, double %1, double %2) {
%4 = fcmp olt double %2, %1
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @error(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
%8 = fcmp olt double %0, %1
%9 = fcmp ogt double %0, %2
%10 = or i1 %8, %9
br i1 %10, label %14, label %11
11: ; preds = %7
%12 = fsub double %2, %1
%13 = fdiv double 1.000000e+00, %12
br label %14
14: ; preds = %7, %11
%15 = phi double [ %13, %11 ], [ 0.000000e+00, %7 ]
ret double %15
}