#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__ {
  int /*<<< orphan*/ tv_usec;
  int /*<<< orphan*/ tv_sec;
};
struct TYPE_3__ {
  int /*<<< orphan*/ tv_usec;
  int /*<<< orphan*/ tv_sec;
};
struct rusage {
  int /*<<< orphan*/ ru_nivcsw;
  int /*<<< orphan*/ ru_nvcsw;
  TYPE_2__ ru_stime;
  TYPE_1__ ru_utime;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int /*<<< orphan*/,
                           int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
void print_rusage_as_json(FILE *output, struct rusage *usage) {
  fprintf(output,
          "\"ru_utime\" : %ld.%06ld, \"ru_stime\" : %ld.%06ld, \"ru_nvcsw\" : "
          "%ld, \"ru_nivcsw\" : %ld",
          usage->ru_utime.tv_sec, usage->ru_utime.tv_usec,
          usage->ru_stime.tv_sec, usage->ru_stime.tv_usec, usage->ru_nvcsw,
          usage->ru_nivcsw);
}


x86 assembly (clang, -O0):
<print_rusage_as_json>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x14(%rax),%edx
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    0xc(%rax),%r8d
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%r9d
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%r10d
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
lea    0xea9(%rip),%rsi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_rusage_as_json>:
push   %rax
mov    0x14(%rsi),%edx
mov    0x10(%rsi),%ecx
mov    0xc(%rsi),%r8d
mov    0x8(%rsi),%r9d
mov    (%rsi),%eax
mov    0x4(%rsi),%r10d
lea    0xed4(%rip),%rsi
push   %rax
push   %r10
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rax
ret

LLVM IR (-O0):
%struct.rusage = type { i32, i32, %struct.TYPE_4__, %struct.TYPE_3__ }
%struct.TYPE_4__ = type { i32, i32 }
%struct.TYPE_3__ = type { i32, i32 }
@.str = [84 x i8] c"\22ru_utime\22 : %ld.%06ld, \22ru_stime\22 : %ld.%06ld, \22ru_nvcsw\22 : %ld, \22ru_nivcsw\22 : %ld\00"
define void @print_rusage_as_json(i32* %0, %struct.rusage* %1) {
%3 = alloca i32*
%4 = alloca %struct.rusage*
store i32* %0, i32** %3
store %struct.rusage* %1, %struct.rusage** %4
%5 = load i32*, i32** %3
%6 = load %struct.rusage*, %struct.rusage** %4
%7 = getelementptr inbounds %struct.rusage, %struct.rusage* %6, i32 0, i32 3
%8 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %7, i32 0, i32 1
%9 = load i32, i32* %8
%10 = load %struct.rusage*, %struct.rusage** %4
%11 = getelementptr inbounds %struct.rusage, %struct.rusage* %10, i32 0, i32 3
%12 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %11, i32 0, i32 0
%13 = load i32, i32* %12
%14 = load %struct.rusage*, %struct.rusage** %4
%15 = getelementptr inbounds %struct.rusage, %struct.rusage* %14, i32 0, i32 2
%16 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %15, i32 0, i32 1
%17 = load i32, i32* %16
%18 = load %struct.rusage*, %struct.rusage** %4
%19 = getelementptr inbounds %struct.rusage, %struct.rusage* %18, i32 0, i32 2
%20 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %19, i32 0, i32 0
%21 = load i32, i32* %20
%22 = load %struct.rusage*, %struct.rusage** %4
%23 = getelementptr inbounds %struct.rusage, %struct.rusage* %22, i32 0, i32 1
%24 = load i32, i32* %23
%25 = load %struct.rusage*, %struct.rusage** %4
%26 = getelementptr inbounds %struct.rusage, %struct.rusage* %25, i32 0, i32 0
%27 = load i32, i32* %26
%28 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %13, i32 %17, i32 %21, i32 %24, i32 %27)
ret void
}

LLVM IR (-O2):
%struct.rusage = type { i32, i32, %struct.TYPE_4__, %struct.TYPE_3__ }
%struct.TYPE_4__ = type { i32, i32 }
%struct.TYPE_3__ = type { i32, i32 }
@.str = [84 x i8] c"\22ru_utime\22 : %ld.%06ld, \22ru_stime\22 : %ld.%06ld, \22ru_nvcsw\22 : %ld, \22ru_nivcsw\22 : %ld\00"
define void @print_rusage_as_json(i32* nocapture %0, %struct.rusage* nocapture %1) {
%3 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i64 0, i32 3, i32 1
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i64 0, i32 3, i32 0
%6 = load i32, i32* %5
%7 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i64 0, i32 2, i32 1
%8 = load i32, i32* %7
%9 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i64 0, i32 2, i32 0
%10 = load i32, i32* %9
%11 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i64 0, i32 1
%12 = load i32, i32* %11
%13 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i64 0, i32 0
%14 = load i32, i32* %13
%15 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %6, i32 %8, i32 %10, i32 %12, i32 %14)
ret void
}