#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__ {
  int tv_sec;
  scalar_t__ tv_usec;
};
struct TYPE_3__ {
  int tv_sec;
  scalar_t__ tv_usec;
};
struct itimerval {
  TYPE_2__ it_value;
  TYPE_1__ it_interval;
};

/* Variables and functions */
int /*<<< orphan*/ setitimer(int, struct itimerval *, struct itimerval *);
void itimerinit(int timerid, int setval) {
  struct itimerval again;
  again.it_interval.tv_sec = setval;
  again.it_interval.tv_usec = 0;
  again.it_value.tv_sec = setval;
  again.it_value.tv_usec = 0;
  setitimer(timerid, &again, (struct itimerval *)0);
  return;
}


x86 assembly (clang, -O0):
<itimerinit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x28(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x28(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <setitimer@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<itimerinit>:
sub    $0x28,%rsp
mov    %esi,0x18(%rsp)
movq   $0x0,0x20(%rsp)
mov    %esi,0x8(%rsp)
movq   $0x0,0x10(%rsp)
lea    0x8(%rsp),%rsi
xor    %edx,%edx
call   1030 <setitimer@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
%struct.itimerval = type { %struct.TYPE_4__, %struct.TYPE_3__ }
%struct.TYPE_4__ = type { i32, i64 }
%struct.TYPE_3__ = type { i32, i64 }
define void @itimerinit(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.itimerval
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = getelementptr inbounds %struct.itimerval, %struct.itimerval* %5, i32 0, i32 1
%8 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %7, i32 0, i32 0
store i32 %6, i32* %8
%9 = getelementptr inbounds %struct.itimerval, %struct.itimerval* %5, i32 0, i32 1
%10 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %9, i32 0, i32 1
store i64 0, i64* %10
%11 = load i32, i32* %4
%12 = getelementptr inbounds %struct.itimerval, %struct.itimerval* %5, i32 0, i32 0
%13 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %12, i32 0, i32 0
store i32 %11, i32* %13
%14 = getelementptr inbounds %struct.itimerval, %struct.itimerval* %5, i32 0, i32 0
%15 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %14, i32 0, i32 1
store i64 0, i64* %15
%16 = load i32, i32* %3
%17 = call i32 @setitimer(i32 %16, %struct.itimerval* %5, %struct.itimerval* null)
ret void
}

LLVM IR (-O2):
%struct.itimerval = type { %struct.TYPE_4__, %struct.TYPE_3__ }
%struct.TYPE_4__ = type { i32, i64 }
%struct.TYPE_3__ = type { i32, i64 }
define void @itimerinit(i32 %0, i32 %1) {
%3 = alloca %struct.itimerval
%4 = bitcast %struct.itimerval* %3 to i8*
%5 = getelementptr inbounds %struct.itimerval, %struct.itimerval* %3, i64 0, i32 1, i32 0
store i32 %1, i32* %5
%6 = getelementptr inbounds %struct.itimerval, %struct.itimerval* %3, i64 0, i32 1, i32 1
store i64 0, i64* %6
%7 = getelementptr inbounds %struct.itimerval, %struct.itimerval* %3, i64 0, i32 0, i32 0
store i32 %1, i32* %7
%8 = getelementptr inbounds %struct.itimerval, %struct.itimerval* %3, i64 0, i32 0, i32 1
store i64 0, i64* %8
%9 = call i32 @setitimer(i32 %0, %struct.itimerval* %3, %struct.itimerval* null)
ret void
}