#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 */
struct timespec {
  scalar_t__ tv_sec;
  int tv_nsec;
  int /*<<< orphan*/ member_0;
};
struct sched_param {
  int sched_priority;
};
typedef int /*<<< orphan*/ cpu_set_t;

/* Variables and functions */
int /*<<< orphan*/ CPU_SET(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ CPU_ZERO(int /*<<< orphan*/ *);
int /*<<< orphan*/ PRIO_PROCESS;
int /*<<< orphan*/ SCHED_FIFO;
scalar_t__ SCHED_OTHER;
int /*<<< orphan*/ SCHED_RR;
scalar_t__ getpriority(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ puts(char *);
int sched_get_priority_max(int /*<<< orphan*/);
int sched_get_priority_min(int /*<<< orphan*/);
int sched_getaffinity(int /*<<< orphan*/, int, int /*<<< orphan*/ *);
int sched_getparam(int /*<<< orphan*/, struct sched_param *);
scalar_t__ sched_getscheduler(int /*<<< orphan*/);
int sched_rr_get_interval(int /*<<< orphan*/, struct timespec *);
int sched_setaffinity(int /*<<< orphan*/, int, int /*<<< orphan*/ *);
int sched_setparam(int /*<<< orphan*/, struct sched_param *);
int sched_setscheduler(int /*<<< orphan*/, int /*<<< orphan*/,
                       struct sched_param *);
int setpriority(int /*<<< orphan*/, int /*<<< orphan*/, int);
int main(int argc, char **argv) {
  struct sched_param param = {.sched_priority = 50};
  if (sched_setscheduler(0, SCHED_RR, &param) == -1) {
    perror("Error setting scheduler");
    return 1;
  }
  if (sched_setparam(0, &param) == -1) {
    perror("Error setting param");
    return 1;
  }
  if (setpriority(PRIO_PROCESS, 0, 10) == -1) {
    perror("Error setting priority");
    return 1;
  }
  cpu_set_t my_set;
  CPU_ZERO(&my_set);
  CPU_SET(0, &my_set);
  if (sched_setaffinity(0, sizeof(cpu_set_t), &my_set) == -1) {
    perror("Error setting affinity");
    return 1;
  }
  if (sched_getscheduler(0) != SCHED_OTHER) {
    perror("Error getting scheduler");
    return 2;
  }
  if (sched_getparam(0, &param) == -1 || param.sched_priority != 0) {
    perror("Error getting param");
    return 2;
  }
  if (getpriority(PRIO_PROCESS, 0) != 0) {
    perror("Error getting priority");
    return 2;
  }
  if (sched_getaffinity(0, sizeof(cpu_set_t), &my_set) == -1) {
    perror("Error getting affinity");
    return 2;
  }
  if (sched_get_priority_max(SCHED_FIFO) != 99) {
    perror("Error getting max priority of SCHED_FIFO");
    return 2;
  }
  if (sched_get_priority_min(SCHED_FIFO) != 1) {
    perror("Error getting min priority of SCHED_FIFO");
    return 2;
  }
  struct timespec interval = {0};
  if (sched_rr_get_interval(0, &interval) == -1 || interval.tv_sec != 0 ||
      interval.tv_nsec != 100000000) {
    perror("Error getting interval of SCHED_RR");
    return 2;
  }
  puts("Test completed successfully");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xde4(%rip),%eax
mov    %eax,-0x18(%rbp)
mov    0x2d9a(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
lea    -0x18(%rbp),%rdx
call   1080 <sched_setscheduler@plt>
cmp    $0xffffffff,%eax
jne    1254 <main+0x54>
lea    0xdc1(%rip),%rdi
call   10e0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1488 <main+0x288>
xor    %edi,%edi
lea    -0x18(%rbp),%rsi
call   10f0 <sched_setparam@plt>
cmp    $0xffffffff,%eax
jne    1280 <main+0x80>
lea    0xdad(%rip),%rdi
call   10e0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1488 <main+0x288>
mov    0x2d51(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
mov    $0xa,%edx
call   1060 <setpriority@plt>
cmp    $0xffffffff,%eax
jne    12b6 <main+0xb6>
lea    0xd8b(%rip),%rdi
call   10e0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1488 <main+0x288>
lea    -0x1c(%rbp),%rdi
call   10d0 <CPU_ZERO@plt>
xor    %edi,%edi
lea    -0x1c(%rbp),%rsi
call   1120 <CPU_SET@plt>
xor    %edi,%edi
mov    $0x4,%esi
lea    -0x1c(%rbp),%rdx
call   10a0 <sched_setaffinity@plt>
cmp    $0xffffffff,%eax
jne    12fb <main+0xfb>
lea    0xd5d(%rip),%rdi
call   10e0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1488 <main+0x288>
xor    %edi,%edi
call   1030 <sched_getscheduler@plt>
mov    0x2cc7(%rip),%rcx
cmp    (%rcx),%rax
je     132a <main+0x12a>
lea    0xd45(%rip),%rdi
call   10e0 <perror@plt>
movl   $0x2,-0x4(%rbp)
jmp    1488 <main+0x288>
xor    %edi,%edi
lea    -0x18(%rbp),%rsi
call   1070 <sched_getparam@plt>
cmp    $0xffffffff,%eax
je     1348 <main+0x148>
cmpl   $0x0,-0x18(%rbp)
je     1360 <main+0x160>
lea    0xd27(%rip),%rdi
call   10e0 <perror@plt>
movl   $0x2,-0x4(%rbp)
jmp    1488 <main+0x288>
mov    0x2c71(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1040 <getpriority@plt>
cmp    $0x0,%rax
je     1392 <main+0x192>
lea    0xd09(%rip),%rdi
call   10e0 <perror@plt>
movl   $0x2,-0x4(%rbp)
jmp    1488 <main+0x288>
xor    %edi,%edi
mov    $0x4,%esi
lea    -0x1c(%rbp),%rdx
call   1110 <sched_getaffinity@plt>
cmp    $0xffffffff,%eax
jne    13c3 <main+0x1c3>
lea    0xcef(%rip),%rdi
call   10e0 <perror@plt>
movl   $0x2,-0x4(%rbp)
jmp    1488 <main+0x288>
mov    0x2c1e(%rip),%rax
mov    (%rax),%edi
call   1100 <sched_get_priority_max@plt>
cmp    $0x63,%eax
je     13f2 <main+0x1f2>
lea    0xcd7(%rip),%rdi
call   10e0 <perror@plt>
movl   $0x2,-0x4(%rbp)
jmp    1488 <main+0x288>
mov    0x2bef(%rip),%rax
mov    (%rax),%edi
call   10b0 <sched_get_priority_min@plt>
cmp    $0x1,%eax
je     1421 <main+0x221>
lea    0xcd1(%rip),%rdi
call   10e0 <perror@plt>
movl   $0x2,-0x4(%rbp)
jmp    1488 <main+0x288>
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1090 <memset@plt>
xor    %edi,%edi
lea    -0x30(%rbp),%rsi
call   10c0 <sched_rr_get_interval@plt>
cmp    $0xffffffff,%eax
je     145d <main+0x25d>
cmpq   $0x0,-0x30(%rbp)
jne    145d <main+0x25d>
cmpl   $0x5f5e100,-0x28(%rbp)
je     1475 <main+0x275>
lea    0xca6(%rip),%rdi
call   10e0 <perror@plt>
movl   $0x2,-0x4(%rbp)
jmp    1488 <main+0x288>
lea    0xcb1(%rip),%rdi
call   1050 <puts@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
movl   $0x32,0x8(%rsp)
mov    0x2dba(%rip),%rax
mov    (%rax),%esi
lea    0x8(%rsp),%rdx
xor    %edi,%edi
call   1080 <sched_setscheduler@plt>
cmp    $0xffffffff,%eax
je     134a <main+0x15a>
lea    0x8(%rsp),%rsi
xor    %edi,%edi
call   10e0 <sched_setparam@plt>
cmp    $0xffffffff,%eax
je     1353 <main+0x163>
mov    0x2d9f(%rip),%r14
mov    (%r14),%edi
xor    %esi,%esi
mov    $0xa,%edx
call   1060 <setpriority@plt>
cmp    $0xffffffff,%eax
je     135c <main+0x16c>
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   10c0 <CPU_ZERO@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1110 <CPU_SET@plt>
xor    %edi,%edi
mov    $0x4,%esi
mov    %rbx,%rdx
call   1090 <sched_setaffinity@plt>
cmp    $0xffffffff,%eax
je     1365 <main+0x175>
xor    %edi,%edi
call   1030 <sched_getscheduler@plt>
mov    0x2d42(%rip),%rcx
cmp    (%rcx),%rax
jne    1378 <main+0x188>
lea    0x8(%rsp),%rsi
xor    %edi,%edi
call   1070 <sched_getparam@plt>
cmp    $0xffffffff,%eax
je     1381 <main+0x191>
cmpl   $0x0,0x8(%rsp)
jne    1381 <main+0x191>
mov    (%r14),%edi
xor    %esi,%esi
call   1040 <getpriority@plt>
test   %rax,%rax
jne    138a <main+0x19a>
lea    0xc(%rsp),%rdx
xor    %edi,%edi
mov    $0x4,%esi
call   1100 <sched_getaffinity@plt>
cmp    $0xffffffff,%eax
je     1393 <main+0x1a3>
mov    0x2cfd(%rip),%rbx
mov    (%rbx),%edi
call   10f0 <sched_get_priority_max@plt>
cmp    $0x63,%eax
jne    139c <main+0x1ac>
mov    (%rbx),%edi
call   10a0 <sched_get_priority_min@plt>
cmp    $0x1,%eax
jne    13a5 <main+0x1b5>
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rsi
xor    %edi,%edi
call   10b0 <sched_rr_get_interval@plt>
cmp    $0xffffffff,%eax
je     13ae <main+0x1be>
cmpq   $0x0,0x10(%rsp)
jne    13ae <main+0x1be>
cmpl   $0x5f5e100,0x18(%rsp)
05
jne    13ae <main+0x1be>
lea    0xde8(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
jmp    13bf <main+0x1cf>
lea    0xcaf(%rip),%rdi
jmp    136c <main+0x17c>
lea    0xcbe(%rip),%rdi
jmp    136c <main+0x17c>
lea    0xcc9(%rip),%rdi
jmp    136c <main+0x17c>
lea    0xcd7(%rip),%rdi
call   10d0 <perror@plt>
mov    $0x1,%eax
jmp    13bf <main+0x1cf>
lea    0xcdb(%rip),%rdi
jmp    13b5 <main+0x1c5>
lea    0xcea(%rip),%rdi
jmp    13b5 <main+0x1c5>
lea    0xcf5(%rip),%rdi
jmp    13b5 <main+0x1c5>
lea    0xd03(%rip),%rdi
jmp    13b5 <main+0x1c5>
lea    0xd11(%rip),%rdi
jmp    13b5 <main+0x1c5>
lea    0xd31(%rip),%rdi
jmp    13b5 <main+0x1c5>
lea    0xd51(%rip),%rdi
call   10d0 <perror@plt>
mov    $0x2,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.sched_param = type { i32 }
%struct.timespec = type { i64, i32, i32 }
@__const.main.param = %struct.sched_param { i32 50 }
@SCHED_RR = global i32 0
@.str = [24 x i8] c"Error setting scheduler\00"
@.str.1 = [20 x i8] c"Error setting param\00"
@PRIO_PROCESS = global i32 0
@.str.2 = [23 x i8] c"Error setting priority\00"
@.str.3 = [23 x i8] c"Error setting affinity\00"
@SCHED_OTHER = global i64 0
@.str.4 = [24 x i8] c"Error getting scheduler\00"
@.str.5 = [20 x i8] c"Error getting param\00"
@.str.6 = [23 x i8] c"Error getting priority\00"
@.str.7 = [23 x i8] c"Error getting affinity\00"
@SCHED_FIFO = global i32 0
@.str.8 = [41 x i8] c"Error getting max priority of SCHED_FIFO\00"
@.str.9 = [41 x i8] c"Error getting min priority of SCHED_FIFO\00"
@.str.10 = [35 x i8] c"Error getting interval of SCHED_RR\00"
@.str.11 = [28 x i8] c"Test completed successfully\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.sched_param
%7 = alloca i32
%8 = alloca %struct.timespec
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast %struct.sched_param* %6 to i8*
%10 = load i32, i32* @SCHED_RR
%11 = call i32 @sched_setscheduler(i32 0, i32 %10, %struct.sched_param* %6)
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %87
15: ; preds = %2
%16 = call i32 @sched_setparam(i32 0, %struct.sched_param* %6)
%17 = icmp eq i32 %16, -1
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %3
br label %87
20: ; preds = %15
%21 = load i32, i32* @PRIO_PROCESS
%22 = call i32 @setpriority(i32 %21, i32 0, i32 10)
%23 = icmp eq i32 %22, -1
br i1 %23, label %24, label %26
24: ; preds = %20
%25 = call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %3
br label %87
26: ; preds = %20
%27 = call i32 @CPU_ZERO(i32* %7)
%28 = call i32 @CPU_SET(i32 0, i32* %7)
%29 = call i32 @sched_setaffinity(i32 0, i32 4, i32* %7)
%30 = icmp eq i32 %29, -1
br i1 %30, label %31, label %33
31: ; preds = %26
%32 = call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %3
br label %87
33: ; preds = %26
%34 = call i64 @sched_getscheduler(i32 0)
%35 = load i64, i64* @SCHED_OTHER
%36 = icmp ne i64 %34, %35
br i1 %36, label %37, label %39
37: ; preds = %33
%38 = call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
store i32 2, i32* %3
br label %87
39: ; preds = %33
%40 = call i32 @sched_getparam(i32 0, %struct.sched_param* %6)
%41 = icmp eq i32 %40, -1
br i1 %41, label %46, label %42
42: ; preds = %39
%43 = getelementptr inbounds %struct.sched_param, %struct.sched_param* %6, i32 0, i32 0
%44 = load i32, i32* %43
%45 = icmp ne i32 %44, 0
br i1 %45, label %46, label %48
46: ; preds = %42, %39
%47 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
store i32 2, i32* %3
br label %87
48: ; preds = %42
%49 = load i32, i32* @PRIO_PROCESS
%50 = call i64 @getpriority(i32 %49, i32 0)
%51 = icmp ne i64 %50, 0
br i1 %51, label %52, label %54
52: ; preds = %48
%53 = call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0))
store i32 2, i32* %3
br label %87
54: ; preds = %48
%55 = call i32 @sched_getaffinity(i32 0, i32 4, i32* %7)
%56 = icmp eq i32 %55, -1
br i1 %56, label %57, label %59
57: ; preds = %54
%58 = call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0))
store i32 2, i32* %3
br label %87
59: ; preds = %54
%60 = load i32, i32* @SCHED_FIFO
%61 = call i32 @sched_get_priority_max(i32 %60)
%62 = icmp ne i32 %61, 99
br i1 %62, label %63, label %65
63: ; preds = %59
%64 = call i32 @perror(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.8, i64 0, i64 0))
store i32 2, i32* %3
br label %87
65: ; preds = %59
%66 = load i32, i32* @SCHED_FIFO
%67 = call i32 @sched_get_priority_min(i32 %66)
%68 = icmp ne i32 %67, 1
br i1 %68, label %69, label %71
69: ; preds = %65
%70 = call i32 @perror(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.9, i64 0, i64 0))
store i32 2, i32* %3
br label %87
71: ; preds = %65
%72 = bitcast %struct.timespec* %8 to i8*
%73 = call i32 @sched_rr_get_interval(i32 0, %struct.timespec* %8)
%74 = icmp eq i32 %73, -1
br i1 %74, label %83, label %75
75: ; preds = %71
%76 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 0
%77 = load i64, i64* %76
%78 = icmp ne i64 %77, 0
br i1 %78, label %83, label %79
79: ; preds = %75
%80 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 1
%81 = load i32, i32* %80
%82 = icmp ne i32 %81, 100000000
br i1 %82, label %83, label %85
83: ; preds = %79, %75, %71
%84 = call i32 @perror(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.10, i64 0, i64 0))
store i32 2, i32* %3
br label %87
85: ; preds = %79
%86 = call i32 @puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.11, i64 0, i64 0))
store i32 0, i32* %3
br label %87
87: ; preds = %85, %83, %69, %63, %57, %52, %46, %37, %31, %24, %18, %13
%88 = load i32, i32* %3
ret i32 %88
}

LLVM IR (-O2):
%struct.sched_param = type { i32 }
%struct.timespec = type { i64, i32, i32 }
@SCHED_RR = global i32 0
@.str = [24 x i8] c"Error setting scheduler\00"
@.str.1 = [20 x i8] c"Error setting param\00"
@PRIO_PROCESS = global i32 0
@.str.2 = [23 x i8] c"Error setting priority\00"
@.str.3 = [23 x i8] c"Error setting affinity\00"
@SCHED_OTHER = global i64 0
@.str.4 = [24 x i8] c"Error getting scheduler\00"
@.str.5 = [20 x i8] c"Error getting param\00"
@.str.6 = [23 x i8] c"Error getting priority\00"
@.str.7 = [23 x i8] c"Error getting affinity\00"
@SCHED_FIFO = global i32 0
@.str.8 = [41 x i8] c"Error getting max priority of SCHED_FIFO\00"
@.str.9 = [41 x i8] c"Error getting min priority of SCHED_FIFO\00"
@.str.10 = [35 x i8] c"Error getting interval of SCHED_RR\00"
@.str.11 = [28 x i8] c"Test completed successfully\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.sched_param
%4 = alloca i32
%5 = alloca %struct.timespec
%6 = bitcast %struct.sched_param* %3 to i8*
%7 = getelementptr inbounds %struct.sched_param, %struct.sched_param* %3, i64 0, i32 0
store i32 50, i32* %7
%8 = load i32, i32* @SCHED_RR
%9 = call i32 @sched_setscheduler(i32 0, i32 %8, %struct.sched_param* %3)
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %89
13: ; preds = %2
%14 = call i32 @sched_setparam(i32 0, %struct.sched_param* %3)
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %89
18: ; preds = %13
%19 = load i32, i32* @PRIO_PROCESS
%20 = call i32 @setpriority(i32 %19, i32 0, i32 10)
%21 = icmp eq i32 %20, -1
br i1 %21, label %22, label %24
22: ; preds = %18
%23 = call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
br label %89
24: ; preds = %18
%25 = bitcast i32* %4 to i8*
%26 = call i32 @CPU_ZERO(i32* %4)
%27 = call i32 @CPU_SET(i32 0, i32* %4)
%28 = call i32 @sched_setaffinity(i32 0, i32 4, i32* %4)
%29 = icmp eq i32 %28, -1
br i1 %29, label %30, label %32
30: ; preds = %24
%31 = call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
br label %87
32: ; preds = %24
%33 = call i64 @sched_getscheduler(i32 0)
%34 = load i64, i64* @SCHED_OTHER
%35 = icmp eq i64 %33, %34
br i1 %35, label %38, label %36
36: ; preds = %32
%37 = call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
br label %87
38: ; preds = %32
%39 = call i32 @sched_getparam(i32 0, %struct.sched_param* %3)
%40 = icmp eq i32 %39, -1
%41 = load i32, i32* %7
%42 = icmp ne i32 %41, 0
%43 = select i1 %40, i1 true, i1 %42
br i1 %43, label %44, label %46
44: ; preds = %38
%45 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
br label %87
46: ; preds = %38
%47 = load i32, i32* @PRIO_PROCESS
%48 = call i64 @getpriority(i32 %47, i32 0)
%49 = icmp eq i64 %48, 0
br i1 %49, label %52, label %50
50: ; preds = %46
%51 = call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0))
br label %87
52: ; preds = %46
%53 = call i32 @sched_getaffinity(i32 0, i32 4, i32* %4)
%54 = icmp eq i32 %53, -1
br i1 %54, label %55, label %57
55: ; preds = %52
%56 = call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0))
br label %87
57: ; preds = %52
%58 = load i32, i32* @SCHED_FIFO
%59 = call i32 @sched_get_priority_max(i32 %58)
%60 = icmp eq i32 %59, 99
br i1 %60, label %63, label %61
61: ; preds = %57
%62 = call i32 @perror(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.8, i64 0, i64 0))
br label %87
63: ; preds = %57
%64 = load i32, i32* @SCHED_FIFO
%65 = call i32 @sched_get_priority_min(i32 %64)
%66 = icmp eq i32 %65, 1
br i1 %66, label %69, label %67
67: ; preds = %63
%68 = call i32 @perror(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.9, i64 0, i64 0))
br label %87
69: ; preds = %63
%70 = bitcast %struct.timespec* %5 to i8*
%71 = call i32 @sched_rr_get_interval(i32 0, %struct.timespec* %5)
%72 = icmp eq i32 %71, -1
%73 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i64 0, i32 0
%74 = load i64, i64* %73
%75 = icmp ne i64 %74, 0
%76 = select i1 %72, i1 true, i1 %75
%77 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i64 0, i32 1
%78 = load i32, i32* %77
%79 = icmp ne i32 %78, 100000000
%80 = select i1 %76, i1 true, i1 %79
br i1 %80, label %81, label %83
81: ; preds = %69
%82 = call i32 @perror(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.10, i64 0, i64 0))
br label %85
83: ; preds = %69
%84 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.11, i64 0, i64 0))
br label %85
85: ; preds = %83, %81
%86 = phi i32 [ 2, %81 ], [ 0, %83 ]
br label %87
87: ; preds = %85, %67, %61, %55, %50, %44, %36, %30
%88 = phi i32 [ 1, %30 ], [ 2, %36 ], [ 2, %44 ], [ 2, %50 ], [ 2, %55 ], [ 2, %61 ], [ 2, %67 ], [ %86, %85 ]
br label %89
89: ; preds = %87, %22, %16, %11
%90 = phi i32 [ 1, %11 ], [ 1, %16 ], [ 1, %22 ], [ %88, %87 ]
ret i32 %90
}