#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 timezone {
  int dummy;
};
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ error(int /*<<< orphan*/, int /*<<< orphan*/, char *);
int gettimeofday_syscall_wrapper(struct timeval *, struct timezone *);
void gettimeofday_syscall_nofail(struct timeval *tv, struct timezone *tz) {
  int err;
  err = gettimeofday_syscall_wrapper(tv, tz);
  if (err)
    error(EXIT_FAILURE, errno, "SYS_gettimeofday");
}


x86 assembly (clang, -O0):
<gettimeofday_syscall_nofail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <gettimeofday_syscall_wrapper@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1168 <gettimeofday_syscall_nofail+0x48>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
mov    0x2e86(%rip),%rax
mov    (%rax),%esi
lea    0xe9d(%rip),%rdx
call   1040 <error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettimeofday_syscall_nofail>:
push   %rax
call   1030 <gettimeofday_syscall_wrapper@plt>
test   %eax,%eax
je     1149 <gettimeofday_syscall_nofail+0x29>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
mov    0x2ea6(%rip),%rax
mov    (%rax),%esi
lea    0xebd(%rip),%rdx
pop    %rax
jmp    1040 <error@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
%struct.timezone = type { i32 }
@EXIT_FAILURE = global i32 0
@errno = global i32 0
@.str = [17 x i8] c"SYS_gettimeofday\00"
define void @gettimeofday_syscall_nofail(%struct.timeval* %0, %struct.timezone* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timezone*
%5 = alloca i32
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timezone* %1, %struct.timezone** %4
%6 = load %struct.timeval*, %struct.timeval** %3
%7 = load %struct.timezone*, %struct.timezone** %4
%8 = call i32 @gettimeofday_syscall_wrapper(%struct.timeval* %6, %struct.timezone* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i32, i32* @EXIT_FAILURE
%13 = load i32, i32* @errno
%14 = call i32 @error(i32 %12, i32 %13, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
%struct.timezone = type { i32 }
@EXIT_FAILURE = global i32 0
@errno = global i32 0
@.str = [17 x i8] c"SYS_gettimeofday\00"
define void @gettimeofday_syscall_nofail(%struct.timeval* %0, %struct.timezone* %1) {
%3 = tail call i32 @gettimeofday_syscall_wrapper(%struct.timeval* %0, %struct.timezone* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i32, i32* @EXIT_FAILURE
%7 = load i32, i32* @errno
%8 = tail call i32 @error(i32 %6, i32 %7, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %5, %2
ret void
}