#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 */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};
struct TYPE_3__ {
  int tv_sec;
  scalar_t__ tv_usec;
};
struct itimerval {
  TYPE_2__ it_interval;
  TYPE_1__ it_value;
};

/* Variables and functions */
int ITIMER_PROF;
int ITIMER_REAL;
int ITIMER_VIRTUAL;
int /*<<< orphan*/ setitimer(int, struct itimerval *, struct itimerval *);
int main() {
  struct itimerval value, ovalue;
  value.it_value.tv_sec = 30;
  value.it_value.tv_usec = 0;
  value.it_interval.tv_sec = 0;
  value.it_interval.tv_usec = 0;
  setitimer(ITIMER_REAL, &value, &ovalue);
  setitimer(-1, &value, &ovalue);
  setitimer(ITIMER_VIRTUAL, (struct itimerval *)-1, &ovalue);
  setitimer(ITIMER_PROF, &value, (struct itimerval *)-1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1e,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
lea    -0x28(%rbp),%rsi
lea    -0x48(%rbp),%rdx
call   1030 <setitimer@plt>
mov    $0xffffffff,%edi
lea    -0x28(%rbp),%rsi
lea    -0x48(%rbp),%rdx
call   1030 <setitimer@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
mov    $0xffffffffffffffff,%rsi
lea    -0x48(%rbp),%rdx
call   1030 <setitimer@plt>
mov    0x2e4a(%rip),%rax
mov    (%rax),%edi
lea    -0x28(%rbp),%rsi
mov    $0xffffffffffffffff,%rdx
call   1030 <setitimer@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x48,%rsp
movl   $0x1e,0x10(%rsp)
movq   $0x0,0x18(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%r14
lea    0x28(%rsp),%rbx
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <setitimer@plt>
mov    $0xffffffff,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <setitimer@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
mov    $0xffffffffffffffff,%rsi
mov    %rbx,%rdx
call   1030 <setitimer@plt>
mov    0x2e56(%rip),%rax
mov    (%rax),%edi
mov    %r14,%rsi
mov    $0xffffffffffffffff,%rdx
call   1030 <setitimer@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.itimerval = type { %struct.TYPE_4__, %struct.TYPE_3__ }
%struct.TYPE_4__ = type { i64, i64 }
%struct.TYPE_3__ = type { i32, i64 }
@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
%3 = alloca %struct.itimerval
store i32 0, i32* %1
%4 = getelementptr inbounds %struct.itimerval, %struct.itimerval* %2, i32 0, i32 1
%5 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %4, i32 0, i32 0
store i32 30, i32* %5
%6 = getelementptr inbounds %struct.itimerval, %struct.itimerval* %2, i32 0, i32 1
%7 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %6, i32 0, i32 1
store i64 0, i64* %7
%8 = getelementptr inbounds %struct.itimerval, %struct.itimerval* %2, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %8, i32 0, i32 1
store i64 0, i64* %9
%10 = getelementptr inbounds %struct.itimerval, %struct.itimerval* %2, i32 0, i32 0
%11 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %10, i32 0, i32 0
store i64 0, i64* %11
%12 = load i32, i32* @ITIMER_REAL
%13 = call i32 @setitimer(i32 %12, %struct.itimerval* %2, %struct.itimerval* %3)
%14 = call i32 @setitimer(i32 -1, %struct.itimerval* %2, %struct.itimerval* %3)
%15 = load i32, i32* @ITIMER_VIRTUAL
%16 = call i32 @setitimer(i32 %15, %struct.itimerval* inttoptr (i64 -1 to %struct.itimerval*), %struct.itimerval* %3)
%17 = load i32, i32* @ITIMER_PROF
%18 = call i32 @setitimer(i32 %17, %struct.itimerval* %2, %struct.itimerval* inttoptr (i64 -1 to %struct.itimerval*))
ret i32 0
}

LLVM IR (-O2):
%struct.itimerval = type { %struct.TYPE_4__, %struct.TYPE_3__ }
%struct.TYPE_4__ = type { i64, i64 }
%struct.TYPE_3__ = type { i32, i64 }
@ITIMER_REAL = global i32 0
@ITIMER_VIRTUAL = global i32 0
@ITIMER_PROF = global i32 0
define i32 @main() {
%1 = alloca %struct.itimerval
%2 = alloca %struct.itimerval
%3 = bitcast %struct.itimerval* %1 to i8*
%4 = bitcast %struct.itimerval* %2 to i8*
%5 = getelementptr inbounds %struct.itimerval, %struct.itimerval* %1, i64 0, i32 1, i32 0
store i32 30, i32* %5
%6 = getelementptr inbounds %struct.itimerval, %struct.itimerval* %1, i64 0, i32 1, i32 1
store i64 0, i64* %6
%7 = bitcast %struct.itimerval* %1 to i8*
%8 = load i32, i32* @ITIMER_REAL
%9 = call i32 @setitimer(i32 %8, %struct.itimerval* %1, %struct.itimerval* %2)
%10 = call i32 @setitimer(i32 -1, %struct.itimerval* %1, %struct.itimerval* %2)
%11 = load i32, i32* @ITIMER_VIRTUAL
%12 = call i32 @setitimer(i32 %11, %struct.itimerval* inttoptr (i64 -1 to %struct.itimerval*), %struct.itimerval* %2)
%13 = load i32, i32* @ITIMER_PROF
%14 = call i32 @setitimer(i32 %13, %struct.itimerval* %1, %struct.itimerval* inttoptr (i64 -1 to %struct.itimerval*))
ret i32 0
}