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

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, long, long);
int /*<<< orphan*/ stderr;
void PrintRUsage(struct rusage *rUBuf1, struct rusage *rUBuf2) {
  long sec;
  long usec;
  sec = (*rUBuf2).ru_utime.tv_sec - (*rUBuf1).ru_utime.tv_sec;
  usec = (*rUBuf2).ru_utime.tv_usec - (*rUBuf1).ru_utime.tv_usec;
  if (usec < 0) {
    sec--;
    usec += 1000000;
  }
  assert(sec >= 0);
  assert(usec >= 0);
  fprintf(stderr, "User time: %d%06d usec\n", sec, usec);
  sec = (*rUBuf2).ru_stime.tv_sec - (*rUBuf1).ru_stime.tv_sec;
  usec = (*rUBuf2).ru_stime.tv_usec - (*rUBuf1).ru_stime.tv_usec;
  if (usec < 0) {
    sec--;
    usec += 1000000;
  }
  assert(sec >= 0);
  assert(usec >= 0);
  fprintf(stderr, "Sys time:  %d%06d usec\n", sec, usec);
}


x86 assembly (clang, -O0):
<PrintRUsage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    -0x8(%rbp),%rcx
sub    0x10(%rcx),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    -0x8(%rbp),%rcx
sub    0x18(%rcx),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jge    117d <PrintRUsage+0x5d>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0xf4240,%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpq   $0x0,-0x20(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    0x2e38(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xe47(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
sub    (%rcx),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    -0x8(%rbp),%rcx
sub    0x8(%rcx),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jge    1209 <PrintRUsage+0xe9>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0xf4240,%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpq   $0x0,-0x20(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    0x2dac(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xdd3(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintRUsage>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    0x10(%rsi),%rax
mov    0x18(%rsi),%rcx
sub    0x10(%rdi),%rax
sub    0x18(%rdi),%rcx
lea    0xf4240(%rcx),%r12
mov    %rcx,%rbx
sar    $0x3f,%rbx
add    %rax,%rbx
test   %rcx,%rcx
cmovns %rcx,%r12
mov    %rbx,%rdi
shr    $0x3f,%rdi
xor    $0x1,%edi
call   1030 <assert@plt>
mov    %r12,%rdi
shr    $0x3f,%rdi
xor    $0x1,%edi
call   1030 <assert@plt>
mov    0x2e64(%rip),%r13
mov    0x0(%r13),%edi
lea    0xe79(%rip),%rsi
mov    %rbx,%rdx
mov    %r12,%rcx
call   1040 <fprintf@plt>
mov    (%r15),%rax
mov    0x8(%r15),%rcx
sub    (%r14),%rax
sub    0x8(%r14),%rcx
lea    0xf4240(%rcx),%r14
mov    %rcx,%rbx
sar    $0x3f,%rbx
add    %rax,%rbx
test   %rcx,%rcx
cmovns %rcx,%r14
mov    %rbx,%rdi
shr    $0x3f,%rdi
xor    $0x1,%edi
call   1030 <assert@plt>
mov    %r14,%rdi
shr    $0x3f,%rdi
xor    $0x1,%edi
call   1030 <assert@plt>
mov    0x0(%r13),%edi
lea    0xe37(%rip),%rsi
mov    %rbx,%rdx
mov    %r14,%rcx
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
%struct.rusage = type { %struct.TYPE_4__, %struct.TYPE_3__ }
%struct.TYPE_4__ = type { i64, i64 }
%struct.TYPE_3__ = type { i64, i64 }
@stderr = global i32 0
@.str = [24 x i8] c"User time: %d%06d usec\0A\00"
@.str.1 = [24 x i8] c"Sys time: %d%06d usec\0A\00"
define void @PrintRUsage(%struct.rusage* %0, %struct.rusage* %1) {
%3 = alloca %struct.rusage*
%4 = alloca %struct.rusage*
%5 = alloca i64
%6 = alloca i64
store %struct.rusage* %0, %struct.rusage** %3
store %struct.rusage* %1, %struct.rusage** %4
%7 = load %struct.rusage*, %struct.rusage** %4
%8 = getelementptr inbounds %struct.rusage, %struct.rusage* %7, i32 0, i32 1
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
%10 = load i64, i64* %9
%11 = load %struct.rusage*, %struct.rusage** %3
%12 = getelementptr inbounds %struct.rusage, %struct.rusage* %11, i32 0, i32 1
%13 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %12, i32 0, i32 0
%14 = load i64, i64* %13
%15 = sub nsw i64 %10, %14
store i64 %15, i64* %5
%16 = load %struct.rusage*, %struct.rusage** %4
%17 = getelementptr inbounds %struct.rusage, %struct.rusage* %16, i32 0, i32 1
%18 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %17, i32 0, i32 1
%19 = load i64, i64* %18
%20 = load %struct.rusage*, %struct.rusage** %3
%21 = getelementptr inbounds %struct.rusage, %struct.rusage* %20, i32 0, i32 1
%22 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %21, i32 0, i32 1
%23 = load i64, i64* %22
%24 = sub nsw i64 %19, %23
store i64 %24, i64* %6
%25 = load i64, i64* %6
%26 = icmp slt i64 %25, 0
br i1 %26, label %27, label %32
27: ; preds = %2
%28 = load i64, i64* %5
%29 = add nsw i64 %28, -1
store i64 %29, i64* %5
%30 = load i64, i64* %6
%31 = add nsw i64 %30, 1000000
store i64 %31, i64* %6
br label %32
32: ; preds = %27, %2
%33 = load i64, i64* %5
%34 = icmp sge i64 %33, 0
%35 = zext i1 %34 to i32
%36 = call i32 @assert(i32 %35)
%37 = load i64, i64* %6
%38 = icmp sge i64 %37, 0
%39 = zext i1 %38 to i32
%40 = call i32 @assert(i32 %39)
%41 = load i32, i32* @stderr
%42 = load i64, i64* %5
%43 = load i64, i64* %6
%44 = call i32 @fprintf(i32 %41, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i64 %42, i64 %43)
%45 = load %struct.rusage*, %struct.rusage** %4
%46 = getelementptr inbounds %struct.rusage, %struct.rusage* %45, i32 0, i32 0
%47 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %46, i32 0, i32 0
%48 = load i64, i64* %47
%49 = load %struct.rusage*, %struct.rusage** %3
%50 = getelementptr inbounds %struct.rusage, %struct.rusage* %49, i32 0, i32 0
%51 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %50, i32 0, i32 0
%52 = load i64, i64* %51
%53 = sub nsw i64 %48, %52
store i64 %53, i64* %5
%54 = load %struct.rusage*, %struct.rusage** %4
%55 = getelementptr inbounds %struct.rusage, %struct.rusage* %54, i32 0, i32 0
%56 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %55, i32 0, i32 1
%57 = load i64, i64* %56
%58 = load %struct.rusage*, %struct.rusage** %3
%59 = getelementptr inbounds %struct.rusage, %struct.rusage* %58, i32 0, i32 0
%60 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %59, i32 0, i32 1
%61 = load i64, i64* %60
%62 = sub nsw i64 %57, %61
store i64 %62, i64* %6
%63 = load i64, i64* %6
%64 = icmp slt i64 %63, 0
br i1 %64, label %65, label %70
65: ; preds = %32
%66 = load i64, i64* %5
%67 = add nsw i64 %66, -1
store i64 %67, i64* %5
%68 = load i64, i64* %6
%69 = add nsw i64 %68, 1000000
store i64 %69, i64* %6
br label %70
70: ; preds = %65, %32
%71 = load i64, i64* %5
%72 = icmp sge i64 %71, 0
%73 = zext i1 %72 to i32
%74 = call i32 @assert(i32 %73)
%75 = load i64, i64* %6
%76 = icmp sge i64 %75, 0
%77 = zext i1 %76 to i32
%78 = call i32 @assert(i32 %77)
%79 = load i32, i32* @stderr
%80 = load i64, i64* %5
%81 = load i64, i64* %6
%82 = call i32 @fprintf(i32 %79, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i64 %80, i64 %81)
ret void
}

LLVM IR (-O2):
%struct.rusage = type { %struct.TYPE_4__, %struct.TYPE_3__ }
%struct.TYPE_4__ = type { i64, i64 }
%struct.TYPE_3__ = type { i64, i64 }
@stderr = global i32 0
@.str = [24 x i8] c"User time: %d%06d usec\0A\00"
@.str.1 = [24 x i8] c"Sys time: %d%06d usec\0A\00"
define void @PrintRUsage(%struct.rusage* nocapture %0, %struct.rusage* nocapture %1) {
%3 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i64 0, i32 1, i32 0
%4 = load i64, i64* %3
%5 = getelementptr inbounds %struct.rusage, %struct.rusage* %0, i64 0, i32 1, i32 0
%6 = load i64, i64* %5
%7 = sub nsw i64 %4, %6
%8 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i64 0, i32 1, i32 1
%9 = load i64, i64* %8
%10 = getelementptr inbounds %struct.rusage, %struct.rusage* %0, i64 0, i32 1, i32 1
%11 = load i64, i64* %10
%12 = sub nsw i64 %9, %11
%13 = icmp slt i64 %12, 0
%14 = add nsw i64 %12, 1000000
%15 = ashr i64 %12, 63
%16 = add nsw i64 %15, %7
%17 = select i1 %13, i64 %14, i64 %12
%18 = lshr i64 %16, 63
%19 = trunc i64 %18 to i32
%20 = xor i32 %19, 1
%21 = tail call i32 @assert(i32 %20)
%22 = lshr i64 %17, 63
%23 = trunc i64 %22 to i32
%24 = xor i32 %23, 1
%25 = tail call i32 @assert(i32 %24)
%26 = load i32, i32* @stderr
%27 = tail call i32 @fprintf(i32 %26, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i64 %16, i64 %17)
%28 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i64 0, i32 0, i32 0
%29 = load i64, i64* %28
%30 = getelementptr inbounds %struct.rusage, %struct.rusage* %0, i64 0, i32 0, i32 0
%31 = load i64, i64* %30
%32 = sub nsw i64 %29, %31
%33 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i64 0, i32 0, i32 1
%34 = load i64, i64* %33
%35 = getelementptr inbounds %struct.rusage, %struct.rusage* %0, i64 0, i32 0, i32 1
%36 = load i64, i64* %35
%37 = sub nsw i64 %34, %36
%38 = icmp slt i64 %37, 0
%39 = add nsw i64 %37, 1000000
%40 = ashr i64 %37, 63
%41 = add nsw i64 %40, %32
%42 = select i1 %38, i64 %39, i64 %37
%43 = lshr i64 %41, 63
%44 = trunc i64 %43 to i32
%45 = xor i32 %44, 1
%46 = tail call i32 @assert(i32 %45)
%47 = lshr i64 %42, 63
%48 = trunc i64 %47 to i32
%49 = xor i32 %48, 1
%50 = tail call i32 @assert(i32 %49)
%51 = load i32, i32* @stderr
%52 = tail call i32 @fprintf(i32 %51, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i64 %41, i64 %42)
ret void
}