#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_FIFO;
int /*<<< orphan*/ SCHED_OTHER;
int /*<<< orphan*/ SCHED_RR;
int /*<<< orphan*/ printf(char *, int, int);
int sched_get_priority_max(int /*<<< orphan*/);
int sched_get_priority_min(int /*<<< orphan*/);
int main() {
  printf("Valid priority range for SCHED_OTHER: %d - %d\n",
         sched_get_priority_min(SCHED_OTHER),
         sched_get_priority_max(SCHED_OTHER));
  printf("Valid priority range for SCHED_FIFO: %d - %d\n",
         sched_get_priority_min(SCHED_FIFO),
         sched_get_priority_max(SCHED_FIFO));
  printf("Valid priority range for SCHED_RR: %d - %d\n",
         sched_get_priority_min(SCHED_RR), sched_get_priority_max(SCHED_RR));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1040 <sched_get_priority_min@plt>
mov    %eax,-0x10(%rbp)
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1050 <sched_get_priority_max@plt>
mov    -0x10(%rbp),%esi
mov    %eax,%edx
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
call   1040 <sched_get_priority_min@plt>
mov    %eax,-0xc(%rbp)
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
call   1050 <sched_get_priority_max@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e22(%rip),%rax
mov    (%rax),%edi
call   1040 <sched_get_priority_min@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e11(%rip),%rax
mov    (%rax),%edi
call   1050 <sched_get_priority_max@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2e9d(%rip),%r14
mov    (%r14),%edi
call   1040 <sched_get_priority_min@plt>
mov    %eax,%ebx
mov    (%r14),%edi
call   1050 <sched_get_priority_max@plt>
lea    0xeac(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    0x2e84(%rip),%r14
mov    (%r14),%edi
call   1040 <sched_get_priority_min@plt>
mov    %eax,%ebx
mov    (%r14),%edi
call   1050 <sched_get_priority_max@plt>
lea    0xeb2(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    0x2e3b(%rip),%r14
mov    (%r14),%edi
call   1040 <sched_get_priority_min@plt>
mov    %eax,%ebx
mov    (%r14),%edi
call   1050 <sched_get_priority_max@plt>
lea    0xeb7(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [47 x i8] c"Valid priority range for SCHED_OTHER: %d - %d\0A\00"
@SCHED_OTHER = global i32 0
@.str.1 = [46 x i8] c"Valid priority range for SCHED_FIFO: %d - %d\0A\00"
@SCHED_FIFO = global i32 0
@.str.2 = [44 x i8] c"Valid priority range for SCHED_RR: %d - %d\0A\00"
@SCHED_RR = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @SCHED_OTHER
%3 = call i32 @sched_get_priority_min(i32 %2)
%4 = load i32, i32* @SCHED_OTHER
%5 = call i32 @sched_get_priority_max(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5)
%7 = load i32, i32* @SCHED_FIFO
%8 = call i32 @sched_get_priority_min(i32 %7)
%9 = load i32, i32* @SCHED_FIFO
%10 = call i32 @sched_get_priority_max(i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %10)
%12 = load i32, i32* @SCHED_RR
%13 = call i32 @sched_get_priority_min(i32 %12)
%14 = load i32, i32* @SCHED_RR
%15 = call i32 @sched_get_priority_max(i32 %14)
%16 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0), i32 %13, i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [47 x i8] c"Valid priority range for SCHED_OTHER: %d - %d\0A\00"
@SCHED_OTHER = global i32 0
@.str.1 = [46 x i8] c"Valid priority range for SCHED_FIFO: %d - %d\0A\00"
@SCHED_FIFO = global i32 0
@.str.2 = [44 x i8] c"Valid priority range for SCHED_RR: %d - %d\0A\00"
@SCHED_RR = global i32 0
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 = tail call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %4)
%6 = load i32, i32* @SCHED_FIFO
%7 = tail call i32 @sched_get_priority_min(i32 %6)
%8 = load i32, i32* @SCHED_FIFO
%9 = tail call i32 @sched_get_priority_max(i32 %8)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %9)
%11 = load i32, i32* @SCHED_RR
%12 = tail call i32 @sched_get_priority_min(i32 %11)
%13 = load i32, i32* @SCHED_RR
%14 = tail call i32 @sched_get_priority_max(i32 %13)
%15 = tail call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0), i32 %12, i32 %14)
ret i32 0
}