#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 /*<<< orphan*/ it_interval;
  int /*<<< orphan*/ it_value;
};

/* Variables and functions */
int /*<<< orphan*/ ITIMER_REAL;
int /*<<< orphan*/ SIGALRM;
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ setitimer(int /*<<< orphan*/, struct itimerval *,
                             struct itimerval *);
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ timerclear(int /*<<< orphan*/ *);
void end_msgs(void) {
  struct itimerval itimer;
  timerclear(&itimer.it_value);
  timerclear(&itimer.it_interval);
  setitimer(ITIMER_REAL, &itimer, (struct itimerval *)0);
  signal(SIGALRM, SIG_DFL);
}


x86 assembly (clang, -O0):
<end_msgs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
add    $0x4,%rdi
call   1040 <timerclear@plt>
lea    -0x8(%rbp),%rdi
call   1040 <timerclear@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1050 <setitimer@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
mov    0x2e5c(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<end_msgs>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rdi
call   1040 <timerclear@plt>
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <timerclear@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1050 <setitimer@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
mov    0x2e61(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.itimerval = type { i32, i32 }
@ITIMER_REAL = global i32 0
@SIGALRM = global i32 0
@SIG_DFL = global i32 0
define void @end_msgs() {
%1 = alloca %struct.itimerval
%2 = getelementptr inbounds %struct.itimerval, %struct.itimerval* %1, i32 0, i32 1
%3 = call i32 @timerclear(i32* %2)
%4 = getelementptr inbounds %struct.itimerval, %struct.itimerval* %1, i32 0, i32 0
%5 = call i32 @timerclear(i32* %4)
%6 = load i32, i32* @ITIMER_REAL
%7 = call i32 @setitimer(i32 %6, %struct.itimerval* %1, %struct.itimerval* null)
%8 = load i32, i32* @SIGALRM
%9 = load i32, i32* @SIG_DFL
%10 = call i32 @signal(i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
%struct.itimerval = type { i32, i32 }
@ITIMER_REAL = global i32 0
@SIGALRM = global i32 0
@SIG_DFL = global i32 0
define void @end_msgs() {
%1 = alloca %struct.itimerval
%2 = bitcast %struct.itimerval* %1 to i8*
%3 = getelementptr inbounds %struct.itimerval, %struct.itimerval* %1, i64 0, i32 1
%4 = call i32 @timerclear(i32* %3)
%5 = getelementptr inbounds %struct.itimerval, %struct.itimerval* %1, i64 0, i32 0
%6 = call i32 @timerclear(i32* %5)
%7 = load i32, i32* @ITIMER_REAL
%8 = call i32 @setitimer(i32 %7, %struct.itimerval* %1, %struct.itimerval* null)
%9 = load i32, i32* @SIGALRM
%10 = load i32, i32* @SIG_DFL
%11 = call i32 @signal(i32 %9, i32 %10)
ret void
}