#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*/ SCHED_OTHER;
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int);
int /*<<< orphan*/ printf(char *);
int sched_get_priority_max(int /*<<< orphan*/);
int sched_get_priority_min(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int main(void) {
  int Min = sched_get_priority_min(SCHED_OTHER);
  int Max = sched_get_priority_max(SCHED_OTHER);
  if (Min != 0 || Max != 0) {
    fprintf(stderr, "min: %d, max: %d\n", Min, Max);
    abort();
  }
  printf("pass\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e62(%rip),%rax
mov    (%rax),%edi
call   1060 <sched_get_priority_min@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e51(%rip),%rax
mov    (%rax),%edi
call   1080 <sched_get_priority_max@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    11a5 <main+0x45>
cmpl   $0x0,-0xc(%rbp)
je     11c7 <main+0x67>
mov    0x2e34(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xe45(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
lea    0xe44(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2e6d(%rip),%r14
mov    (%r14),%edi
call   1060 <sched_get_priority_min@plt>
mov    %eax,%ebx
mov    (%r14),%edi
call   1080 <sched_get_priority_max@plt>
mov    %ebx,%ecx
or     %eax,%ecx
je     11a3 <main+0x43>
mov    0x2e56(%rip),%rcx
mov    (%rcx),%edi
lea    0xe6d(%rip),%rsi
mov    %ebx,%edx
mov    %eax,%ecx
call   1050 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>
lea    0xe68(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1070 <exit@plt>

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

LLVM IR (-O2):
@SCHED_OTHER = global i32 0
@stderr = global i32 0
@.str = [18 x i8] c"min: %d, max: %d\0A\00"
@str = [5 x i8] c"pass\00"
define i32 @main() {
%1 = load i32, i32* @SCHED_OTHER
%2 = tail call i32 @sched_get_priority_min(i32 %1)
%3 = load i32, i32* @SCHED_OTHER
%4 = tail call i32 @sched_get_priority_max(i32 %3)
%5 = icmp ne i32 %2, 0
%6 = icmp ne i32 %4, 0
%7 = select i1 %5, i1 true, i1 %6
br i1 %7, label %8, label %12
8: ; preds = %0
%9 = load i32, i32* @stderr
%10 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %4)
%11 = tail call i32 (...) @abort()
unreachable
12: ; preds = %0
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%14 = tail call i32 @exit(i32 0)
unreachable
}