#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*/ printf(char *, char const *, ...);
int sched_get_priority_max(int /*<<< orphan*/);
int sched_get_priority_min(int /*<<< orphan*/);
int sched_yield();
int _rt(char const *progname) {
  int d;
  printf("%s: Testing %s()\n", progname, "sched_get_priority_max");
  d = sched_get_priority_max(0);
  printf("%s: sched_get_priority_max() => %d\n", progname, d);
  printf("%s: Testing %s()\n", progname, "sched_get_priority_min");
  d = sched_get_priority_min(0);
  printf("%s: sched_get_priority_min() => %d\n", progname, d);
  printf("%s: Testing %s()\n", progname, "sched_yield");
  d = sched_yield();
  printf("%s: sched_yield() => %d\n", progname, d);
  return 0;
}


x86 assembly (clang, -O0):
<_rt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xea9(%rip),%rdi
lea    0xeb4(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1060 <sched_get_priority_max@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xe71(%rip),%rdi
lea    0xeb7(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <sched_get_priority_min@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xe39(%rip),%rdi
lea    0xeba(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <sched_yield@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_rt>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xeb2(%rip),%r14
lea    0xebd(%rip),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %edi,%edi
call   1060 <sched_get_priority_max@plt>
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeca(%rip),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <sched_get_priority_min@plt>
lea    0xec6(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed7(%rip),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <sched_yield@plt>
lea    0xec8(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [18 x i8] c"%s: Testing %s()\0A\00"
@.str.1 = [23 x i8] c"sched_get_priority_max\00"
@.str.2 = [36 x i8] c"%s: sched_get_priority_max() => %d\0A\00"
@.str.3 = [23 x i8] c"sched_get_priority_min\00"
@.str.4 = [36 x i8] c"%s: sched_get_priority_min() => %d\0A\00"
@.str.5 = [12 x i8] c"sched_yield\00"
@.str.6 = [25 x i8] c"%s: sched_yield() => %d\0A\00"
define i32 @_rt(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %4, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @sched_get_priority_max(i32 0)
store i32 %6, i32* %3
%7 = load i8*, i8** %2
%8 = load i32, i32* %3
%9 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8* %7, i32 %8)
%10 = load i8*, i8** %2
%11 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %10, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 @sched_get_priority_min(i32 0)
store i32 %12, i32* %3
%13 = load i8*, i8** %2
%14 = load i32, i32* %3
%15 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0), i8* %13, i32 %14)
%16 = load i8*, i8** %2
%17 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %16, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%18 = call i32 (...) @sched_yield()
store i32 %18, i32* %3
%19 = load i8*, i8** %2
%20 = load i32, i32* %3
%21 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0), i8* %19, i32 %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"%s: Testing %s()\0A\00"
@.str.1 = [23 x i8] c"sched_get_priority_max\00"
@.str.2 = [36 x i8] c"%s: sched_get_priority_max() => %d\0A\00"
@.str.3 = [23 x i8] c"sched_get_priority_min\00"
@.str.4 = [36 x i8] c"%s: sched_get_priority_min() => %d\0A\00"
@.str.5 = [12 x i8] c"sched_yield\00"
@.str.6 = [25 x i8] c"%s: sched_yield() => %d\0A\00"
define i32 @_rt(i8* %0) {
%2 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @sched_get_priority_max(i32 0)
%4 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8* %0, i32 %3)
%5 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%6 = tail call i32 @sched_get_priority_min(i32 0)
%7 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0), i8* %0, i32 %6)
%8 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%9 = tail call i32 (...) @sched_yield()
%10 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0), i8* %0, i32 %9)
ret i32 0
}