#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*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ stderr;
void have_sched() {
  puts("\n   -- Real Time Scheduling");
  puts("   Have_Real_Time : constant Boolean := False;");
  puts("   type Scheduler_Policy is (");
  puts("      SCHED_FIFO,");
  puts("      SCHED_OTHER,");
  puts("      SCHED_RR");
  puts("   );");
  puts("   function Set_Scheduler_Policy(Policy : Scheduler_Policy; Priority : "
       "Integer) return Errno_Type;");
  puts("   function Get_Scheduler_Priority(Policy : Scheduler_Policy; Max : "
       "Boolean := True) return Integer;\n");
  fputs("   function Set_Scheduler_Policy(Policy : Scheduler_Policy; Priority "
        ": Integer) return Errno_Type\n",
        stderr);
  fputs("   is\n", stderr);
  fputs("   begin\n", stderr);
  fputs("      return ENOERR;\n", stderr);
  fputs("   end Set_Scheduler_Policy;\n\n", stderr);
  fputs("   function Get_Scheduler_Priority(Policy : Scheduler_Policy; Max : "
        "Boolean := True) return Integer\n",
        stderr);
  fputs("   is\n", stderr);
  fputs("      function C_get_max(Policy : Scheduler_Policy) return Integer;\n",
        stderr);
  fputs("      pragma import(C,C_get_max,\"sched_get_priority_max\");\n",
        stderr);
  fputs("      function C_get_min(Policy : Scheduler_Policy) return Integer;\n",
        stderr);
  fputs("      pragma import(C,C_get_min,\"sched_get_priority_min\");\n",
        stderr);
  fputs("   begin\n\n", stderr);
  fputs("      if Max then\n", stderr);
  fputs("         return C_get_max(Policy);\n", stderr);
  fputs("      else\n", stderr);
  fputs("         return C_get_min(Policy);\n", stderr);
  fputs("      end if;\n", stderr);
  fputs("   end Get_Scheduler_Priority;\n", stderr);
}


x86 assembly (clang, -O0):
<have_sched>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
lea    0xf08(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1a(%rip),%rdi
call   1030 <puts@plt>
lea    0xf20(%rip),%rdi
call   1030 <puts@plt>
lea    0xf27(%rip),%rdi
call   1030 <puts@plt>
lea    0xf2a(%rip),%rdi
call   1030 <puts@plt>
lea    0xf24(%rip),%rdi
call   1030 <puts@plt>
lea    0xf7b(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e49(%rip),%rax
mov    (%rax),%esi
lea    0xfcc(%rip),%rdi
call   1040 <fputs@plt>
mov    0x2e34(%rip),%rax
mov    (%rax),%esi
lea    0x101a(%rip),%rdi
call   1040 <fputs@plt>
mov    0x2e1f(%rip),%rax
mov    (%rax),%esi
lea    0x100c(%rip),%rdi
call   1040 <fputs@plt>
mov    0x2e0a(%rip),%rax
mov    (%rax),%esi
lea    0x1001(%rip),%rdi
call   1040 <fputs@plt>
mov    0x2df5(%rip),%rax
mov    (%rax),%esi
lea    0x1002(%rip),%rdi
call   1040 <fputs@plt>
mov    0x2de0(%rip),%rax
mov    (%rax),%esi
lea    0x100c(%rip),%rdi
call   1040 <fputs@plt>
mov    0x2dcb(%rip),%rax
mov    (%rax),%esi
lea    0xfb1(%rip),%rdi
call   1040 <fputs@plt>
mov    0x2db6(%rip),%rax
mov    (%rax),%esi
lea    0x1047(%rip),%rdi
call   1040 <fputs@plt>
mov    0x2da1(%rip),%rax
mov    (%rax),%esi
lea    0x1077(%rip),%rdi
call   1040 <fputs@plt>
mov    0x2d8c(%rip),%rax
mov    (%rax),%esi
lea    0x109e(%rip),%rdi
call   1040 <fputs@plt>
mov    0x2d77(%rip),%rax
mov    (%rax),%esi
lea    0x10ce(%rip),%rdi
call   1040 <fputs@plt>
mov    0x2d62(%rip),%rax
mov    (%rax),%esi
lea    0x10f5(%rip),%rdi
call   1040 <fputs@plt>
mov    0x2d4d(%rip),%rax
mov    (%rax),%esi
lea    0x10eb(%rip),%rdi
call   1040 <fputs@plt>
mov    0x2d38(%rip),%rax
mov    (%rax),%esi
lea    0x10e9(%rip),%rdi
call   1040 <fputs@plt>
mov    0x2d23(%rip),%rax
mov    (%rax),%esi
lea    0x10f8(%rip),%rdi
call   1040 <fputs@plt>
mov    0x2d0e(%rip),%rax
mov    (%rax),%esi
lea    0x10ef(%rip),%rdi
call   1040 <fputs@plt>
mov    0x2cf9(%rip),%rax
mov    (%rax),%esi
lea    0x10fe(%rip),%rdi
call   1040 <fputs@plt>
mov    0x2ce4(%rip),%rax
mov    (%rax),%esi
lea    0x10f8(%rip),%rdi
call   1040 <fputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<have_sched>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
lea    0xf08(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1a(%rip),%rdi
call   1030 <puts@plt>
lea    0xf20(%rip),%rdi
call   1030 <puts@plt>
lea    0xf27(%rip),%rdi
call   1030 <puts@plt>
lea    0xf2a(%rip),%rdi
call   1030 <puts@plt>
lea    0xf24(%rip),%rdi
call   1030 <puts@plt>
lea    0xf7b(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e49(%rip),%rbx
mov    (%rbx),%esi
lea    0xfcc(%rip),%rdi
call   1040 <fputs@plt>
mov    (%rbx),%esi
lea    0x1021(%rip),%r14
mov    %r14,%rdi
call   1040 <fputs@plt>
mov    (%rbx),%esi
lea    0x1017(%rip),%rdi
call   1040 <fputs@plt>
mov    (%rbx),%esi
lea    0x1013(%rip),%rdi
call   1040 <fputs@plt>
mov    (%rbx),%esi
lea    0x101b(%rip),%rdi
call   1040 <fputs@plt>
mov    (%rbx),%esi
lea    0x102c(%rip),%rdi
call   1040 <fputs@plt>
mov    (%rbx),%esi
mov    %r14,%rdi
call   1040 <fputs@plt>
mov    (%rbx),%esi
lea    0x1079(%rip),%rdi
call   1040 <fputs@plt>
mov    (%rbx),%esi
lea    0x10b0(%rip),%rdi
call   1040 <fputs@plt>
mov    (%rbx),%esi
lea    0x10de(%rip),%rdi
call   1040 <fputs@plt>
mov    (%rbx),%esi
lea    0x1115(%rip),%rdi
call   1040 <fputs@plt>
mov    (%rbx),%esi
lea    0x1143(%rip),%rdi
call   1040 <fputs@plt>
mov    (%rbx),%esi
lea    0x1140(%rip),%rdi
call   1040 <fputs@plt>
mov    (%rbx),%esi
lea    0x1145(%rip),%rdi
call   1040 <fputs@plt>
mov    (%rbx),%esi
lea    0x115b(%rip),%rdi
call   1040 <fputs@plt>
mov    (%rbx),%esi
lea    0x1159(%rip),%rdi
call   1040 <fputs@plt>
mov    (%rbx),%esi
lea    0x116f(%rip),%rdi
call   1040 <fputs@plt>
mov    (%rbx),%esi
lea    0x1170(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fputs@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"\0A -- Real Time Scheduling\00"
@.str.1 = [47 x i8] c" Have_Real_Time : constant Boolean := False;\00"
@.str.2 = [30 x i8] c" type Scheduler_Policy is (\00"
@.str.3 = [18 x i8] c" SCHED_FIFO,\00"
@.str.4 = [19 x i8] c" SCHED_OTHER,\00"
@.str.5 = [15 x i8] c" SCHED_RR\00"
@.str.6 = [6 x i8] c" );\00"
@.str.7 = [99 x i8] c" function Set_Scheduler_Policy(Policy : Scheduler_Policy; Priority : Integer) return Errno_Type;\00"
@.str.8 = [102 x i8] c" function Get_Scheduler_Priority(Policy : Scheduler_Policy; Max : Boolean := True) return Integer;\0A\00"
@.str.9 = [99 x i8] c" function Set_Scheduler_Policy(Policy : Scheduler_Policy; Priority : Integer) return Errno_Type\0A\00"
@stderr = global i32 0
@.str.10 = [7 x i8] c" is\0A\00"
@.str.11 = [10 x i8] c" begin\0A\00"
@.str.12 = [22 x i8] c" return ENOERR;\0A\00"
@.str.13 = [31 x i8] c" end Set_Scheduler_Policy;\0A\0A\00"
@.str.14 = [101 x i8] c" function Get_Scheduler_Priority(Policy : Scheduler_Policy; Max : Boolean := True) return Integer\0A\00"
@.str.15 = [69 x i8] c" function C_get_max(Policy : Scheduler_Policy) return Integer;\0A\00"
@.str.16 = [60 x i8] c" pragma import(C,C_get_max,\22sched_get_priority_max\22);\0A\00"
@.str.17 = [69 x i8] c" function C_get_min(Policy : Scheduler_Policy) return Integer;\0A\00"
@.str.18 = [60 x i8] c" pragma import(C,C_get_min,\22sched_get_priority_min\22);\0A\00"
@.str.19 = [11 x i8] c" begin\0A\0A\00"
@.str.20 = [19 x i8] c" if Max then\0A\00"
@.str.21 = [36 x i8] c" return C_get_max(Policy);\0A\00"
@.str.22 = [12 x i8] c" else\0A\00"
@.str.23 = [36 x i8] c" return C_get_min(Policy);\0A\00"
@.str.24 = [15 x i8] c" end if;\0A\00"
@.str.25 = [32 x i8] c" end Get_Scheduler_Priority;\0A\00"
define void @have_sched() {
%1 = call i32 @puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%6 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
%7 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%8 = call i32 @puts(i8* getelementptr inbounds ([99 x i8], [99 x i8]* @.str.7, i64 0, i64 0))
%9 = call i32 @puts(i8* getelementptr inbounds ([102 x i8], [102 x i8]* @.str.8, i64 0, i64 0))
%10 = load i32, i32* @stderr
%11 = call i32 @fputs(i8* getelementptr inbounds ([99 x i8], [99 x i8]* @.str.9, i64 0, i64 0), i32 %10)
%12 = load i32, i32* @stderr
%13 = call i32 @fputs(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0), i32 %12)
%14 = load i32, i32* @stderr
%15 = call i32 @fputs(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0), i32 %14)
%16 = load i32, i32* @stderr
%17 = call i32 @fputs(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.12, i64 0, i64 0), i32 %16)
%18 = load i32, i32* @stderr
%19 = call i32 @fputs(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.13, i64 0, i64 0), i32 %18)
%20 = load i32, i32* @stderr
%21 = call i32 @fputs(i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str.14, i64 0, i64 0), i32 %20)
%22 = load i32, i32* @stderr
%23 = call i32 @fputs(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0), i32 %22)
%24 = load i32, i32* @stderr
%25 = call i32 @fputs(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.15, i64 0, i64 0), i32 %24)
%26 = load i32, i32* @stderr
%27 = call i32 @fputs(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.16, i64 0, i64 0), i32 %26)
%28 = load i32, i32* @stderr
%29 = call i32 @fputs(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.17, i64 0, i64 0), i32 %28)
%30 = load i32, i32* @stderr
%31 = call i32 @fputs(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.18, i64 0, i64 0), i32 %30)
%32 = load i32, i32* @stderr
%33 = call i32 @fputs(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.19, i64 0, i64 0), i32 %32)
%34 = load i32, i32* @stderr
%35 = call i32 @fputs(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.20, i64 0, i64 0), i32 %34)
%36 = load i32, i32* @stderr
%37 = call i32 @fputs(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.21, i64 0, i64 0), i32 %36)
%38 = load i32, i32* @stderr
%39 = call i32 @fputs(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.22, i64 0, i64 0), i32 %38)
%40 = load i32, i32* @stderr
%41 = call i32 @fputs(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.23, i64 0, i64 0), i32 %40)
%42 = load i32, i32* @stderr
%43 = call i32 @fputs(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.24, i64 0, i64 0), i32 %42)
%44 = load i32, i32* @stderr
%45 = call i32 @fputs(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.25, i64 0, i64 0), i32 %44)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"\0A -- Real Time Scheduling\00"
@.str.1 = [47 x i8] c" Have_Real_Time : constant Boolean := False;\00"
@.str.2 = [30 x i8] c" type Scheduler_Policy is (\00"
@.str.3 = [18 x i8] c" SCHED_FIFO,\00"
@.str.4 = [19 x i8] c" SCHED_OTHER,\00"
@.str.5 = [15 x i8] c" SCHED_RR\00"
@.str.6 = [6 x i8] c" );\00"
@.str.7 = [99 x i8] c" function Set_Scheduler_Policy(Policy : Scheduler_Policy; Priority : Integer) return Errno_Type;\00"
@.str.8 = [102 x i8] c" function Get_Scheduler_Priority(Policy : Scheduler_Policy; Max : Boolean := True) return Integer;\0A\00"
@.str.9 = [99 x i8] c" function Set_Scheduler_Policy(Policy : Scheduler_Policy; Priority : Integer) return Errno_Type\0A\00"
@stderr = global i32 0
@.str.10 = [7 x i8] c" is\0A\00"
@.str.11 = [10 x i8] c" begin\0A\00"
@.str.12 = [22 x i8] c" return ENOERR;\0A\00"
@.str.13 = [31 x i8] c" end Set_Scheduler_Policy;\0A\0A\00"
@.str.14 = [101 x i8] c" function Get_Scheduler_Priority(Policy : Scheduler_Policy; Max : Boolean := True) return Integer\0A\00"
@.str.15 = [69 x i8] c" function C_get_max(Policy : Scheduler_Policy) return Integer;\0A\00"
@.str.16 = [60 x i8] c" pragma import(C,C_get_max,\22sched_get_priority_max\22);\0A\00"
@.str.17 = [69 x i8] c" function C_get_min(Policy : Scheduler_Policy) return Integer;\0A\00"
@.str.18 = [60 x i8] c" pragma import(C,C_get_min,\22sched_get_priority_min\22);\0A\00"
@.str.19 = [11 x i8] c" begin\0A\0A\00"
@.str.20 = [19 x i8] c" if Max then\0A\00"
@.str.21 = [36 x i8] c" return C_get_max(Policy);\0A\00"
@.str.22 = [12 x i8] c" else\0A\00"
@.str.23 = [36 x i8] c" return C_get_min(Policy);\0A\00"
@.str.24 = [15 x i8] c" end if;\0A\00"
@.str.25 = [32 x i8] c" end Get_Scheduler_Priority;\0A\00"
define void @have_sched() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([99 x i8], [99 x i8]* @.str.7, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([102 x i8], [102 x i8]* @.str.8, i64 0, i64 0))
%10 = load i32, i32* @stderr
%11 = tail call i32 @fputs(i8* getelementptr inbounds ([99 x i8], [99 x i8]* @.str.9, i64 0, i64 0), i32 %10)
%12 = load i32, i32* @stderr
%13 = tail call i32 @fputs(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0), i32 %12)
%14 = load i32, i32* @stderr
%15 = tail call i32 @fputs(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0), i32 %14)
%16 = load i32, i32* @stderr
%17 = tail call i32 @fputs(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.12, i64 0, i64 0), i32 %16)
%18 = load i32, i32* @stderr
%19 = tail call i32 @fputs(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.13, i64 0, i64 0), i32 %18)
%20 = load i32, i32* @stderr
%21 = tail call i32 @fputs(i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str.14, i64 0, i64 0), i32 %20)
%22 = load i32, i32* @stderr
%23 = tail call i32 @fputs(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0), i32 %22)
%24 = load i32, i32* @stderr
%25 = tail call i32 @fputs(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.15, i64 0, i64 0), i32 %24)
%26 = load i32, i32* @stderr
%27 = tail call i32 @fputs(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.16, i64 0, i64 0), i32 %26)
%28 = load i32, i32* @stderr
%29 = tail call i32 @fputs(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.17, i64 0, i64 0), i32 %28)
%30 = load i32, i32* @stderr
%31 = tail call i32 @fputs(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.18, i64 0, i64 0), i32 %30)
%32 = load i32, i32* @stderr
%33 = tail call i32 @fputs(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.19, i64 0, i64 0), i32 %32)
%34 = load i32, i32* @stderr
%35 = tail call i32 @fputs(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.20, i64 0, i64 0), i32 %34)
%36 = load i32, i32* @stderr
%37 = tail call i32 @fputs(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.21, i64 0, i64 0), i32 %36)
%38 = load i32, i32* @stderr
%39 = tail call i32 @fputs(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.22, i64 0, i64 0), i32 %38)
%40 = load i32, i32* @stderr
%41 = tail call i32 @fputs(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.23, i64 0, i64 0), i32 %40)
%42 = load i32, i32* @stderr
%43 = tail call i32 @fputs(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.24, i64 0, i64 0), i32 %42)
%44 = load i32, i32* @stderr
%45 = tail call i32 @fputs(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.25, i64 0, i64 0), i32 %44)
ret void
}