#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*/ errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, char *,
                           char *);
scalar_t__ gettimeofday(struct timeval *, struct timezone *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void Gettimeofday(struct timeval *tv, struct timezone *tz) {
  if (gettimeofday(tv, tz) < 0)
    do {
      fprintf(stderr, "ERROR: [%s:%d] %s: %s\n",
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/ystk/debian-freeipmi/refs/heads/"
              "master/ipmipower/src/wrappers.c",
              214, "gettimeofday", strerror(errno));
    } while (0);
}


x86 assembly (clang, -O0):
<Gettimeofday>:
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@plt>
cmp    $0x0,%rax
jge    11a0 <Gettimeofday+0x70>
jmp    115c <Gettimeofday+0x2c>
mov    0x2e7d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    %rax,%r9
lea    0xe7d(%rip),%rsi
lea    0xe8d(%rip),%rdx
mov    $0xd6,%ecx
lea    0xf1b(%rip),%r8
call   1040 <fprintf@plt>
jmp    11a0 <Gettimeofday+0x70>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Gettimeofday>:
push   %rbx
call   1030 <gettimeofday@plt>
test   %rax,%rax
js     113d <Gettimeofday+0xd>
pop    %rbx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%ebx
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xea5(%rip),%rsi
lea    0xeb5(%rip),%rdx
lea    0xf48(%rip),%r8
mov    %ebx,%edi
mov    $0xd6,%ecx
mov    %rax,%r9
pop    %rbx
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
%struct.timezone = type { i32 }
@stderr = global i32 0
@.str = [23 x i8] c"ERROR: [%s:%d] %s: %s\0A\00"
@.str.1 = [154 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ystk/debian-freeipmi/refs/heads/master/ipmipower/src/wrappers.c\00"
@.str.2 = [13 x i8] c"gettimeofday\00"
@errno = global i32 0
define void @Gettimeofday(%struct.timeval* %0, %struct.timezone* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timezone*
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timezone* %1, %struct.timezone** %4
%5 = load %struct.timeval*, %struct.timeval** %3
%6 = load %struct.timezone*, %struct.timezone** %4
%7 = call i64 @gettimeofday(%struct.timeval* %5, %struct.timezone* %6)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %2
br label %10
10: ; preds = %9
%11 = load i32, i32* @stderr
%12 = load i32, i32* @errno
%13 = call i8* @strerror(i32 %12)
%14 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.1, i64 0, i64 0), i32 214, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %13)
br label %15
15: ; preds = %10
br label %16
16: ; preds = %15, %2
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
%struct.timezone = type { i32 }
@stderr = global i32 0
@.str = [23 x i8] c"ERROR: [%s:%d] %s: %s\0A\00"
@.str.1 = [154 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ystk/debian-freeipmi/refs/heads/master/ipmipower/src/wrappers.c\00"
@.str.2 = [13 x i8] c"gettimeofday\00"
@errno = global i32 0
define void @Gettimeofday(%struct.timeval* nocapture %0, %struct.timezone* nocapture %1) {
%3 = tail call i64 @gettimeofday(%struct.timeval* %0, %struct.timezone* %1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = load i32, i32* @errno
%8 = tail call i8* @strerror(i32 %7)
%9 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.1, i64 0, i64 0), i32 214, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %8)
br label %10
10: ; preds = %5, %2
ret void
}