#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 uint32_t;
typedef int /*<<< orphan*/ time_t;
struct TYPE_2__ {
  int /*<<< orphan*/ tv_sec;
};
struct utmpx {
  int ut_type;
  int ut_pid;
  char *ut_line;
  char *ut_id;
  char *ut_user;
  char *ut_host;
  int ut_session;
  int *ut_addr_v6;
  TYPE_1__ ut_tv;
};

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ endutxent();
struct utmpx *getutxent();
int ntohl(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ setutxent();
int main(int argc, char *argv[]) {
  struct utmpx *ut;
  setutxent();
  while ((ut = getutxent()) != NULL) {
    printf("Type of the record: %-9.9s\n", (ut->ut_type == 0)   ? "EMPTY"
                                           : (ut->ut_type == 1) ? "RUN_LVL"
                                           : (ut->ut_type == 2) ? "BOOT_TIME"
                                           : (ut->ut_type == 3) ? "NEW_TIME"
                                           : (ut->ut_type = 4)  ? "OLD_TIME"
                                           : (ut->ut_type == 5) ? "INIT_PROCESS"
                                           : (ut->ut_type == 6)
                                               ? "LOGIN_PROCESS"
                                           : (ut->ut_type == 7) ? "USER_PROCESS"
                                           : (ut->ut_type == 8) ? "DEAD_PROCESS"
                                                                : "???");
    printf("Process id of the login process: %u\n", ut->ut_pid);
    printf("Terminal Device name: %s\n", ut->ut_line);
    printf("Suffix from the terminal name or id from the inittab: %s\n",
           ut->ut_id);
    printf("Username: %s\n", ut->ut_user);
    printf("Hostname for remote login or kernel version for run-level "
           "messages: %s\n",
           ut->ut_host);
    printf("Session id: %u\n", ut->ut_session);
    printf("Time: %s", ctime((time_t *)&(ut->ut_tv.tv_sec)));
    if (ut->ut_addr_v6[1] == 0 && ut->ut_addr_v6[2] == 0 &&
        ut->ut_addr_v6[3] == 0) {
      uint32_t address = ntohl(ut->ut_addr_v6[0]);
      printf("ip address: %d.%d.%d.%d\n", (address >> 24) & 0xFF,
             (address >> 16) & 0xFF, (address >> 8) & 0xFF, address & 0xFF);
    } else {
      printf("ip address: %d.%d.%d.%d\n", ut->ut_addr_v6[0], ut->ut_addr_v6[1],
             ut->ut_addr_v6[2], ut->ut_addr_v6[3]);
    }
    printf("\n\n");
  }
  endutxent();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1060 <setutxent@plt>
mov    $0x0,%al
call   1070 <getutxent@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1466 <main+0x306>
mov    -0x18(%rbp),%rax
cmpl   $0x0,(%rax)
jne    11af <main+0x4f>
lea    0xe76(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    12dd <main+0x17d>
mov    -0x18(%rbp),%rax
cmpl   $0x1,(%rax)
jne    11cc <main+0x6c>
lea    0xe5f(%rip),%rax
mov    %rax,-0x30(%rbp)
jmp    12d5 <main+0x175>
mov    -0x18(%rbp),%rax
cmpl   $0x2,(%rax)
jne    11e9 <main+0x89>
lea    0xe4a(%rip),%rax
mov    %rax,-0x38(%rbp)
jmp    12cd <main+0x16d>
mov    -0x18(%rbp),%rax
cmpl   $0x3,(%rax)
jne    1206 <main+0xa6>
lea    0xe37(%rip),%rax
mov    %rax,-0x40(%rbp)
jmp    12c5 <main+0x165>
mov    -0x18(%rbp),%rax
movl   $0x4,(%rax)
mov    $0x1,%al
test   $0x1,%al
jne    121f <main+0xbf>
jmp    122f <main+0xcf>
lea    0xe17(%rip),%rax
mov    %rax,-0x48(%rbp)
jmp    12bd <main+0x15d>
mov    -0x18(%rbp),%rax
cmpl   $0x5,(%rax)
jne    124c <main+0xec>
lea    0xe03(%rip),%rax
mov    %rax,-0x50(%rbp)
jmp    12b5 <main+0x155>
mov    -0x18(%rbp),%rax
cmpl   $0x6,(%rax)
jne    1269 <main+0x109>
lea    0xdf3(%rip),%rax
mov    %rax,-0x58(%rbp)
jmp    12ad <main+0x14d>
mov    -0x18(%rbp),%rax
cmpl   $0x7,(%rax)
jne    1286 <main+0x126>
lea    0xde4(%rip),%rax
mov    %rax,-0x60(%rbp)
jmp    12a5 <main+0x145>
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
lea    0xde8(%rip),%rax
lea    0xdd4(%rip),%rcx
cmp    $0x8,%edx
cmove  %rcx,%rax
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rsi
lea    0xd18(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%esi
lea    0xd82(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xd91(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%rsi
lea    0xd95(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rax
mov    0x18(%rax),%rsi
lea    0xdb9(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rax
mov    0x20(%rax),%rsi
lea    0xdb1(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rax
mov    0x28(%rax),%esi
lea    0xde4(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
add    $0x38,%rdi
call   1040 <ctime@plt>
mov    %rax,%rsi
lea    0xdd6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rax
mov    0x30(%rax),%rax
cmpl   $0x0,0x4(%rax)
jne    1419 <main+0x2b9>
mov    -0x18(%rbp),%rax
mov    0x30(%rax),%rax
cmpl   $0x0,0x8(%rax)
jne    1419 <main+0x2b9>
mov    -0x18(%rbp),%rax
mov    0x30(%rax),%rax
cmpl   $0x0,0xc(%rax)
jne    1419 <main+0x2b9>
mov    -0x18(%rbp),%rax
mov    0x30(%rax),%rax
mov    (%rax),%edi
call   1080 <ntohl@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
sar    $0x18,%esi
and    $0xff,%esi
mov    -0x1c(%rbp),%edx
sar    $0x10,%edx
and    $0xff,%edx
mov    -0x1c(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x1c(%rbp),%r8d
and    $0xff,%r8d
lea    0xd5a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1453 <main+0x2f3>
mov    -0x18(%rbp),%rax
mov    0x30(%rax),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    0x30(%rax),%rax
mov    0x4(%rax),%edx
mov    -0x18(%rbp),%rax
mov    0x30(%rax),%rax
mov    0x8(%rax),%ecx
mov    -0x18(%rbp),%rax
mov    0x30(%rax),%rax
mov    0xc(%rax),%r8d
lea    0xd1b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xd26(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    117d <main+0x1d>
mov    $0x0,%al
call   1030 <endutxent@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %eax,%eax
call   1070 <setutxent@plt>
xor    %eax,%eax
call   1080 <getutxent@plt>
test   %rax,%rax
je     12e6 <main+0x176>
mov    %rax,%rbx
lea    0xf31(%rip),%rbp
lea    0xf72(%rip),%r14
lea    0xf7b(%rip),%r15
lea    0xf7d(%rip),%r12
lea    0xf8d(%rip),%r13
jmp    11eb <main+0x7b>
nopw   0x0(%rax,%rax,1)
mov    (%rax),%esi
mov    0xc(%rax),%r8d
mov    %r12,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r13,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1080 <getutxent@plt>
mov    %rax,%rbx
test   %rax,%rax
je     12e6 <main+0x176>
movslq (%rbx),%rax
cmp    $0x4,%rax
jae    1210 <main+0xa0>
lea    0xf4d(%rip),%rcx
movslq (%rcx,%rax,4),%rsi
add    %rcx,%rsi
jmp    121d <main+0xad>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movl   $0x4,(%rbx)
lea    0xe20(%rip),%rsi
lea    0xddc(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x4(%rbx),%esi
lea    0xe11(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x8(%rbx),%rsi
lea    0xe24(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x10(%rbx),%rsi
lea    0xe2c(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x18(%rbx),%rsi
lea    0xe54(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x20(%rbx),%rsi
mov    %rbp,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x28(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0x38(%rbx),%rdi
call   1050 <ctime@plt>
mov    %r15,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x30(%rbx),%rax
mov    0x4(%rax),%edx
mov    0x8(%rax),%ecx
mov    %edx,%esi
or     %ecx,%esi
jne    11c0 <main+0x50>
xor    %ecx,%ecx
cmpl   $0x0,0xc(%rax)
jne    11c0 <main+0x50>
mov    (%rax),%edi
call   1090 <ntohl@plt>
mov    %eax,%edx
movzbl %ah,%ecx
movzbl %al,%r8d
shr    $0x18,%eax
shr    $0x10,%edx
movzbl %dl,%edx
mov    %r12,%rdi
mov    %eax,%esi
jmp    11c9 <main+0x59>
xor    %eax,%eax
call   1040 <endutxent@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.utmpx = type { i32, i32, i8*, i8*, i8*, i8*, i32, i32*, %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i32 }
@.str = [28 x i8] c"Type of the record: %-9.9s\0A\00"
@.str.1 = [6 x i8] c"EMPTY\00"
@.str.2 = [8 x i8] c"RUN_LVL\00"
@.str.3 = [10 x i8] c"BOOT_TIME\00"
@.str.4 = [9 x i8] c"NEW_TIME\00"
@.str.5 = [9 x i8] c"OLD_TIME\00"
@.str.6 = [13 x i8] c"INIT_PROCESS\00"
@.str.7 = [14 x i8] c"LOGIN_PROCESS\00"
@.str.8 = [13 x i8] c"USER_PROCESS\00"
@.str.9 = [13 x i8] c"DEAD_PROCESS\00"
@.str.10 = [4 x i8] c"???\00"
@.str.11 = [37 x i8] c"Process id of the login process: %u\0A\00"
@.str.12 = [26 x i8] c"Terminal Device name: %s\0A\00"
@.str.13 = [58 x i8] c"Suffix from the terminal name or id from the inittab: %s\0A\00"
@.str.14 = [14 x i8] c"Username: %s\0A\00"
@.str.15 = [72 x i8] c"Hostname for remote login or kernel version for run-level messages: %s\0A\00"
@.str.16 = [16 x i8] c"Session id: %u\0A\00"
@.str.17 = [9 x i8] c"Time: %s\00"
@.str.18 = [25 x i8] c"ip address: %d.%d.%d.%d\0A\00"
@.str.19 = [3 x i8] c"\0A\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.utmpx*
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (...) @setutxent()
br label %9
9: ; preds = %172, %2
%10 = call %struct.utmpx* (...) @getutxent()
store %struct.utmpx* %10, %struct.utmpx** %6
%11 = icmp ne %struct.utmpx* %10, null
br i1 %11, label %12, label %174
12: ; preds = %9
%13 = load %struct.utmpx*, %struct.utmpx** %6
%14 = getelementptr inbounds %struct.utmpx, %struct.utmpx* %13, i32 0, i32 0
%15 = load i32, i32* %14
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %12
br label %79
18: ; preds = %12
%19 = load %struct.utmpx*, %struct.utmpx** %6
%20 = getelementptr inbounds %struct.utmpx, %struct.utmpx* %19, i32 0, i32 0
%21 = load i32, i32* %20
%22 = icmp eq i32 %21, 1
br i1 %22, label %23, label %24
23: ; preds = %18
br label %77
24: ; preds = %18
%25 = load %struct.utmpx*, %struct.utmpx** %6
%26 = getelementptr inbounds %struct.utmpx, %struct.utmpx* %25, i32 0, i32 0
%27 = load i32, i32* %26
%28 = icmp eq i32 %27, 2
br i1 %28, label %29, label %30
29: ; preds = %24
br label %75
30: ; preds = %24
%31 = load %struct.utmpx*, %struct.utmpx** %6
%32 = getelementptr inbounds %struct.utmpx, %struct.utmpx* %31, i32 0, i32 0
%33 = load i32, i32* %32
%34 = icmp eq i32 %33, 3
br i1 %34, label %35, label %36
35: ; preds = %30
br label %73
36: ; preds = %30
%37 = load %struct.utmpx*, %struct.utmpx** %6
%38 = getelementptr inbounds %struct.utmpx, %struct.utmpx* %37, i32 0, i32 0
store i32 4, i32* %38
br i1 true, label %39, label %40
39: ; preds = %36
br label %71
40: ; preds = %36
%41 = load %struct.utmpx*, %struct.utmpx** %6
%42 = getelementptr inbounds %struct.utmpx, %struct.utmpx* %41, i32 0, i32 0
%43 = load i32, i32* %42
%44 = icmp eq i32 %43, 5
br i1 %44, label %45, label %46
45: ; preds = %40
br label %69
46: ; preds = %40
%47 = load %struct.utmpx*, %struct.utmpx** %6
%48 = getelementptr inbounds %struct.utmpx, %struct.utmpx* %47, i32 0, i32 0
%49 = load i32, i32* %48
%50 = icmp eq i32 %49, 6
br i1 %50, label %51, label %52
51: ; preds = %46
br label %67
52: ; preds = %46
%53 = load %struct.utmpx*, %struct.utmpx** %6
%54 = getelementptr inbounds %struct.utmpx, %struct.utmpx* %53, i32 0, i32 0
%55 = load i32, i32* %54
%56 = icmp eq i32 %55, 7
br i1 %56, label %57, label %58
57: ; preds = %52
br label %65
58: ; preds = %52
%59 = load %struct.utmpx*, %struct.utmpx** %6
%60 = getelementptr inbounds %struct.utmpx, %struct.utmpx* %59, i32 0, i32 0
%61 = load i32, i32* %60
%62 = icmp eq i32 %61, 8
%63 = zext i1 %62 to i64
%64 = select i1 %62, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0)
br label %65
65: ; preds = %58, %57
%66 = phi i8* [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), %57 ], [ %64, %58 ]
br label %67
67: ; preds = %65, %51
%68 = phi i8* [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), %51 ], [ %66, %65 ]
br label %69
69: ; preds = %67, %45
%70 = phi i8* [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), %45 ], [ %68, %67 ]
br label %71
71: ; preds = %69, %39
%72 = phi i8* [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), %39 ], [ %70, %69 ]
br label %73
73: ; preds = %71, %35
%74 = phi i8* [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), %35 ], [ %72, %71 ]
br label %75
75: ; preds = %73, %29
%76 = phi i8* [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), %29 ], [ %74, %73 ]
br label %77
77: ; preds = %75, %23
%78 = phi i8* [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), %23 ], [ %76, %75 ]
br label %79
79: ; preds = %77, %17
%80 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), %17 ], [ %78, %77 ]
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %80)
%82 = load %struct.utmpx*, %struct.utmpx** %6
%83 = getelementptr inbounds %struct.utmpx, %struct.utmpx* %82, i32 0, i32 1
%84 = load i32, i32* %83
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.11, i64 0, i64 0), i32 %84)
%86 = load %struct.utmpx*, %struct.utmpx** %6
%87 = getelementptr inbounds %struct.utmpx, %struct.utmpx* %86, i32 0, i32 2
%88 = load i8*, i8** %87
%89 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.12, i64 0, i64 0), i8* %88)
%90 = load %struct.utmpx*, %struct.utmpx** %6
%91 = getelementptr inbounds %struct.utmpx, %struct.utmpx* %90, i32 0, i32 3
%92 = load i8*, i8** %91
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.13, i64 0, i64 0), i8* %92)
%94 = load %struct.utmpx*, %struct.utmpx** %6
%95 = getelementptr inbounds %struct.utmpx, %struct.utmpx* %94, i32 0, i32 4
%96 = load i8*, i8** %95
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.14, i64 0, i64 0), i8* %96)
%98 = load %struct.utmpx*, %struct.utmpx** %6
%99 = getelementptr inbounds %struct.utmpx, %struct.utmpx* %98, i32 0, i32 5
%100 = load i8*, i8** %99
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.15, i64 0, i64 0), i8* %100)
%102 = load %struct.utmpx*, %struct.utmpx** %6
%103 = getelementptr inbounds %struct.utmpx, %struct.utmpx* %102, i32 0, i32 6
%104 = load i32, i32* %103
%105 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.16, i64 0, i64 0), i32 %104)
%106 = load %struct.utmpx*, %struct.utmpx** %6
%107 = getelementptr inbounds %struct.utmpx, %struct.utmpx* %106, i32 0, i32 8
%108 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %107, i32 0, i32 0
%109 = call i8* @ctime(i32* %108)
%110 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.17, i64 0, i64 0), i8* %109)
%111 = load %struct.utmpx*, %struct.utmpx** %6
%112 = getelementptr inbounds %struct.utmpx, %struct.utmpx* %111, i32 0, i32 7
%113 = load i32*, i32** %112
%114 = getelementptr inbounds i32, i32* %113, i64 1
%115 = load i32, i32* %114
%116 = icmp eq i32 %115, 0
br i1 %116, label %117, label %150
117: ; preds = %79
%118 = load %struct.utmpx*, %struct.utmpx** %6
%119 = getelementptr inbounds %struct.utmpx, %struct.utmpx* %118, i32 0, i32 7
%120 = load i32*, i32** %119
%121 = getelementptr inbounds i32, i32* %120, i64 2
%122 = load i32, i32* %121
%123 = icmp eq i32 %122, 0
br i1 %123, label %124, label %150
124: ; preds = %117
%125 = load %struct.utmpx*, %struct.utmpx** %6
%126 = getelementptr inbounds %struct.utmpx, %struct.utmpx* %125, i32 0, i32 7
%127 = load i32*, i32** %126
%128 = getelementptr inbounds i32, i32* %127, i64 3
%129 = load i32, i32* %128
%130 = icmp eq i32 %129, 0
br i1 %130, label %131, label %150
131: ; preds = %124
%132 = load %struct.utmpx*, %struct.utmpx** %6
%133 = getelementptr inbounds %struct.utmpx, %struct.utmpx* %132, i32 0, i32 7
%134 = load i32*, i32** %133
%135 = getelementptr inbounds i32, i32* %134, i64 0
%136 = load i32, i32* %135
%137 = call i32 @ntohl(i32 %136)
store i32 %137, i32* %7
%138 = load i32, i32* %7
%139 = ashr i32 %138, 24
%140 = and i32 %139, 255
%141 = load i32, i32* %7
%142 = ashr i32 %141, 16
%143 = and i32 %142, 255
%144 = load i32, i32* %7
%145 = ashr i32 %144, 8
%146 = and i32 %145, 255
%147 = load i32, i32* %7
%148 = and i32 %147, 255
%149 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.18, i64 0, i64 0), i32 %140, i32 %143, i32 %146, i32 %148)
br label %172
150: ; preds = %124, %117, %79
%151 = load %struct.utmpx*, %struct.utmpx** %6
%152 = getelementptr inbounds %struct.utmpx, %struct.utmpx* %151, i32 0, i32 7
%153 = load i32*, i32** %152
%154 = getelementptr inbounds i32, i32* %153, i64 0
%155 = load i32, i32* %154
%156 = load %struct.utmpx*, %struct.utmpx** %6
%157 = getelementptr inbounds %struct.utmpx, %struct.utmpx* %156, i32 0, i32 7
%158 = load i32*, i32** %157
%159 = getelementptr inbounds i32, i32* %158, i64 1
%160 = load i32, i32* %159
%161 = load %struct.utmpx*, %struct.utmpx** %6
%162 = getelementptr inbounds %struct.utmpx, %struct.utmpx* %161, i32 0, i32 7
%163 = load i32*, i32** %162
%164 = getelementptr inbounds i32, i32* %163, i64 2
%165 = load i32, i32* %164
%166 = load %struct.utmpx*, %struct.utmpx** %6
%167 = getelementptr inbounds %struct.utmpx, %struct.utmpx* %166, i32 0, i32 7
%168 = load i32*, i32** %167
%169 = getelementptr inbounds i32, i32* %168, i64 3
%170 = load i32, i32* %169
%171 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.18, i64 0, i64 0), i32 %155, i32 %160, i32 %165, i32 %170)
br label %172
172: ; preds = %150, %131
%173 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.19, i64 0, i64 0))
br label %9
174: ; preds = %9
%175 = call i32 (...) @endutxent()
ret i32 0
}

LLVM IR (-O2):
%struct.utmpx = type { i32, i32, i8*, i8*, i8*, i8*, i32, i32*, %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i32 }
@.str = [28 x i8] c"Type of the record: %-9.9s\0A\00"
@.str.1 = [6 x i8] c"EMPTY\00"
@.str.2 = [8 x i8] c"RUN_LVL\00"
@.str.3 = [10 x i8] c"BOOT_TIME\00"
@.str.4 = [9 x i8] c"NEW_TIME\00"
@.str.5 = [9 x i8] c"OLD_TIME\00"
@.str.11 = [37 x i8] c"Process id of the login process: %u\0A\00"
@.str.12 = [26 x i8] c"Terminal Device name: %s\0A\00"
@.str.13 = [58 x i8] c"Suffix from the terminal name or id from the inittab: %s\0A\00"
@.str.14 = [14 x i8] c"Username: %s\0A\00"
@.str.15 = [72 x i8] c"Hostname for remote login or kernel version for run-level messages: %s\0A\00"
@.str.16 = [16 x i8] c"Session id: %u\0A\00"
@.str.17 = [9 x i8] c"Time: %s\00"
@.str.18 = [25 x i8] c"ip address: %d.%d.%d.%d\0A\00"
@str = [2 x i8] c"\0A\00"
@reltable.main = [4 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.1 to i64), i64 ptrtoint ([4 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.2 to i64), i64 ptrtoint ([4 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.3 to i64), i64 ptrtoint ([4 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.4 to i64), i64 ptrtoint ([4 x i32]* @reltable.main to i64)) to i32)]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @setutxent()
%4 = tail call %struct.utmpx* (...) @getutxent()
%5 = icmp eq %struct.utmpx* %4, null
br i1 %5, label %73, label %6
6: ; preds = %2, %69
%7 = phi %struct.utmpx* [ %71, %69 ], [ %4, %2 ]
%8 = getelementptr inbounds %struct.utmpx, %struct.utmpx* %7, i64 0, i32 0
%9 = load i32, i32* %8
%10 = icmp ult i32 %9, 4
br i1 %10, label %12, label %11
11: ; preds = %6
store i32 4, i32* %8
br label %16
12: ; preds = %6
%13 = sext i32 %9 to i64
%14 = shl i64 %13, 2
%15 = call i8* @llvm.load.relative.i64(i8* bitcast ([4 x i32]* @reltable.main to i8*), i64 %14)
br label %16
16: ; preds = %12, %11
%17 = phi i8* [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), %11 ], [ %15, %12 ]
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %17)
%19 = getelementptr inbounds %struct.utmpx, %struct.utmpx* %7, i64 0, i32 1
%20 = load i32, i32* %19
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.11, i64 0, i64 0), i32 %20)
%22 = getelementptr inbounds %struct.utmpx, %struct.utmpx* %7, i64 0, i32 2
%23 = load i8*, i8** %22
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.12, i64 0, i64 0), i8* %23)
%25 = getelementptr inbounds %struct.utmpx, %struct.utmpx* %7, i64 0, i32 3
%26 = load i8*, i8** %25
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.13, i64 0, i64 0), i8* %26)
%28 = getelementptr inbounds %struct.utmpx, %struct.utmpx* %7, i64 0, i32 4
%29 = load i8*, i8** %28
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.14, i64 0, i64 0), i8* %29)
%31 = getelementptr inbounds %struct.utmpx, %struct.utmpx* %7, i64 0, i32 5
%32 = load i8*, i8** %31
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([72 x i8], [72 x i8]* @.str.15, i64 0, i64 0), i8* %32)
%34 = getelementptr inbounds %struct.utmpx, %struct.utmpx* %7, i64 0, i32 6
%35 = load i32, i32* %34
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.16, i64 0, i64 0), i32 %35)
%37 = getelementptr inbounds %struct.utmpx, %struct.utmpx* %7, i64 0, i32 8, i32 0
%38 = tail call i8* @ctime(i32* %37)
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.17, i64 0, i64 0), i8* %38)
%40 = getelementptr inbounds %struct.utmpx, %struct.utmpx* %7, i64 0, i32 7
%41 = load i32*, i32** %40
%42 = getelementptr inbounds i32, i32* %41, i64 1
%43 = load i32, i32* %42
%44 = icmp eq i32 %43, 0
%45 = getelementptr inbounds i32, i32* %41, i64 2
%46 = load i32, i32* %45
%47 = icmp eq i32 %46, 0
%48 = select i1 %44, i1 %47, i1 false
br i1 %48, label %49, label %63
49: ; preds = %16
%50 = getelementptr inbounds i32, i32* %41, i64 3
%51 = load i32, i32* %50
%52 = icmp eq i32 %51, 0
br i1 %52, label %53, label %63
53: ; preds = %49
%54 = load i32, i32* %41
%55 = tail call i32 @ntohl(i32 %54)
%56 = lshr i32 %55, 24
%57 = lshr i32 %55, 16
%58 = and i32 %57, 255
%59 = lshr i32 %55, 8
%60 = and i32 %59, 255
%61 = and i32 %55, 255
%62 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.18, i64 0, i64 0), i32 %56, i32 %58, i32 %60, i32 %61)
br label %69
63: ; preds = %16, %49
%64 = phi i32 [ 0, %49 ], [ %46, %16 ]
%65 = load i32, i32* %41
%66 = getelementptr inbounds i32, i32* %41, i64 3
%67 = load i32, i32* %66
%68 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.18, i64 0, i64 0), i32 %65, i32 %43, i32 %64, i32 %67)
br label %69
69: ; preds = %63, %53
%70 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%71 = tail call %struct.utmpx* (...) @getutxent()
%72 = icmp eq %struct.utmpx* %71, null
br i1 %72, label %73, label %6
73: ; preds = %69, %2
%74 = tail call i32 (...) @endutxent()
ret i32 0
}