#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_name;
  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 *, ...);
void show_info(struct utmp *utbufp) {
  if (utbufp->ut_type != USER_PROCESS)
    return;
  printf("% -8.8s", utbufp->ut_name);
  printf(" ");
  printf("% -8.8s", utbufp->ut_line);
  printf(" ");
  printf("%12.12s", ctime(&utbufp->ut_time));
  printf(" ");
  printf("( %s )", utbufp->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    11e0 <show_info+0xc0>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xea3(%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    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
add    $0x20,%rdi
call   1030 <ctime@plt>
mov    %rax,%rsi
lea    0xe63(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rsi
lea    0xe47(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe40(%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    11c8 <show_info+0x98>
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    0xe77(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    0x18(%rbx),%rsi
lea    0xe60(%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 = [8 x i8] c"% -8.8s\00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [8 x i8] c"%12.12s\00"
@.str.3 = [7 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 %30
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 ([8 x i8], [8 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 ([8 x i8], [8 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 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %22)
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%25 = load %struct.utmp*, %struct.utmp** %2
%26 = getelementptr inbounds %struct.utmp, %struct.utmp* %25, i32 0, i32 3
%27 = load i8*, i8** %26
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %27)
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %30
30: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
%struct.utmp = type { i64, i8*, i8*, i8*, i32 }
@USER_PROCESS = global i64 0
@.str = [8 x i8] c"% -8.8s\00"
@.str.2 = [8 x i8] c"%12.12s\00"
@.str.3 = [7 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 %23
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 ([8 x i8], [8 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 ([8 x i8], [8 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 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %16)
%18 = tail call i32 @putchar(i32 32)
%19 = getelementptr inbounds %struct.utmp, %struct.utmp* %0, i64 0, i32 3
%20 = load i8*, i8** %19
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %20)
%22 = tail call i32 @putchar(i32 10)
br label %23
23: ; preds = %1, %6
ret void
}