#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_2__ TYPE_1__;

/* Type definitions */
typedef scalar_t__ uint64_t;
struct TYPE_2__ {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};
struct rusage {
  TYPE_1__ ru_utime;
};

/* Variables and functions */
int /*<<< orphan*/ RUSAGE_SELF;
int /*<<< orphan*/ getrusage(int /*<<< orphan*/, struct rusage *);
uint64_t microseconds() {
  struct rusage res[1];
  getrusage(RUSAGE_SELF, res);
  uint64_t r;
  r = (uint64_t)res->ru_utime.tv_sec;
  r *= (uint64_t)1000000UL;
  r += (uint64_t)res->ru_utime.tv_usec;
  return r;
}


x86 assembly (clang, -O0):
<microseconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <getrusage@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
imul   $0xf4240,-0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<microseconds>:
sub    $0x18,%rsp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <getrusage@plt>
imul   $0xf4240,0x8(%rsp),%rax
add    (%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.rusage = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i64, i64 }
@RUSAGE_SELF = global i32 0
define i64 @microseconds() {
%1 = alloca [1 x %struct.rusage]
%2 = alloca i64
%3 = load i32, i32* @RUSAGE_SELF
%4 = getelementptr inbounds [1 x %struct.rusage], [1 x %struct.rusage]* %1, i64 0, i64 0
%5 = call i32 @getrusage(i32 %3, %struct.rusage* %4)
%6 = getelementptr inbounds [1 x %struct.rusage], [1 x %struct.rusage]* %1, i64 0, i64 0
%7 = getelementptr inbounds %struct.rusage, %struct.rusage* %6, i32 0, i32 0
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 1
%9 = load i64, i64* %8
store i64 %9, i64* %2
%10 = load i64, i64* %2
%11 = mul nsw i64 %10, 1000000
store i64 %11, i64* %2
%12 = getelementptr inbounds [1 x %struct.rusage], [1 x %struct.rusage]* %1, i64 0, i64 0
%13 = getelementptr inbounds %struct.rusage, %struct.rusage* %12, i32 0, i32 0
%14 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %13, i32 0, i32 0
%15 = load i64, i64* %14
%16 = load i64, i64* %2
%17 = add nsw i64 %16, %15
store i64 %17, i64* %2
%18 = load i64, i64* %2
ret i64 %18
}

LLVM IR (-O2):
%struct.rusage = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i64, i64 }
@RUSAGE_SELF = global i32 0
define i64 @microseconds() {
%1 = alloca [1 x %struct.rusage]
%2 = bitcast [1 x %struct.rusage]* %1 to i8*
%3 = load i32, i32* @RUSAGE_SELF
%4 = getelementptr inbounds [1 x %struct.rusage], [1 x %struct.rusage]* %1, i64 0, i64 0
%5 = call i32 @getrusage(i32 %3, %struct.rusage* %4)
%6 = getelementptr inbounds [1 x %struct.rusage], [1 x %struct.rusage]* %1, i64 0, i64 0, i32 0, i32 1
%7 = load i64, i64* %6
%8 = mul nsw i64 %7, 1000000
%9 = getelementptr inbounds [1 x %struct.rusage], [1 x %struct.rusage]* %1, i64 0, i64 0, i32 0, i32 0
%10 = load i64, i64* %9
%11 = add nsw i64 %8, %10
ret i64 %11
}