#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 sched_param {
  int dummy;
};

/* Variables and functions */
int SCHED_FIFO;
int SCHED_OTHER;
int /*<<< orphan*/ sched_setscheduler(int, int, struct sched_param *);
int main() {
  struct sched_param param;
  sched_setscheduler(999999, SCHED_OTHER, &param);
  sched_setscheduler(-1, SCHED_FIFO, &param);
  sched_setscheduler(0, -1, &param);
  sched_setscheduler(0, SCHED_OTHER, (struct sched_param *)-1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%esi
mov    $0xf423f,%edi
lea    -0x8(%rbp),%rdx
call   1030 <sched_setscheduler@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
mov    $0xffffffff,%edi
lea    -0x8(%rbp),%rdx
call   1030 <sched_setscheduler@plt>
xor    %edi,%edi
mov    $0xffffffff,%esi
lea    -0x8(%rbp),%rdx
call   1030 <sched_setscheduler@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
mov    $0xffffffffffffffff,%rdx
call   1030 <sched_setscheduler@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2ebd(%rip),%r14
mov    (%r14),%esi
mov    %rsp,%rbx
mov    $0xf423f,%edi
mov    %rbx,%rdx
call   1030 <sched_setscheduler@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%esi
mov    $0xffffffff,%edi
mov    %rbx,%rdx
call   1030 <sched_setscheduler@plt>
xor    %edi,%edi
mov    $0xffffffff,%esi
mov    %rbx,%rdx
call   1030 <sched_setscheduler@plt>
mov    (%r14),%esi
xor    %edi,%edi
mov    $0xffffffffffffffff,%rdx
call   1030 <sched_setscheduler@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.sched_param = type { i32 }
@SCHED_OTHER = global i32 0
@SCHED_FIFO = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.sched_param
store i32 0, i32* %1
%3 = load i32, i32* @SCHED_OTHER
%4 = call i32 @sched_setscheduler(i32 999999, i32 %3, %struct.sched_param* %2)
%5 = load i32, i32* @SCHED_FIFO
%6 = call i32 @sched_setscheduler(i32 -1, i32 %5, %struct.sched_param* %2)
%7 = call i32 @sched_setscheduler(i32 0, i32 -1, %struct.sched_param* %2)
%8 = load i32, i32* @SCHED_OTHER
%9 = call i32 @sched_setscheduler(i32 0, i32 %8, %struct.sched_param* inttoptr (i64 -1 to %struct.sched_param*))
ret i32 0
}

LLVM IR (-O2):
%struct.sched_param = type { i32 }
@SCHED_OTHER = global i32 0
@SCHED_FIFO = global i32 0
define i32 @main() {
%1 = alloca %struct.sched_param
%2 = bitcast %struct.sched_param* %1 to i8*
%3 = load i32, i32* @SCHED_OTHER
%4 = call i32 @sched_setscheduler(i32 999999, i32 %3, %struct.sched_param* %1)
%5 = load i32, i32* @SCHED_FIFO
%6 = call i32 @sched_setscheduler(i32 -1, i32 %5, %struct.sched_param* %1)
%7 = call i32 @sched_setscheduler(i32 0, i32 -1, %struct.sched_param* %1)
%8 = load i32, i32* @SCHED_OTHER
%9 = call i32 @sched_setscheduler(i32 0, i32 %8, %struct.sched_param* inttoptr (i64 -1 to %struct.sched_param*))
ret i32 0
}