#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 */
scalar_t__ EINVAL;
int /*<<< orphan*/ abort();
scalar_t__ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int sched_get_priority_max(int);
int sched_get_priority_min(int);
int main(void) {
  if (sched_get_priority_min(-1) != -1 || errno != EINVAL)
    abort();
  errno = 0;
  if (sched_get_priority_max(-1) != -1 || errno != EINVAL)
    abort();
  printf("pass\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xffffffff,%edi
call   1050 <sched_get_priority_min@plt>
cmp    $0xffffffff,%eax
jne    118c <main+0x3c>
mov    0x2e67(%rip),%rax
mov    (%rax),%rax
mov    0x2e55(%rip),%rcx
cmp    (%rcx),%rax
je     1193 <main+0x43>
mov    $0x0,%al
call   1030 <abort@plt>
mov    0x2e46(%rip),%rax
movq   $0x0,(%rax)
mov    $0xffffffff,%edi
call   1070 <sched_get_priority_max@plt>
cmp    $0xffffffff,%eax
jne    11ce <main+0x7e>
mov    0x2e25(%rip),%rax
mov    (%rax),%rax
mov    0x2e13(%rip),%rcx
cmp    (%rcx),%rax
je     11d5 <main+0x85>
mov    $0x0,%al
call   1030 <abort@plt>
lea    0xe24(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0xffffffff,%edi
call   1050 <sched_get_priority_min@plt>
cmp    $0xffffffff,%eax
jne    11aa <main+0x5a>
mov    0x2e76(%rip),%rbx
mov    (%rbx),%rax
mov    0x2e64(%rip),%r14
cmp    (%r14),%rax
jne    11aa <main+0x5a>
movq   $0x0,(%rbx)
mov    $0xffffffff,%edi
call   1070 <sched_get_priority_max@plt>
cmp    $0xffffffff,%eax
jne    11aa <main+0x5a>
mov    (%rbx),%rax
cmp    (%r14),%rax
jne    11aa <main+0x5a>
lea    0xe62(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1060 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@errno = global i64 0
@EINVAL = global i64 0
@.str = [6 x i8] c"pass\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @sched_get_priority_min(i32 -1)
%3 = icmp ne i32 %2, -1
br i1 %3, label %8, label %4
4: ; preds = %0
%5 = load i64, i64* @errno
%6 = load i64, i64* @EINVAL
%7 = icmp ne i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %4, %0
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %4
store i64 0, i64* @errno
%11 = call i32 @sched_get_priority_max(i32 -1)
%12 = icmp ne i32 %11, -1
br i1 %12, label %17, label %13
13: ; preds = %10
%14 = load i64, i64* @errno
%15 = load i64, i64* @EINVAL
%16 = icmp ne i64 %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13, %10
%18 = call i32 (...) @abort()
unreachable
19: ; preds = %13
%20 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%21 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@errno = global i64 0
@EINVAL = global i64 0
@str = [5 x i8] c"pass\00"
define i32 @main() {
%1 = tail call i32 @sched_get_priority_min(i32 -1)
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = load i64, i64* @errno
%5 = load i64, i64* @EINVAL
%6 = icmp eq i64 %4, %5
br i1 %6, label %9, label %7
7: ; preds = %3, %0
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %3
store i64 0, i64* @errno
%10 = tail call i32 @sched_get_priority_max(i32 -1)
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = load i64, i64* @errno
%14 = load i64, i64* @EINVAL
%15 = icmp eq i64 %13, %14
br i1 %15, label %18, label %16
16: ; preds = %12, %9
%17 = tail call i32 (...) @abort()
unreachable
18: ; preds = %12
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%20 = tail call i32 @exit(i32 0)
unreachable
}