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

/* Variables and functions */
int ITIMER_PROF;
int ITIMER_REAL;
int ITIMER_VIRTUAL;
int /*<<< orphan*/ getitimer(int, struct itimerval *);
int main() {
  struct itimerval value;
  getitimer(ITIMER_REAL, &value);
  getitimer(ITIMER_VIRTUAL, &value);
  getitimer(ITIMER_PROF, &value);
  getitimer(-1, &value);
  getitimer(ITIMER_REAL, (struct itimerval *)-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),%edi
lea    -0x8(%rbp),%rsi
call   1030 <getitimer@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <getitimer@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <getitimer@plt>
mov    $0xffffffff,%edi
lea    -0x8(%rbp),%rsi
call   1030 <getitimer@plt>
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
mov    $0xffffffffffffffff,%rsi
call   1030 <getitimer@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),%edi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1030 <getitimer@plt>
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
call   1030 <getitimer@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
call   1030 <getitimer@plt>
mov    $0xffffffff,%edi
mov    %rbx,%rsi
call   1030 <getitimer@plt>
mov    (%r14),%edi
mov    $0xffffffffffffffff,%rsi
call   1030 <getitimer@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.itimerval = type { i32 }
@ITIMER_REAL = global i32 0
@ITIMER_VIRTUAL = global i32 0
@ITIMER_PROF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.itimerval
store i32 0, i32* %1
%3 = load i32, i32* @ITIMER_REAL
%4 = call i32 @getitimer(i32 %3, %struct.itimerval* %2)
%5 = load i32, i32* @ITIMER_VIRTUAL
%6 = call i32 @getitimer(i32 %5, %struct.itimerval* %2)
%7 = load i32, i32* @ITIMER_PROF
%8 = call i32 @getitimer(i32 %7, %struct.itimerval* %2)
%9 = call i32 @getitimer(i32 -1, %struct.itimerval* %2)
%10 = load i32, i32* @ITIMER_REAL
%11 = call i32 @getitimer(i32 %10, %struct.itimerval* inttoptr (i64 -1 to %struct.itimerval*))
ret i32 0
}

LLVM IR (-O2):
%struct.itimerval = type { i32 }
@ITIMER_REAL = global i32 0
@ITIMER_VIRTUAL = global i32 0
@ITIMER_PROF = global i32 0
define i32 @main() {
%1 = alloca %struct.itimerval
%2 = bitcast %struct.itimerval* %1 to i8*
%3 = load i32, i32* @ITIMER_REAL
%4 = call i32 @getitimer(i32 %3, %struct.itimerval* %1)
%5 = load i32, i32* @ITIMER_VIRTUAL
%6 = call i32 @getitimer(i32 %5, %struct.itimerval* %1)
%7 = load i32, i32* @ITIMER_PROF
%8 = call i32 @getitimer(i32 %7, %struct.itimerval* %1)
%9 = call i32 @getitimer(i32 -1, %struct.itimerval* %1)
%10 = load i32, i32* @ITIMER_REAL
%11 = tail call i32 @getitimer(i32 %10, %struct.itimerval* inttoptr (i64 -1 to %struct.itimerval*))
ret i32 0
}