#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 taskstats {
  char *ac_comm;
  scalar_t__ cancelled_write_bytes;
  scalar_t__ write_bytes;
  scalar_t__ read_bytes;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, unsigned long long,
                          unsigned long long, unsigned long long);
void print_ioacct(struct taskstats *t) {
  printf("%s: read=%llu, write=%llu, cancelled_write=%llu\n", t->ac_comm,
         (unsigned long long)t->read_bytes, (unsigned long long)t->write_bytes,
         (unsigned long long)t->cancelled_write_bytes);
}


x86 assembly (clang, -O0):
<print_ioacct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rdx
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rcx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%r8
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_ioacct>:
mov    0x18(%rdi),%rdx
mov    0x10(%rdi),%rcx
mov    (%rdi),%rsi
mov    0x8(%rdi),%r8
lea    0xeda(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.taskstats = type { i8*, i64, i64, i64 }
@.str = [49 x i8] c"%s: read=%llu, write=%llu, cancelled_write=%llu\0A\00"
define void @print_ioacct(%struct.taskstats* %0) {
%2 = alloca %struct.taskstats*
store %struct.taskstats* %0, %struct.taskstats** %2
%3 = load %struct.taskstats*, %struct.taskstats** %2
%4 = getelementptr inbounds %struct.taskstats, %struct.taskstats* %3, i32 0, i32 0
%5 = load i8*, i8** %4
%6 = load %struct.taskstats*, %struct.taskstats** %2
%7 = getelementptr inbounds %struct.taskstats, %struct.taskstats* %6, i32 0, i32 3
%8 = load i64, i64* %7
%9 = load %struct.taskstats*, %struct.taskstats** %2
%10 = getelementptr inbounds %struct.taskstats, %struct.taskstats* %9, i32 0, i32 2
%11 = load i64, i64* %10
%12 = load %struct.taskstats*, %struct.taskstats** %2
%13 = getelementptr inbounds %struct.taskstats, %struct.taskstats* %12, i32 0, i32 1
%14 = load i64, i64* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %5, i64 %8, i64 %11, i64 %14)
ret void
}

LLVM IR (-O2):
%struct.taskstats = type { i8*, i64, i64, i64 }
@.str = [49 x i8] c"%s: read=%llu, write=%llu, cancelled_write=%llu\0A\00"
define void @print_ioacct(%struct.taskstats* nocapture %0) {
%2 = getelementptr inbounds %struct.taskstats, %struct.taskstats* %0, i64 0, i32 0
%3 = load i8*, i8** %2
%4 = getelementptr inbounds %struct.taskstats, %struct.taskstats* %0, i64 0, i32 3
%5 = load i64, i64* %4
%6 = getelementptr inbounds %struct.taskstats, %struct.taskstats* %0, i64 0, i32 2
%7 = load i64, i64* %6
%8 = getelementptr inbounds %struct.taskstats, %struct.taskstats* %0, i64 0, i32 1
%9 = load i64, i64* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %3, i64 %5, i64 %7, i64 %9)
ret void
}