#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 {
  void *tv_nsec;
  void *tv_sec;
};
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
void *atoll(char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ set_reserve(int, struct timespec, struct timespec,
                               unsigned int);
int main(int argc, char *argv[]) {
  pid_t pid = (pid_t)atoi(argv[1]);
  printf("In user pid=%u\n", pid);
  struct timespec ctime;
  ctime.tv_sec = atoll(argv[2]);
  ctime.tv_nsec = atoll(argv[3]);
  struct timespec ttime;
  ttime.tv_sec = atoll(argv[4]);
  ttime.tv_nsec = atoll(argv[5]);
  unsigned int prio = 120;
  set_reserve(pid, ctime, ttime, prio);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <atoll@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1040 <atoll@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   1040 <atoll@plt>
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rdi
call   1040 <atoll@plt>
mov    %rax,-0x38(%rbp)
movl   $0x78,-0x3c(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x3c(%rbp),%r9d
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    -0x30(%rbp),%r8
call   1050 <set_reserve@plt>
mov    $0x1,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1060 <atoi@plt>
mov    %eax,%r12d
lea    0xea2(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    0x10(%rbx),%rdi
call   1040 <atoll@plt>
mov    %rax,%r14
mov    0x18(%rbx),%rdi
call   1040 <atoll@plt>
mov    %rax,%r15
mov    0x20(%rbx),%rdi
call   1040 <atoll@plt>
mov    %rax,%rbp
mov    0x28(%rbx),%rdi
call   1040 <atoll@plt>
mov    %r12d,%edi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %rax,%rcx
mov    %rbp,%r8
mov    $0x78,%r9d
call   1050 <set_reserve@plt>
mov    $0x1,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.timespec = type { i8*, i8* }
@.str = [16 x i8] c"In user pid=%u\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca %struct.timespec
%8 = alloca %struct.timespec
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @atoi(i8* %12)
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 2
%18 = load i8*, i8** %17
%19 = call i8* @atoll(i8* %18)
%20 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 1
store i8* %19, i8** %20
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 3
%23 = load i8*, i8** %22
%24 = call i8* @atoll(i8* %23)
%25 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 0
store i8* %24, i8** %25
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 4
%28 = load i8*, i8** %27
%29 = call i8* @atoll(i8* %28)
%30 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 1
store i8* %29, i8** %30
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 5
%33 = load i8*, i8** %32
%34 = call i8* @atoll(i8* %33)
%35 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 0
store i8* %34, i8** %35
store i32 120, i32* %9
%36 = load i32, i32* %6
%37 = load i32, i32* %9
%38 = bitcast %struct.timespec* %7 to { i8*, i8* }*
%39 = getelementptr inbounds { i8*, i8* }, { i8*, i8* }* %38, i32 0, i32 0
%40 = load i8*, i8** %39
%41 = getelementptr inbounds { i8*, i8* }, { i8*, i8* }* %38, i32 0, i32 1
%42 = load i8*, i8** %41
%43 = bitcast %struct.timespec* %8 to { i8*, i8* }*
%44 = getelementptr inbounds { i8*, i8* }, { i8*, i8* }* %43, i32 0, i32 0
%45 = load i8*, i8** %44
%46 = getelementptr inbounds { i8*, i8* }, { i8*, i8* }* %43, i32 0, i32 1
%47 = load i8*, i8** %46
%48 = call i32 @set_reserve(i32 %36, i8* %40, i8* %42, i8* %45, i8* %47, i32 %37)
ret i32 1
}

LLVM IR (-O2):
@.str = [16 x i8] c"In user pid=%u\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds i8*, i8** %1, i64 2
%8 = load i8*, i8** %7
%9 = tail call i8* @atoll(i8* %8)
%10 = getelementptr inbounds i8*, i8** %1, i64 3
%11 = load i8*, i8** %10
%12 = tail call i8* @atoll(i8* %11)
%13 = getelementptr inbounds i8*, i8** %1, i64 4
%14 = load i8*, i8** %13
%15 = tail call i8* @atoll(i8* %14)
%16 = getelementptr inbounds i8*, i8** %1, i64 5
%17 = load i8*, i8** %16
%18 = tail call i8* @atoll(i8* %17)
%19 = tail call i32 @set_reserve(i32 %5, i8* %12, i8* %9, i8* %18, i8* %15, i32 120)
ret i32 1
}