#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 */
struct TYPE_2__ {
  int /*<<< orphan*/ tv_usec;
  int /*<<< orphan*/ tv_sec;
};
struct utmp {
  int /*<<< orphan*/ ut_time;
  int /*<<< orphan*/ ut_line;
  int /*<<< orphan*/ ut_user;
  TYPE_1__ ut_tv;
};
struct timeval {
  int /*<<< orphan*/ tv_usec;
  int /*<<< orphan*/ tv_sec;
};
typedef int /*<<< orphan*/ printf;

/* Variables and functions */
scalar_t__ ctime(int /*<<< orphan*/ *);
void print_entry(struct utmp *up) {
  struct timeval temp_tv;
  temp_tv.tv_sec = up->ut_tv.tv_sec;
  temp_tv.tv_usec = up->ut_tv.tv_usec;
  (printf)("[%-8.8s] [%-12.12s]"
           " [%-15.15s]"
           "\n",
           up->ut_user, up->ut_line, 4 + ctime(&up->ut_time));
}


x86 assembly (clang, -O0):
<print_entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ctime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_entry>:
jmp    1030 <ctime@plt>

LLVM IR (-O0):
%struct.utmp = type { i32, i32, i32, %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i32, i32 }
%struct.timeval = type { i32, i32 }
@.str = [32 x i8] c"[%-8.8s] [%-12.12s] [%-15.15s]\0A\00"
define void @print_entry(%struct.utmp* %0) {
%2 = alloca %struct.utmp*
%3 = alloca %struct.timeval
store %struct.utmp* %0, %struct.utmp** %2
%4 = load %struct.utmp*, %struct.utmp** %2
%5 = getelementptr inbounds %struct.utmp, %struct.utmp* %4, i32 0, i32 3
%6 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %5, i32 0, i32 1
%7 = load i32, i32* %6
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
store i32 %7, i32* %8
%9 = load %struct.utmp*, %struct.utmp** %2
%10 = getelementptr inbounds %struct.utmp, %struct.utmp* %9, i32 0, i32 3
%11 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
store i32 %12, i32* %13
%14 = load %struct.utmp*, %struct.utmp** %2
%15 = getelementptr inbounds %struct.utmp, %struct.utmp* %14, i32 0, i32 2
%16 = load i32, i32* %15
%17 = load %struct.utmp*, %struct.utmp** %2
%18 = getelementptr inbounds %struct.utmp, %struct.utmp* %17, i32 0, i32 1
%19 = load i32, i32* %18
%20 = load %struct.utmp*, %struct.utmp** %2
%21 = getelementptr inbounds %struct.utmp, %struct.utmp* %20, i32 0, i32 0
%22 = call i64 @ctime(i32* %21)
%23 = add nsw i64 4, %22
%24 = trunc i64 %23 to i32
ret void
}

LLVM IR (-O2):
%struct.utmp = type { i32, i32, i32, %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i32, i32 }
define void @print_entry(%struct.utmp* %0) {
%2 = getelementptr inbounds %struct.utmp, %struct.utmp* %0, i64 0, i32 0
%3 = tail call i64 @ctime(i32* %2)
ret void
}