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

/* Variables and functions */
int /*<<< orphan*/ ITIMER_REAL;
int /*<<< orphan*/ setitimer(int /*<<< orphan*/, struct itimerval *,
                             int /*<<< orphan*/ *);
void set_timer() {
  struct itimerval it;
  it.it_interval.tv_sec = 0;
  it.it_interval.tv_usec = 1000L * 500;
  it.it_value.tv_sec = 0;
  it.it_value.tv_usec = 1000L * 500;
  setitimer(ITIMER_REAL, &it, NULL);
}


x86 assembly (clang, -O0):
<set_timer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x0,-0x8(%rbp)
movq   $0x7a120,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x7a120,-0x20(%rbp)
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
lea    -0x20(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <setitimer@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_timer>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    %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 { i64, i64 }
%struct.TYPE_3__ = type { i64, i64 }
@ITIMER_REAL = global i32 0
define void @set_timer() {
%1 = alloca %struct.itimerval
%2 = getelementptr inbounds %struct.itimerval, %struct.itimerval* %1, i32 0, i32 1
%3 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i32 0, i32 1
store i64 0, i64* %3
%4 = getelementptr inbounds %struct.itimerval, %struct.itimerval* %1, i32 0, i32 1
%5 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %4, i32 0, i32 0
store i64 500000, i64* %5
%6 = getelementptr inbounds %struct.itimerval, %struct.itimerval* %1, i32 0, i32 0
%7 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %6, i32 0, i32 1
store i64 0, i64* %7
%8 = getelementptr inbounds %struct.itimerval, %struct.itimerval* %1, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %8, i32 0, i32 0
store i64 500000, i64* %9
%10 = load i32, i32* @ITIMER_REAL
%11 = call i32 @setitimer(i32 %10, %struct.itimerval* %1, i32* null)
ret void
}

LLVM IR (-O2):
%struct.itimerval = type { %struct.TYPE_4__, %struct.TYPE_3__ }
%struct.TYPE_4__ = type { i64, i64 }
%struct.TYPE_3__ = type { i64, i64 }
@ITIMER_REAL = global i32 0
define void @set_timer() {
%1 = alloca %struct.itimerval
%2 = bitcast %struct.itimerval* %1 to i8*
%3 = getelementptr inbounds %struct.itimerval, %struct.itimerval* %1, i64 0, i32 1, i32 0
%4 = bitcast i64* %3 to <2 x i64>*
store <2 x i64> <i64 500000, i64 0>, <2 x i64>* %4
%5 = bitcast %struct.itimerval* %1 to <2 x i64>*
store <2 x i64> <i64 500000, i64 0>, <2 x i64>* %5
%6 = load i32, i32* @ITIMER_REAL
%7 = call i32 @setitimer(i32 %6, %struct.itimerval* %1, i32* null)
ret void
}