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

/* Variables and functions */
int /*<<< orphan*/ ITIMER_REAL;
int /*<<< orphan*/ SIGALRM;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ log_Printf(int, char *, int /*<<< orphan*/);
int setitimer(int /*<<< orphan*/, struct itimerval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ sig_signal(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void timer_TermService(void) {
  struct itimerval itimer;
  itimer.it_interval.tv_usec = itimer.it_interval.tv_sec = 0;
  itimer.it_value.tv_usec = itimer.it_value.tv_sec = 0;
  if (setitimer(ITIMER_REAL, &itimer, NULL) == -1)
    log_Printf((24), "Unable to set itimer (%s)\n", strerror(errno));
  sig_signal(SIGALRM, SIG_IGN);
}


x86 assembly (clang, -O0):
<timer_TermService>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
lea    -0x20(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1050 <setitimer@plt>
cmp    $0xffffffff,%eax
jne    11a8 <timer_TermService+0x68>
mov    0x2e3a(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    %eax,%edx
mov    $0x18,%edi
lea    0xe5d(%rip),%rsi
call   1030 <log_Printf@plt>
mov    0x2e39(%rip),%rax
mov    (%rax),%edi
mov    0x2e28(%rip),%rax
mov    (%rax),%esi
call   1040 <sig_signal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_TermService>:
sub    $0x28,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
xor    %edx,%edx
call   1050 <setitimer@plt>
cmp    $0xffffffff,%eax
jne    1189 <timer_TermService+0x49>
mov    0x2e59(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
lea    0xe83(%rip),%rsi
mov    $0x18,%edi
mov    %eax,%edx
call   1030 <log_Printf@plt>
mov    0x2e58(%rip),%rax
mov    (%rax),%edi
mov    0x2e47(%rip),%rax
mov    (%rax),%esi
add    $0x28,%rsp
jmp    1040 <sig_signal@plt>

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
@.str = [27 x i8] c"Unable to set itimer (%s)\0A\00"
@errno = global i32 0
@SIGALRM = global i32 0
@SIG_IGN = global i32 0
define void @timer_TermService() {
%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 0
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 1
store i64 0, 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 0
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 1
store i64 0, i64* %9
%10 = load i32, i32* @ITIMER_REAL
%11 = call i32 @setitimer(i32 %10, %struct.itimerval* %1, i32* null)
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %17
13: ; preds = %0
%14 = load i32, i32* @errno
%15 = call i32 @strerror(i32 %14)
%16 = call i32 @log_Printf(i32 24, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %13, %0
%18 = load i32, i32* @SIGALRM
%19 = load i32, i32* @SIG_IGN
%20 = call i32 @sig_signal(i32 %18, i32 %19)
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
@.str = [27 x i8] c"Unable to set itimer (%s)\0A\00"
@errno = global i32 0
@SIGALRM = global i32 0
@SIG_IGN = global i32 0
define void @timer_TermService() {
%1 = alloca %struct.itimerval
%2 = bitcast %struct.itimerval* %1 to i8*
%3 = bitcast %struct.itimerval* %1 to i8*
%4 = load i32, i32* @ITIMER_REAL
%5 = call i32 @setitimer(i32 %4, %struct.itimerval* %1, i32* null)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = load i32, i32* @errno
%9 = tail call i32 @strerror(i32 %8)
%10 = tail call i32 @log_Printf(i32 24, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %7, %0
%12 = load i32, i32* @SIGALRM
%13 = load i32, i32* @SIG_IGN
%14 = tail call i32 @sig_signal(i32 %12, i32 %13)
ret void
}