#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;
  int /*<<< orphan*/ ut_time;
};

/* Variables and functions */
scalar_t__ USER_PROCESS;
int /*<<< orphan*/ get_time(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
void get_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(" ");
  get_time(utbufp->ut_time);
  printf("\n");
}


x86 assembly (clang, -O0):
<get_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 <get_info+0x28>
jmp    11aa <get_info+0x8a>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rsi
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%edi
call   1040 <get_time@plt>
lea    0xe66(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_info>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%rax
mov    0x2eaa(%rip),%rcx
cmp    (%rcx),%rax
jne    1196 <get_info+0x66>
mov    %rdi,%rbx
mov    0x8(%rdi),%rsi
lea    0xeaf(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    0x10(%rbx),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    0x18(%rbx),%edi
call   1050 <get_time@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*, i32 }
@USER_PROCESS = global i64 0
@.str = [7 x i8] c"%-8.8s\00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [2 x i8] c"\0A\00"
define void @get_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 %25
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 3
%22 = load i32, i32* %21
%23 = call i32 @get_time(i32 %22)
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %25
25: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
%struct.utmp = type { i64, i8*, i8*, i32 }
@USER_PROCESS = global i64 0
@.str = [7 x i8] c"%-8.8s\00"
define void @get_info(%struct.utmp* nocapture %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 %19
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 3
%16 = load i32, i32* %15
%17 = tail call i32 @get_time(i32 %16)
%18 = tail call i32 @putchar(i32 10)
br label %19
19: ; preds = %1, %6
ret void
}