#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 timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ assert(int);
int gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double omp_get_wtime(void) {
  struct timeval tp;
  int rc = gettimeofday(&tp, NULL);
  if (rc != 0)
    abort();
  assert(rc == 0);
  double t = tp.tv_sec + tp.tv_usec * 1.e-6;
  return t;
}


x86 assembly (clang, -O0):
<omp_get_wtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <gettimeofday@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1159 <omp_get_wtime+0x29>
mov    $0x0,%al
call   1030 <abort@plt>
cmpl   $0x0,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  0xe84(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<omp_get_wtime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
test   %eax,%eax
jne    1167 <omp_get_wtime+0x37>
mov    $0x1,%edi
call   1050 <assert@plt>
movsd  0x10(%rsp),%xmm0
mulsd  0xea4(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct.timeval = type { double, double }
define double @omp_get_wtime() {
%1 = alloca %struct.timeval
%2 = alloca i32
%3 = alloca double
%4 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 (...) @abort()
unreachable
9: ; preds = %0
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%15 = load double, double* %14
%16 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%17 = load double, double* %16
%18 = call double @llvm.fmuladd.f64(double %17, double 0x3EB0C6F7A0B5ED8D, double %15)
store double %18, double* %3
%19 = load double, double* %3
ret double %19
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
define double @omp_get_wtime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %0
%8 = tail call i32 @assert(i32 1)
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%10 = load double, double* %9
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%12 = load double, double* %11
%13 = tail call double @llvm.fmuladd.f64(double %12, double 0x3EB0C6F7A0B5ED8D, double %10)
ret double %13
}