#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 */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
scalar_t__ PtsCmp(int /*<<< orphan*/, int /*<<< orphan*/);
int PtsCmpRangeClosed(int64_t x, int64_t y1, int64_t y2) {
  if (PtsCmp(x, y1) < 0)
    return -1;
  else if ((PtsCmp(x, y1) >= 0) && (PtsCmp(x, y2) <= 0))
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<PtsCmpRangeClosed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <PtsCmp@plt>
cmp    $0x0,%rax
jge    1142 <PtsCmpRangeClosed+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    117f <PtsCmpRangeClosed+0x6f>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <PtsCmp@plt>
cmp    $0x0,%rax
jl     1178 <PtsCmpRangeClosed+0x68>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <PtsCmp@plt>
cmp    $0x0,%rax
jg     1178 <PtsCmpRangeClosed+0x68>
movl   $0x0,-0x4(%rbp)
jmp    117f <PtsCmpRangeClosed+0x6f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PtsCmpRangeClosed>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <PtsCmp@plt>
test   %rax,%rax
js     1149 <PtsCmpRangeClosed+0x39>
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <PtsCmp@plt>
test   %rax,%rax
js     1142 <PtsCmpRangeClosed+0x32>
mov    %ebp,%edi
mov    %r14d,%esi
call   1030 <PtsCmp@plt>
test   %rax,%rax
jle    1150 <PtsCmpRangeClosed+0x40>
mov    $0x1,%eax
jmp    1152 <PtsCmpRangeClosed+0x42>
mov    $0xffffffff,%eax
jmp    1152 <PtsCmpRangeClosed+0x42>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @PtsCmpRangeClosed(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i64 @PtsCmp(i32 %8, i32 %9)
%11 = icmp slt i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %3
store i32 -1, i32* %4
br label %25
13: ; preds = %3
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = call i64 @PtsCmp(i32 %14, i32 %15)
%17 = icmp sge i64 %16, 0
br i1 %17, label %18, label %24
18: ; preds = %13
%19 = load i32, i32* %5
%20 = load i32, i32* %7
%21 = call i64 @PtsCmp(i32 %19, i32 %20)
%22 = icmp sle i64 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %18
store i32 0, i32* %4
br label %25
24: ; preds = %18, %13
store i32 1, i32* %4
br label %25
25: ; preds = %24, %23, %12
%26 = load i32, i32* %4
ret i32 %26
}

LLVM IR (-O2):
define i32 @PtsCmpRangeClosed(i32 %0, i32 %1, i32 %2) {
%4 = tail call i64 @PtsCmp(i32 %0, i32 %1)
%5 = icmp slt i64 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3
%7 = tail call i64 @PtsCmp(i32 %0, i32 %1)
%8 = icmp sgt i64 %7, -1
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = tail call i64 @PtsCmp(i32 %0, i32 %2)
%11 = icmp slt i64 %10, 1
br i1 %11, label %13, label %12
12: ; preds = %9, %6
br label %13
13: ; preds = %9, %3, %12
%14 = phi i32 [ 1, %12 ], [ -1, %3 ], [ 0, %9 ]
ret i32 %14
}