#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 utmp {
  scalar_t__ ut_type;
  char *ut_user;
  char *ut_line;
  char *ut_host;
  int /*<<< orphan*/ ut_time;
};

/* Variables and functions */
scalar_t__ USER_PROCESS;
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
extern void show_info(struct utmp *utmp_record) {
  if (utmp_record->ut_type != USER_PROCESS)
    return;
  printf("%-8.8s", utmp_record->ut_user);
  printf(" ");
  printf("%-8.8s", utmp_record->ut_line);
  printf(" ");
  printf("%12.12s", ctime(&utmp_record->ut_time) + 4);
  printf(" ");
  printf("(%s)", utmp_record->ut_host);
  printf("\n");
}


x86 assembly (clang, -O0):
<show_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x2eae(%rip),%rcx
cmp    (%rcx),%rax
je     1148 <show_info+0x28>
jmp    11e4 <show_info+0xc4>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rsi
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
add    $0x20,%rdi
call   1030 <ctime@plt>
mov    %rax,%rsi
add    $0x4,%rsi
lea    0xe5e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe4e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rsi
lea    0xe42(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe39(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_info>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%rax
mov    0x2eaa(%rip),%rcx
cmp    (%rcx),%rax
jne    11c9 <show_info+0x99>
mov    %rdi,%rbx
mov    0x8(%rdi),%rsi
lea    0xeab(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    0x10(%rbx),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
lea    0x20(%rbx),%rdi
call   1040 <ctime@plt>
lea    0x4(%rax),%rsi
lea    0xe72(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    0x18(%rbx),%rsi
lea    0xe5e(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.utmp = type { i64, i8*, i8*, i8*, i32 }
@USER_PROCESS = global i64 0
@.str = [7 x i8] c"%-8.8s\00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [8 x i8] c"%12.12s\00"
@.str.3 = [5 x i8] c"(%s)\00"
@.str.4 = [2 x i8] c"\0A\00"
define void @show_info(%struct.utmp* %0) {
%2 = alloca %struct.utmp*
store %struct.utmp* %0, %struct.utmp** %2
%3 = load %struct.utmp*, %struct.utmp** %2
%4 = getelementptr inbounds %struct.utmp, %struct.utmp* %3, i32 0, i32 0
%5 = load i64, i64* %4
%6 = load i64, i64* @USER_PROCESS
%7 = icmp ne i64 %5, %6
br i1 %7, label %8, label %9
8: ; preds = %1
br label %31
9: ; preds = %1
%10 = load %struct.utmp*, %struct.utmp** %2
%11 = getelementptr inbounds %struct.utmp, %struct.utmp* %10, i32 0, i32 1
%12 = load i8*, i8** %11
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%15 = load %struct.utmp*, %struct.utmp** %2
%16 = getelementptr inbounds %struct.utmp, %struct.utmp* %15, i32 0, i32 2
%17 = load i8*, i8** %16
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %17)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%20 = load %struct.utmp*, %struct.utmp** %2
%21 = getelementptr inbounds %struct.utmp, %struct.utmp* %20, i32 0, i32 4
%22 = call i8* @ctime(i32* %21)
%23 = getelementptr inbounds i8, i8* %22, i64 4
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %23)
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%26 = load %struct.utmp*, %struct.utmp** %2
%27 = getelementptr inbounds %struct.utmp, %struct.utmp* %26, i32 0, i32 3
%28 = load i8*, i8** %27
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %28)
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %31
31: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
%struct.utmp = type { i64, i8*, i8*, i8*, i32 }
@USER_PROCESS = global i64 0
@.str = [7 x i8] c"%-8.8s\00"
@.str.2 = [8 x i8] c"%12.12s\00"
@.str.3 = [5 x i8] c"(%s)\00"
define void @show_info(%struct.utmp* %0) {
%2 = getelementptr inbounds %struct.utmp, %struct.utmp* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = load i64, i64* @USER_PROCESS
%5 = icmp eq i64 %3, %4
br i1 %5, label %6, label %24
6: ; preds = %1
%7 = getelementptr inbounds %struct.utmp, %struct.utmp* %0, i64 0, i32 1
%8 = load i8*, i8** %7
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = tail call i32 @putchar(i32 32)
%11 = getelementptr inbounds %struct.utmp, %struct.utmp* %0, i64 0, i32 2
%12 = load i8*, i8** %11
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = tail call i32 @putchar(i32 32)
%15 = getelementptr inbounds %struct.utmp, %struct.utmp* %0, i64 0, i32 4
%16 = tail call i8* @ctime(i32* %15)
%17 = getelementptr inbounds i8, i8* %16, i64 4
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %17)
%19 = tail call i32 @putchar(i32 32)
%20 = getelementptr inbounds %struct.utmp, %struct.utmp* %0, i64 0, i32 3
%21 = load i8*, i8** %20
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %21)
%23 = tail call i32 @putchar(i32 10)
br label %24
24: ; preds = %1, %6
ret void
}