#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_nsec;
  void *tv_sec;
};

/* Variables and functions */
void *atoll(char *);
int getpid();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ set_reserve(int /*<<< orphan*/, struct timespec,
                               struct timespec, unsigned int);
int main(int argc, char *argv[]) {
  printf("In user pid=%u\n", getpid());
  struct timespec ctime;
  ctime.tv_sec = atoll(argv[1]);
  ctime.tv_nsec = 0;
  struct timespec ttime;
  ttime.tv_sec = atoll(argv[2]);
  ttime.tv_nsec = 0;
  unsigned int prio = 99;
  set_reserve(0, ctime, ttime, prio);
  while (1)
    ;
  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    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoll@plt>
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <atoll@plt>
mov    %rax,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
movl   $0x63,-0x34(%rbp)
mov    -0x34(%rbp),%r9d
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    -0x28(%rbp),%r8
xor    %edi,%edi
call   1060 <set_reserve@plt>
jmp    11bf <main+0x7f>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xeab(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    0x8(%rbx),%rdi
call   1050 <atoll@plt>
mov    %rax,%r14
mov    0x10(%rbx),%rdi
call   1050 <atoll@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %r14,%rdx
xor    %ecx,%ecx
mov    %rax,%r8
mov    $0x63,%r9d
call   1060 <set_reserve@plt>
nopl   0x0(%rax,%rax,1)
jmp    1190 <main+0x50>

LLVM IR (-O0):
%struct.timespec = type { i64, 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 %struct.timespec
%7 = alloca %struct.timespec
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32 (...) @getpid()
%10 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i8* @atoll(i8* %13)
%15 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 1
store i8* %14, i8** %15
%16 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 0
store i64 0, i64* %16
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 2
%19 = load i8*, i8** %18
%20 = call i8* @atoll(i8* %19)
%21 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 1
store i8* %20, i8** %21
%22 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 0
store i64 0, i64* %22
store i32 99, i32* %8
%23 = load i32, i32* %8
%24 = bitcast %struct.timespec* %6 to { i64, i8* }*
%25 = getelementptr inbounds { i64, i8* }, { i64, i8* }* %24, i32 0, i32 0
%26 = load i64, i64* %25
%27 = getelementptr inbounds { i64, i8* }, { i64, i8* }* %24, i32 0, i32 1
%28 = load i8*, i8** %27
%29 = bitcast %struct.timespec* %7 to { i64, i8* }*
%30 = getelementptr inbounds { i64, i8* }, { i64, i8* }* %29, i32 0, i32 0
%31 = load i64, i64* %30
%32 = getelementptr inbounds { i64, i8* }, { i64, i8* }* %29, i32 0, i32 1
%33 = load i8*, i8** %32
%34 = call i32 @set_reserve(i32 0, i64 %26, i8* %28, i64 %31, i8* %33, i32 %23)
br label %35
35: ; preds = %2, %35
br label %35
}

LLVM IR (-O2):
@.str = [16 x i8] c"In user pid=%u\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 (...) @getpid()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i8* @atoll(i8* %6)
%8 = getelementptr inbounds i8*, i8** %1, i64 2
%9 = load i8*, i8** %8
%10 = tail call i8* @atoll(i8* %9)
%11 = tail call i32 @set_reserve(i32 0, i64 0, i8* %7, i64 0, i8* %10, i32 99)
br label %12
12: ; preds = %12, %2
br label %12
}