#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_usec;
  scalar_t__ tv_sec;
};
struct TYPE_3__ {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};
struct rusage {
  TYPE_2__ ru_stime;
  TYPE_1__ ru_utime;
};

/* Variables and functions */
int /*<<< orphan*/ RUSAGE_SELF;
int /*<<< orphan*/ getrusage(int /*<<< orphan*/, struct rusage *);
float currentElapsedTime(void) {
  struct rusage r_usage;
  getrusage(RUSAGE_SELF, &r_usage);
  return ((float)r_usage.ru_utime.tv_sec + (float)r_usage.ru_stime.tv_sec +
          (float)r_usage.ru_utime.tv_usec / (float)1000000 +
          (float)r_usage.ru_stime.tv_usec / (float)1000000);
}


x86 assembly (clang, -O0):
<currentElapsedTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    -0x20(%rbp),%rsi
call   1030 <getrusage@plt>
cvtsi2ssq -0x8(%rbp),%xmm0
cvtsi2ssq -0x18(%rbp),%xmm1
addss  %xmm1,%xmm0
cvtsi2ssq -0x10(%rbp),%xmm1
movss  0xeb8(%rip),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
cvtsi2ssq -0x20(%rbp),%xmm1
movss  0xea2(%rip),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<currentElapsedTime>:
sub    $0x28,%rsp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <getrusage@plt>
cvtsi2ssq 0x20(%rsp),%xmm1
cvtsi2ssq 0x10(%rsp),%xmm2
cvtsi2ssq 0x8(%rsp),%xmm3
cvtsi2ssq 0x18(%rsp),%xmm0
unpcklps %xmm3,%xmm0
divps  0xeb3(%rip),%xmm0
addss  %xmm1,%xmm2
addss  %xmm0,%xmm2
shufps $0x55,%xmm0,%xmm0
addss  %xmm2,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
%struct.rusage = type { %struct.TYPE_4__, %struct.TYPE_3__ }
%struct.TYPE_4__ = type { i64, i64 }
%struct.TYPE_3__ = type { i64, i64 }
@RUSAGE_SELF = global i32 0
define float @currentElapsedTime() {
%1 = alloca %struct.rusage
%2 = load i32, i32* @RUSAGE_SELF
%3 = call i32 @getrusage(i32 %2, %struct.rusage* %1)
%4 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i32 0, i32 1
%5 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %4, i32 0, i32 1
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to float
%8 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %8, i32 0, i32 1
%10 = load i64, i64* %9
%11 = sitofp i64 %10 to float
%12 = fadd float %7, %11
%13 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i32 0, i32 1
%14 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %13, i32 0, i32 0
%15 = load i64, i64* %14
%16 = sitofp i64 %15 to float
%17 = fdiv float %16, 1.000000e+06
%18 = fadd float %12, %17
%19 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i32 0, i32 0
%20 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %19, i32 0, i32 0
%21 = load i64, i64* %20
%22 = sitofp i64 %21 to float
%23 = fdiv float %22, 1.000000e+06
%24 = fadd float %18, %23
ret float %24
}

LLVM IR (-O2):
%struct.rusage = type { %struct.TYPE_4__, %struct.TYPE_3__ }
%struct.TYPE_4__ = type { i64, i64 }
%struct.TYPE_3__ = type { i64, i64 }
@RUSAGE_SELF = global i32 0
define float @currentElapsedTime() {
%1 = alloca %struct.rusage
%2 = bitcast %struct.rusage* %1 to i8*
%3 = load i32, i32* @RUSAGE_SELF
%4 = call i32 @getrusage(i32 %3, %struct.rusage* %1)
%5 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i64 0, i32 1, i32 1
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to float
%8 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i64 0, i32 0, i32 1
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to float
%11 = fadd float %7, %10
%12 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i64 0, i32 1, i32 0
%13 = bitcast i64* %12 to <2 x i64>*
%14 = load <2 x i64>, <2 x i64>* %13
%15 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i64 0, i32 0, i32 0
%16 = load i64, i64* %15
%17 = insertelement <2 x i64> %14, i64 %16, i64 1
%18 = sitofp <2 x i64> %17 to <2 x float>
%19 = fdiv <2 x float> %18, <float 1.000000e+06, float 1.000000e+06>
%20 = extractelement <2 x float> %19, i64 0
%21 = fadd float %11, %20
%22 = extractelement <2 x float> %19, i64 1
%23 = fadd float %21, %22
ret float %23
}