#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 {
  int /*<<< orphan*/ tv_usec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int, ...);
void print_cpu_stats(unsigned long average, struct timeval c0_time,
                     struct timeval cx_time, unsigned int c0_percent) {
  printf("%.7lu\t\t\t", average);
  printf("%.2lu sec %.3lu ms\t", c0_time.tv_sec, c0_time.tv_usec);
  printf("%.2lu sec %.3lu ms\t", cx_time.tv_sec, cx_time.tv_usec);
  printf("%.2u", c0_percent);
}


x86 assembly (clang, -O0):
<print_cpu_stats>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rsi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    %eax,%esi
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_cpu_stats>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rsi
mov    %r12,%rbp
shr    $0x20,%rbp
mov    %rdx,%rbx
shr    $0x20,%rbx
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xebf(%rip),%r13
mov    %r13,%rdi
mov    %ebp,%esi
mov    %r12d,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r13,%rdi
mov    %ebx,%esi
mov    %r15d,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeae(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
@.str = [9 x i8] c"%.7lu\09\09\09\00"
@.str.1 = [20 x i8] c"%.2lu sec %.3lu ms\09\00"
@.str.2 = [5 x i8] c"%.2u\00"
define void @print_cpu_stats(i64 %0, i64 %1, i64 %2, i32 %3) {
%5 = alloca %struct.timeval
%6 = alloca %struct.timeval
%7 = alloca i64
%8 = alloca i32
%9 = bitcast %struct.timeval* %5 to i64*
store i64 %1, i64* %9
%10 = bitcast %struct.timeval* %6 to i64*
store i64 %2, i64* %10
store i64 %0, i64* %7
store i32 %3, i32* %8
%11 = load i64, i64* %7
%12 = trunc i64 %11 to i32
%13 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 1
%15 = load i32, i32* %14
%16 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%17 = load i32, i32* %16
%18 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %15, i32 %17)
%19 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 1
%20 = load i32, i32* %19
%21 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 0
%22 = load i32, i32* %21
%23 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %20, i32 %22)
%24 = load i32, i32* %8
%25 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %24)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"%.7lu\09\09\09\00"
@.str.1 = [20 x i8] c"%.2lu sec %.3lu ms\09\00"
@.str.2 = [5 x i8] c"%.2u\00"
define void @print_cpu_stats(i64 %0, i64 %1, i64 %2, i32 %3) {
%5 = trunc i64 %1 to i32
%6 = lshr i64 %1, 32
%7 = trunc i64 %6 to i32
%8 = trunc i64 %2 to i32
%9 = lshr i64 %2, 32
%10 = trunc i64 %9 to i32
%11 = trunc i64 %0 to i32
%12 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %5)
%14 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 %8)
%15 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %3)
ret void
}