#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 dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Sys_failure(char *);
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int setitimer(int, struct itimerval const *, struct itimerval *);
void Setitimer(int which, const struct itimerval *value,
               struct itimerval *ovalue) {
  int retval;
  assert(value != NULL);
  retval = setitimer(which, value, ovalue);
  if (retval == -1)
    Sys_failure("setitimer");
}


x86 assembly (clang, -O0):
<Setitimer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <setitimer@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
jne    117e <Setitimer+0x4e>
lea    0xe87(%rip),%rdi
call   1040 <Sys_failure@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Setitimer>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %edi,%edi
test   %rsi,%rsi
setne  %dil
call   1030 <assert@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1050 <setitimer@plt>
cmp    $0xffffffff,%eax
je     1161 <Setitimer+0x31>
pop    %rbx
pop    %r14
pop    %rbp
ret
lea    0xe98(%rip),%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <Sys_failure@plt>

LLVM IR (-O0):
%struct.itimerval = type { i32 }
@.str = [10 x i8] c"setitimer\00"
define void @Setitimer(i32 %0, %struct.itimerval* %1, %struct.itimerval* %2) {
%4 = alloca i32
%5 = alloca %struct.itimerval*
%6 = alloca %struct.itimerval*
%7 = alloca i32
store i32 %0, i32* %4
store %struct.itimerval* %1, %struct.itimerval** %5
store %struct.itimerval* %2, %struct.itimerval** %6
%8 = load %struct.itimerval*, %struct.itimerval** %5
%9 = icmp ne %struct.itimerval* %8, null
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i32, i32* %4
%13 = load %struct.itimerval*, %struct.itimerval** %5
%14 = load %struct.itimerval*, %struct.itimerval** %6
%15 = call i32 @setitimer(i32 %12, %struct.itimerval* %13, %struct.itimerval* %14)
store i32 %15, i32* %7
%16 = load i32, i32* %7
%17 = icmp eq i32 %16, -1
br i1 %17, label %18, label %20
18: ; preds = %3
%19 = call i32 @Sys_failure(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %20
20: ; preds = %18, %3
ret void
}

LLVM IR (-O2):
%struct.itimerval = type { i32 }
@.str = [10 x i8] c"setitimer\00"
define void @Setitimer(i32 %0, %struct.itimerval* %1, %struct.itimerval* nocapture %2) {
%4 = icmp ne %struct.itimerval* %1, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i32 @setitimer(i32 %0, %struct.itimerval* %1, %struct.itimerval* %2)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = tail call i32 @Sys_failure(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %3
ret void
}