#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 int /*<<< orphan*/ time_t;
struct TYPE_2__ {
  int /*<<< orphan*/ tv_sec;
};
struct utmpx {
  char *ut_user;
  char *ut_line;
  char *ut_host;
  TYPE_1__ ut_tv;
};

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *, char *, char *, char *);
void output(struct utmpx *u) {
  time_t t = u->ut_tv.tv_sec;
  printf("%-10s %-8s %-22.22s %s", u->ut_user, u->ut_line, u->ut_host,
         ctime(&t));
}


x86 assembly (clang, -O0):
<output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <ctime@plt>
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    %rax,%r8
lea    0xe88(%rip),%rdi
call   1040 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    0x18(%rdi),%eax
mov    %eax,0xc(%rsp)
mov    (%rdi),%rbx
mov    0x8(%rdi),%r14
mov    0x10(%rdi),%r15
lea    0xc(%rsp),%rdi
call   1030 <ctime@plt>
lea    0xeb4(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %r15,%rcx
mov    %rax,%r8
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.utmpx = type { i8*, i8*, i8*, %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i32 }
@.str = [23 x i8] c"%-10s %-8s %-22.22s %s\00"
define void @output(%struct.utmpx* %0) {
%2 = alloca %struct.utmpx*
%3 = alloca i32
store %struct.utmpx* %0, %struct.utmpx** %2
%4 = load %struct.utmpx*, %struct.utmpx** %2
%5 = getelementptr inbounds %struct.utmpx, %struct.utmpx* %4, i32 0, i32 3
%6 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %5, i32 0, i32 0
%7 = load i32, i32* %6
store i32 %7, i32* %3
%8 = load %struct.utmpx*, %struct.utmpx** %2
%9 = getelementptr inbounds %struct.utmpx, %struct.utmpx* %8, i32 0, i32 0
%10 = load i8*, i8** %9
%11 = load %struct.utmpx*, %struct.utmpx** %2
%12 = getelementptr inbounds %struct.utmpx, %struct.utmpx* %11, i32 0, i32 1
%13 = load i8*, i8** %12
%14 = load %struct.utmpx*, %struct.utmpx** %2
%15 = getelementptr inbounds %struct.utmpx, %struct.utmpx* %14, i32 0, i32 2
%16 = load i8*, i8** %15
%17 = call i8* @ctime(i32* %3)
%18 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %13, i8* %16, i8* %17)
ret void
}

LLVM IR (-O2):
%struct.utmpx = type { i8*, i8*, i8*, %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i32 }
@.str = [23 x i8] c"%-10s %-8s %-22.22s %s\00"
define void @output(%struct.utmpx* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = getelementptr inbounds %struct.utmpx, %struct.utmpx* %0, i64 0, i32 3, i32 0
%5 = load i32, i32* %4
store i32 %5, i32* %2
%6 = getelementptr inbounds %struct.utmpx, %struct.utmpx* %0, i64 0, i32 0
%7 = load i8*, i8** %6
%8 = getelementptr inbounds %struct.utmpx, %struct.utmpx* %0, i64 0, i32 1
%9 = load i8*, i8** %8
%10 = getelementptr inbounds %struct.utmpx, %struct.utmpx* %0, i64 0, i32 2
%11 = load i8*, i8** %10
%12 = call i8* @ctime(i32* %2)
%13 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %9, i8* %11, i8* %12)
ret void
}