#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 */

/* Variables and functions */
int /*<<< orphan*/ MAP_SHARED;
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ O_RDWR;
int PROT_READ;
int PROT_WRITE;
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
unsigned long htonl(int /*<<< orphan*/);
int /*<<< orphan*/ inet_addr(char *);
long lseek(int, int /*<<< orphan*/, int /*<<< orphan*/);
unsigned int *mmap(int /*<<< orphan*/, long, int, int /*<<< orphan*/, int,
                   int /*<<< orphan*/);
int /*<<< orphan*/ munmap(unsigned int *, long);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, long, unsigned int, ...);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  unsigned *usage_stats;
  unsigned long base, j;
  long need, ips, i;
  int fd, reset;
  reset = 0;
  if (argc >= 2) {
    if (strcmp(argv[1], "-r") == 0) {
      reset = 1;
      argv++;
      argc--;
    }
  }
  if (argc < 2 || argc > 3) {
    fprintf(stderr, "Usage: %s [-r] scoreboard base\n", argv[0]);
    exit(0);
  }
  if (argc == 3)
    base = htonl(inet_addr(argv[2]));
  else
    base = 0;
  fd = open(argv[1], reset ? O_RDWR : O_RDONLY);
  if (fd == -1) {
    perror("open");
    exit(1);
  }
  need = lseek(fd, 0, SEEK_END);
  if (need == 0) {
    fprintf(stderr, "%s is not in-use\n", argv[1]);
    exit(1);
  }
  usage_stats =
      mmap(0, need, (reset ? PROT_WRITE : 0) | PROT_READ, MAP_SHARED, fd, 0);
  if (!usage_stats) {
    perror("mmap");
    exit(1);
  }
  ips = need / sizeof(unsigned);
  for (i = 0; i < ips; i++) {
    if (usage_stats[i] == 0)
      continue;
    if (base) {
      j = base + i;
      printf("%d.%d.%d.%d\t%u\n", (int)(((unsigned char *)&j)[3]),
             (int)(((unsigned char *)&j)[2]), (int)(((unsigned char *)&j)[1]),
             (int)(((unsigned char *)&j)[0]), usage_stats[i]);
    } else {
      printf("%ld\t%u\n", i, usage_stats[i]);
    }
    if (reset)
      usage_stats[i] = 0;
  }
  munmap(usage_stats, need);
  close(fd);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x48(%rbp)
cmpl   $0x2,-0x8(%rbp)
jl     1226 <main+0x66>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe0a(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    1221 <main+0x61>
movl   $0x1,-0x48(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1226 <main+0x66>
cmpl   $0x2,-0x8(%rbp)
jl     123a <main+0x7a>
cmpl   $0x3,-0x8(%rbp)
jle    125d <main+0x9d>
mov    0x2d77(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xdb2(%rip),%rsi
call   10a0 <fprintf@plt>
xor    %edi,%edi
call   10e0 <exit@plt>
cmpl   $0x3,-0x8(%rbp)
jne    1284 <main+0xc4>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1080 <inet_addr@plt>
mov    %eax,%edi
call   1060 <htonl@plt>
mov    %rax,-0x20(%rbp)
jmp    128c <main+0xcc>
movq   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x50(%rbp)
cmpl   $0x0,-0x48(%rbp)
je     12b3 <main+0xf3>
mov    0x2d2f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x54(%rbp)
jmp    12bf <main+0xff>
mov    0x2d0e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x54(%rbp)
mov    -0x50(%rbp),%rdi
mov    -0x54(%rbp),%esi
call   10c0 <open@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0xffffffff,-0x44(%rbp)
jne    12ee <main+0x12e>
lea    0xd44(%rip),%rdi
call   10d0 <perror@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    -0x44(%rbp),%edi
mov    0x2cd8(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1050 <lseek@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    1337 <main+0x177>
mov    0x2ca1(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xd00(%rip),%rsi
call   10a0 <fprintf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    -0x30(%rbp),%rax
mov    %rax,-0x60(%rbp)
cmpl   $0x0,-0x48(%rbp)
je     135a <main+0x19a>
mov    0x2c60(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x64(%rbp)
jmp    1364 <main+0x1a4>
xor    %eax,%eax
mov    %eax,-0x64(%rbp)
jmp    1364 <main+0x1a4>
mov    -0x60(%rbp),%rsi
mov    -0x64(%rbp),%edx
mov    0x2c86(%rip),%rax
or     (%rax),%edx
mov    0x2c6d(%rip),%rax
mov    (%rax),%ecx
mov    -0x44(%rbp),%r8d
xor    %r9d,%r9d
mov    %r9d,%edi
call   1030 <mmap@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    13b1 <main+0x1f1>
lea    0xc98(%rip),%rdi
call   10d0 <perror@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    -0x30(%rbp),%rax
shr    $0x2,%rax
mov    %rax,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%rax
cmp    -0x38(%rbp),%rax
jge    1480 <main+0x2c0>
mov    -0x18(%rbp),%rax
mov    -0x40(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    13ea <main+0x22a>
jmp    146f <main+0x2af>
cmpq   $0x0,-0x20(%rbp)
je     1434 <main+0x274>
mov    -0x20(%rbp),%rax
add    -0x40(%rbp),%rax
mov    %rax,-0x28(%rbp)
movzbl -0x25(%rbp),%eax
movslq %eax,%rsi
movzbl -0x26(%rbp),%edx
movzbl -0x27(%rbp),%ecx
movzbl -0x28(%rbp),%r8d
mov    -0x18(%rbp),%rax
mov    -0x40(%rbp),%rdi
mov    (%rax,%rdi,4),%r9d
lea    0xc17(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1451 <main+0x291>
mov    -0x40(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    -0x40(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xc05(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x0,-0x48(%rbp)
je     146a <main+0x2aa>
mov    -0x18(%rbp),%rax
mov    -0x40(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
jmp    146f <main+0x2af>
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    13c5 <main+0x205>
mov    -0x18(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   10b0 <munmap@plt>
mov    -0x44(%rbp),%edi
call   1070 <close@plt>
xor    %edi,%edi
call   10e0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbp
mov    %edi,%ebx
mov    $0x1,%r14b
cmp    $0x2,%edi
jl     11fa <main+0x3a>
mov    0x8(%rbp),%rdi
lea    0xe1a(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
jne    11fa <main+0x3a>
add    $0x8,%rbp
add    $0xffffffff,%ebx
xor    %r14d,%r14d
lea    -0x4(%rbx),%eax
cmp    $0xfffffffd,%eax
ja     1222 <main+0x62>
mov    0x2daf(%rip),%rax
mov    (%rax),%edi
mov    0x0(%rbp),%rdx
lea    0xded(%rip),%rsi
call   10a0 <fprintf@plt>
xor    %edi,%edi
call   10e0 <exit@plt>
cmp    $0x3,%ebx
jne    123c <main+0x7c>
mov    0x10(%rbp),%rdi
call   1080 <inet_addr@plt>
mov    %eax,%edi
call   1060 <htonl@plt>
mov    %rax,%rbx
jmp    123e <main+0x7e>
xor    %ebx,%ebx
mov    0x8(%rbp),%rdi
test   %r14b,%r14b
je     1250 <main+0x90>
mov    0x2d7a(%rip),%rax
jmp    1257 <main+0x97>
mov    0x2d81(%rip),%rax
mov    (%rax),%esi
call   10c0 <open@plt>
cmp    $0xffffffff,%eax
jne    126f <main+0xaf>
lea    0xdb9(%rip),%rdi
jmp    12f4 <main+0x134>
mov    %eax,%r12d
mov    0x2d57(%rip),%rax
mov    (%rax),%edx
xor    %r15d,%r15d
mov    %r12d,%edi
xor    %esi,%esi
call   1050 <lseek@plt>
test   %rax,%rax
jne    12b0 <main+0xf0>
mov    0x2d24(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rbp),%rdx
lea    0xd87(%rip),%rsi
call   10a0 <fprintf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    %rax,%r13
test   %r14b,%r14b
jne    12c2 <main+0x102>
mov    0x2cf1(%rip),%rax
mov    (%rax),%r15d
mov    0x2d2f(%rip),%rax
or     (%rax),%r15d
mov    0x2d15(%rip),%rax
mov    (%rax),%ecx
xor    %edi,%edi
mov    %r13,%rsi
mov    %r15d,%edx
mov    %r12d,%r8d
xor    %r9d,%r9d
call   1030 <mmap@plt>
test   %rax,%rax
jne    1303 <main+0x143>
lea    0xd46(%rip),%rdi
call   10d0 <perror@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    %rax,%rbp
mov    %r12d,0xc(%rsp)
mov    %r13,0x10(%rsp)
cmp    $0x4,%r13
jae    1333 <main+0x173>
mov    %rbp,%rdi
mov    0x10(%rsp),%rsi
call   10b0 <munmap@plt>
mov    0xc(%rsp),%edi
call   1070 <close@plt>
xor    %edi,%edi
call   10e0 <exit@plt>
mov    0x10(%rsp),%r12
shr    $0x2,%r12
lea    0xcfc(%rip),%r13
xor    %r15d,%r15d
jmp    1359 <main+0x199>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r15
cmp    %r15,%r12
je     1316 <main+0x156>
mov    0x0(%rbp,%r15,4),%r9d
test   %r9d,%r9d
je     1350 <main+0x190>
test   %rbx,%rbx
je     1390 <main+0x1d0>
lea    (%rbx,%r15,1),%eax
mov    %eax,%esi
movzbl %ah,%ecx
movzbl %al,%r8d
shr    $0x10,%eax
shr    $0x18,%esi
movzbl %al,%edx
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %r14b,%r14b
jne    1350 <main+0x190>
jmp    13a9 <main+0x1e9>
nop
lea    0xcb8(%rip),%rdi
mov    %r15,%rsi
mov    %r9d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
test   %r14b,%r14b
jne    1350 <main+0x190>
movl   $0x0,0x0(%rbp,%r15,4)
jmp    1350 <main+0x190>

LLVM IR (-O0):
@.str = [3 x i8] c"-r\00"
@stderr = global i32 0
@.str.1 = [32 x i8] c"Usage: %s [-r] scoreboard base\0A\00"
@O_RDWR = global i32 0
@O_RDONLY = global i32 0
@.str.2 = [5 x i8] c"open\00"
@SEEK_END = global i32 0
@.str.3 = [18 x i8] c"%s is not in-use\0A\00"
@PROT_WRITE = global i32 0
@PROT_READ = global i32 0
@MAP_SHARED = global i32 0
@.str.4 = [5 x i8] c"mmap\00"
@.str.5 = [16 x i8] c"%d.%d.%d.%d\09%u\0A\00"
@.str.6 = [8 x i8] c"%ld\09%u\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i32
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %13
%14 = load i32, i32* %4
%15 = icmp sge i32 %14, 2
br i1 %15, label %16, label %28
16: ; preds = %2
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = call i64 @strcmp(i8* %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %27
22: ; preds = %16
store i32 1, i32* %13
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i32 1
store i8** %24, i8*** %5
%25 = load i32, i32* %4
%26 = add nsw i32 %25, -1
store i32 %26, i32* %4
br label %27
27: ; preds = %22, %16
br label %28
28: ; preds = %27, %2
%29 = load i32, i32* %4
%30 = icmp slt i32 %29, 2
br i1 %30, label %34, label %31
31: ; preds = %28
%32 = load i32, i32* %4
%33 = icmp sgt i32 %32, 3
br i1 %33, label %34, label %41
34: ; preds = %31, %28
%35 = load i32, i32* @stderr
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 0
%38 = load i8*, i8** %37
%39 = call i32 @fprintf(i32 %35, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8* %38)
%40 = call i32 @exit(i32 0)
unreachable
41: ; preds = %31
%42 = load i32, i32* %4
%43 = icmp eq i32 %42, 3
br i1 %43, label %44, label %50
44: ; preds = %41
%45 = load i8**, i8*** %5
%46 = getelementptr inbounds i8*, i8** %45, i64 2
%47 = load i8*, i8** %46
%48 = call i32 @inet_addr(i8* %47)
%49 = call i64 @htonl(i32 %48)
store i64 %49, i64* %7
br label %51
50: ; preds = %41
store i64 0, i64* %7
br label %51
51: ; preds = %50, %44
%52 = load i8**, i8*** %5
%53 = getelementptr inbounds i8*, i8** %52, i64 1
%54 = load i8*, i8** %53
%55 = load i32, i32* %13
%56 = icmp ne i32 %55, 0
br i1 %56, label %57, label %59
57: ; preds = %51
%58 = load i32, i32* @O_RDWR
br label %61
59: ; preds = %51
%60 = load i32, i32* @O_RDONLY
br label %61
61: ; preds = %59, %57
%62 = phi i32 [ %58, %57 ], [ %60, %59 ]
%63 = call i32 @open(i8* %54, i32 %62)
store i32 %63, i32* %12
%64 = load i32, i32* %12
%65 = icmp eq i32 %64, -1
br i1 %65, label %66, label %69
66: ; preds = %61
%67 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%68 = call i32 @exit(i32 1)
unreachable
69: ; preds = %61
%70 = load i32, i32* %12
%71 = load i32, i32* @SEEK_END
%72 = call i64 @lseek(i32 %70, i32 0, i32 %71)
store i64 %72, i64* %9
%73 = load i64, i64* %9
%74 = icmp eq i64 %73, 0
br i1 %74, label %75, label %82
75: ; preds = %69
%76 = load i32, i32* @stderr
%77 = load i8**, i8*** %5
%78 = getelementptr inbounds i8*, i8** %77, i64 1
%79 = load i8*, i8** %78
%80 = call i32 @fprintf(i32 %76, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* %79)
%81 = call i32 @exit(i32 1)
unreachable
82: ; preds = %69
%83 = load i64, i64* %9
%84 = load i32, i32* %13
%85 = icmp ne i32 %84, 0
br i1 %85, label %86, label %88
86: ; preds = %82
%87 = load i32, i32* @PROT_WRITE
br label %89
88: ; preds = %82
br label %89
89: ; preds = %88, %86
%90 = phi i32 [ %87, %86 ], [ 0, %88 ]
%91 = load i32, i32* @PROT_READ
%92 = or i32 %90, %91
%93 = load i32, i32* @MAP_SHARED
%94 = load i32, i32* %12
%95 = call i32* @mmap(i32 0, i64 %83, i32 %92, i32 %93, i32 %94, i32 0)
store i32* %95, i32** %6
%96 = load i32*, i32** %6
%97 = icmp ne i32* %96, null
br i1 %97, label %101, label %98
98: ; preds = %89
%99 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%100 = call i32 @exit(i32 1)
unreachable
101: ; preds = %89
%102 = load i64, i64* %9
%103 = udiv i64 %102, 4
store i64 %103, i64* %10
store i64 0, i64* %11
br label %104
104: ; preds = %159, %101
%105 = load i64, i64* %11
%106 = load i64, i64* %10
%107 = icmp slt i64 %105, %106
br i1 %107, label %108, label %162
108: ; preds = %104
%109 = load i32*, i32** %6
%110 = load i64, i64* %11
%111 = getelementptr inbounds i32, i32* %109, i64 %110
%112 = load i32, i32* %111
%113 = icmp eq i32 %112, 0
br i1 %113, label %114, label %115
114: ; preds = %108
br label %159
115: ; preds = %108
%116 = load i64, i64* %7
%117 = icmp ne i64 %116, 0
br i1 %117, label %118, label %144
118: ; preds = %115
%119 = load i64, i64* %7
%120 = load i64, i64* %11
%121 = add i64 %119, %120
store i64 %121, i64* %8
%122 = bitcast i64* %8 to i8*
%123 = getelementptr inbounds i8, i8* %122, i64 3
%124 = load i8, i8* %123
%125 = zext i8 %124 to i32
%126 = sext i32 %125 to i64
%127 = bitcast i64* %8 to i8*
%128 = getelementptr inbounds i8, i8* %127, i64 2
%129 = load i8, i8* %128
%130 = zext i8 %129 to i32
%131 = bitcast i64* %8 to i8*
%132 = getelementptr inbounds i8, i8* %131, i64 1
%133 = load i8, i8* %132
%134 = zext i8 %133 to i32
%135 = bitcast i64* %8 to i8*
%136 = getelementptr inbounds i8, i8* %135, i64 0
%137 = load i8, i8* %136
%138 = zext i8 %137 to i32
%139 = load i32*, i32** %6
%140 = load i64, i64* %11
%141 = getelementptr inbounds i32, i32* %139, i64 %140
%142 = load i32, i32* %141
%143 = call i32 (i8*, i64, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i64 %126, i32 %130, i32 %134, i32 %138, i32 %142)
br label %151
144: ; preds = %115
%145 = load i64, i64* %11
%146 = load i32*, i32** %6
%147 = load i64, i64* %11
%148 = getelementptr inbounds i32, i32* %146, i64 %147
%149 = load i32, i32* %148
%150 = call i32 (i8*, i64, i32, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i64 %145, i32 %149)
br label %151
151: ; preds = %144, %118
%152 = load i32, i32* %13
%153 = icmp ne i32 %152, 0
br i1 %153, label %154, label %158
154: ; preds = %151
%155 = load i32*, i32** %6
%156 = load i64, i64* %11
%157 = getelementptr inbounds i32, i32* %155, i64 %156
store i32 0, i32* %157
br label %158
158: ; preds = %154, %151
br label %159
159: ; preds = %158, %114
%160 = load i64, i64* %11
%161 = add nsw i64 %160, 1
store i64 %161, i64* %11
br label %104
162: ; preds = %104
%163 = load i32*, i32** %6
%164 = load i64, i64* %9
%165 = call i32 @munmap(i32* %163, i64 %164)
%166 = load i32, i32* %12
%167 = call i32 @close(i32 %166)
%168 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [3 x i8] c"-r\00"
@stderr = global i32 0
@.str.1 = [32 x i8] c"Usage: %s [-r] scoreboard base\0A\00"
@O_RDWR = global i32 0
@O_RDONLY = global i32 0
@.str.2 = [5 x i8] c"open\00"
@SEEK_END = global i32 0
@.str.3 = [18 x i8] c"%s is not in-use\0A\00"
@PROT_WRITE = global i32 0
@PROT_READ = global i32 0
@MAP_SHARED = global i32 0
@.str.4 = [5 x i8] c"mmap\00"
@.str.5 = [16 x i8] c"%d.%d.%d.%d\09%u\0A\00"
@.str.6 = [8 x i8] c"%ld\09%u\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nsw i32 %0, -1
br label %11
11: ; preds = %4, %9, %2
%12 = phi i8** [ %5, %9 ], [ %1, %4 ], [ %1, %2 ]
%13 = phi i32 [ %10, %9 ], [ %0, %4 ], [ %0, %2 ]
%14 = phi i1 [ false, %9 ], [ true, %4 ], [ true, %2 ]
%15 = add i32 %13, -4
%16 = icmp ult i32 %15, -2
br i1 %16, label %17, label %22
17: ; preds = %11
%18 = load i32, i32* @stderr
%19 = load i8*, i8** %12
%20 = tail call i32 @fprintf(i32 %18, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8* %19)
%21 = tail call i32 @exit(i32 0)
unreachable
22: ; preds = %11
%23 = icmp eq i32 %13, 3
br i1 %23, label %24, label %29
24: ; preds = %22
%25 = getelementptr inbounds i8*, i8** %12, i64 2
%26 = load i8*, i8** %25
%27 = tail call i32 @inet_addr(i8* %26)
%28 = tail call i64 @htonl(i32 %27)
br label %29
29: ; preds = %22, %24
%30 = phi i64 [ %28, %24 ], [ 0, %22 ]
%31 = getelementptr inbounds i8*, i8** %12, i64 1
%32 = load i8*, i8** %31
%33 = load i32, i32* @O_RDWR
%34 = load i32, i32* @O_RDONLY
%35 = select i1 %14, i32 %34, i32 %33
%36 = tail call i32 @open(i8* %32, i32 %35)
%37 = icmp eq i32 %36, -1
br i1 %37, label %38, label %41
38: ; preds = %29
%39 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%40 = tail call i32 @exit(i32 1)
unreachable
41: ; preds = %29
%42 = load i32, i32* @SEEK_END
%43 = tail call i64 @lseek(i32 %36, i32 0, i32 %42)
%44 = icmp eq i64 %43, 0
br i1 %44, label %45, label %50
45: ; preds = %41
%46 = load i32, i32* @stderr
%47 = load i8*, i8** %31
%48 = tail call i32 @fprintf(i32 %46, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* %47)
%49 = tail call i32 @exit(i32 1)
unreachable
50: ; preds = %41
%51 = load i32, i32* @PROT_WRITE
%52 = select i1 %14, i32 0, i32 %51
%53 = load i32, i32* @PROT_READ
%54 = or i32 %52, %53
%55 = load i32, i32* @MAP_SHARED
%56 = tail call i32* @mmap(i32 0, i64 %43, i32 %54, i32 %55, i32 %36, i32 0)
%57 = icmp eq i32* %56, null
br i1 %57, label %58, label %61
58: ; preds = %50
%59 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%60 = tail call i32 @exit(i32 1)
unreachable
61: ; preds = %50
%62 = icmp ult i64 %43, 4
br i1 %62, label %90, label %63
63: ; preds = %61
%64 = lshr i64 %43, 2
%65 = icmp eq i64 %30, 0
br label %66
66: ; preds = %63, %87
%67 = phi i64 [ 0, %63 ], [ %88, %87 ]
%68 = getelementptr inbounds i32, i32* %56, i64 %67
%69 = load i32, i32* %68
%70 = icmp eq i32 %69, 0
br i1 %70, label %87, label %71
71: ; preds = %66
br i1 %65, label %83, label %72
72: ; preds = %71
%73 = add i64 %67, %30
%74 = trunc i64 %73 to i32
%75 = lshr i32 %74, 8
%76 = lshr i32 %74, 16
%77 = lshr i64 %73, 24
%78 = and i64 %77, 255
%79 = and i32 %76, 255
%80 = and i32 %75, 255
%81 = and i32 %74, 255
%82 = tail call i32 (i8*, i64, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i64 %78, i32 %79, i32 %80, i32 %81, i32 %69)
br label %85
83: ; preds = %71
%84 = tail call i32 (i8*, i64, i32, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i64 %67, i32 %69)
br label %85
85: ; preds = %83, %72
br i1 %14, label %87, label %86
86: ; preds = %85
store i32 0, i32* %68
br label %87
87: ; preds = %85, %86, %66
%88 = add nuw nsw i64 %67, 1
%89 = icmp eq i64 %88, %64
br i1 %89, label %90, label %66
90: ; preds = %87, %61
%91 = tail call i32 @munmap(i32* %56, i64 %43)
%92 = tail call i32 @close(i32 %36)
%93 = tail call i32 @exit(i32 0)
unreachable
}