#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 */
char *MAP_FAILED;
int /*<<< orphan*/ MAP_SHARED;
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ PROT_READ;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
scalar_t__ lseek64(int, unsigned long, int /*<<< orphan*/);
char *mmap(int /*<<< orphan*/ *, int, int /*<<< orphan*/, int /*<<< orphan*/,
           int, unsigned long);
int /*<<< orphan*/ munmap(char *, int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
unsigned long str_to_ul(char *);
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char **argv) {
  int i, n, fd;
  unsigned long offset, len;
  unsigned char buf[16];
  if (argc < 3) {
    fprintf(stderr, "Usage: %s [-k] (offset) (length)\n", argv[0]);
    return 1;
  }
  if (!strcmp(argv[1], "-k")) {
    offset = str_to_ul(argv[2]);
    len = str_to_ul(argv[3]);
    fd = open("/dev/kmem", O_RDONLY);
  } else {
    offset = str_to_ul(argv[1]);
    len = str_to_ul(argv[2]);
    fd = open("/dev/mem", O_RDONLY);
  }
  if (fd == -1) {
    perror("open");
    return 1;
  }
  if (lseek64(fd, offset, SEEK_SET) < 0) {
    perror("lseek");
    return 1;
  }
  printf("Dump Offset : %016lx, Dump Length: %016lx\n", offset, len);
  printf("(Address)-------  "
         "+0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +a +b +c +d +e +f\n");
  while (len > 0) {
    char *p;
    printf("%016lx: ", offset);
    p = mmap(NULL, 4096, PROT_READ, MAP_SHARED, fd, offset);
    if (p == MAP_FAILED) {
      perror("mmap");
      return 1;
    }
    n = 4096;
    if (n > len) {
      n = len;
    }
    for (i = 0; i < n; i++) {
      printf("%02x ", p[i]);
    }
    printf("\n");
    munmap(p, 4096);
    len -= n;
    offset += n;
  }
  close(fd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    11e8 <main+0x48>
mov    0x2e01(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe29(%rip),%rsi
call   1080 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1412 <main+0x272>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe2b(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    1244 <main+0xa4>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1030 <str_to_ul@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1030 <str_to_ul@plt>
mov    %rax,-0x30(%rbp)
mov    0x2daa(%rip),%rax
mov    (%rax),%esi
lea    0xdee(%rip),%rdi
call   10a0 <open@plt>
mov    %eax,-0x1c(%rbp)
jmp    127e <main+0xde>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <str_to_ul@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1030 <str_to_ul@plt>
mov    %rax,-0x30(%rbp)
mov    0x2d6b(%rip),%rax
mov    (%rax),%esi
lea    0xdb9(%rip),%rdi
call   10a0 <open@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
jne    12a0 <main+0x100>
lea    0xda9(%rip),%rdi
call   10b0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1412 <main+0x272>
mov    -0x1c(%rbp),%edi
mov    -0x28(%rbp),%rsi
mov    0x2d12(%rip),%rax
mov    (%rax),%edx
call   10c0 <lseek64@plt>
cmp    $0x0,%rax
jge    12d7 <main+0x137>
lea    0xd77(%rip),%rdi
call   10b0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1412 <main+0x272>
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
lea    0xd5d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xd7a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
cmpq   $0x0,-0x30(%rbp)
jbe    1403 <main+0x263>
mov    -0x28(%rbp),%rsi
lea    0xda0(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2cd9(%rip),%rax
mov    (%rax),%edx
mov    0x2cc0(%rip),%rax
mov    (%rax),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x28(%rbp),%r9
xor    %eax,%eax
mov    %eax,%edi
mov    $0x1000,%esi
call   1040 <mmap@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
mov    0x2c69(%rip),%rcx
cmp    (%rcx),%rax
jne    1370 <main+0x1d0>
lea    0xd5b(%rip),%rdi
call   10b0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1412 <main+0x272>
movl   $0x1000,-0x18(%rbp)
movslq -0x18(%rbp),%rax
cmp    -0x30(%rbp),%rax
jbe    138c <main+0x1ec>
mov    -0x30(%rbp),%rax
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    13c7 <main+0x227>
mov    -0x48(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xd0d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1393 <main+0x1f3>
lea    0xc52(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x48(%rbp),%rdi
mov    $0x1000,%esi
call   1090 <munmap@plt>
movslq -0x18(%rbp),%rcx
mov    -0x30(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x30(%rbp)
movslq -0x18(%rbp),%rax
add    -0x28(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    12fb <main+0x15b>
mov    -0x1c(%rbp),%edi
call   1060 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
cmp    $0x2,%edi
jg     11f5 <main+0x35>
mov    0x2dee(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xe1a(%rip),%rsi
call   10a0 <fprintf@plt>
mov    $0x1,%eax
jmp    136a <main+0x1aa>
mov    0x8(%rbx),%rbp
lea    0xe22(%rip),%rsi
mov    %rbp,%rdi
call   1090 <strcmp@plt>
test   %eax,%eax
je     121b <main+0x5b>
lea    0xe1c(%rip),%r15
mov    $0x2,%r12d
jmp    122c <main+0x6c>
mov    0x10(%rbx),%rbp
lea    0xdff(%rip),%r15
mov    $0x3,%r12d
mov    %rbp,%rdi
call   1040 <str_to_ul@plt>
mov    %rax,%r14
mov    (%rbx,%r12,8),%rdi
call   1040 <str_to_ul@plt>
mov    %rax,%rbx
mov    0x2d8e(%rip),%rax
mov    (%rax),%esi
mov    %r15,%rdi
call   10c0 <open@plt>
cmp    $0xffffffff,%eax
je     1379 <main+0x1b9>
mov    %eax,%r12d
mov    0x2d59(%rip),%rax
mov    (%rax),%edx
mov    %r12d,%edi
mov    %r14,%rsi
call   10e0 <lseek64@plt>
test   %rax,%rax
js     1382 <main+0x1c2>
lea    0xdbf(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xdea(%rip),%rdi
call   1050 <puts@plt>
test   %rbx,%rbx
je     1360 <main+0x1a0>
lea    0xdcf(%rip),%rbp
mov    %r12d,0x4(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0xda7(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x2d20(%rip),%rax
mov    (%rax),%edx
mov    0x2d07(%rip),%rax
mov    (%rax),%ecx
xor    %edi,%edi
mov    $0x1000,%esi
mov    %r12d,%r8d
mov    %r14,%r9
call   1060 <mmap@plt>
mov    %rax,%r15
mov    0x2cb9(%rip),%rax
cmp    (%rax),%r15
je     138b <main+0x1cb>
cmp    $0x1000,%rbx
mov    $0x1000,%r12d
cmovb  %rbx,%r12
xor    %r13d,%r13d
nopl   0x0(%rax)
movsbl (%r15,%r13,1),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
add    $0x1,%r13
cmp    %r13,%r12
jne    1320 <main+0x160>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r15,%rdi
mov    $0x1000,%esi
call   10b0 <munmap@plt>
add    %r12,%r14
sub    %r12,%rbx
mov    0x4(%rsp),%r12d
jne    12c0 <main+0x100>
mov    %r12d,%edi
call   1080 <close@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xcb8(%rip),%rdi
jmp    1392 <main+0x1d2>
lea    0xcb4(%rip),%rdi
jmp    1392 <main+0x1d2>
lea    0xce5(%rip),%rdi
call   10d0 <perror@plt>
mov    $0x1,%eax
jmp    136a <main+0x1aa>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"Usage: %s [-k] (offset) (length)\0A\00"
@.str.1 = [3 x i8] c"-k\00"
@.str.2 = [10 x i8] c"/dev/kmem\00"
@O_RDONLY = global i32 0
@.str.3 = [9 x i8] c"/dev/mem\00"
@.str.4 = [5 x i8] c"open\00"
@SEEK_SET = global i32 0
@.str.5 = [6 x i8] c"lseek\00"
@.str.6 = [43 x i8] c"Dump Offset : %016lx, Dump Length: %016lx\0A\00"
@.str.7 = [67 x i8] c"(Address)------- +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +a +b +c +d +e +f\0A\00"
@.str.8 = [9 x i8] c"%016lx: \00"
@PROT_READ = global i32 0
@MAP_SHARED = global i32 0
@MAP_FAILED = global i8* null
@.str.9 = [5 x i8] c"mmap\00"
@.str.10 = [6 x i8] c"%02x \00"
@.str.11 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i64
%10 = alloca i64
%11 = alloca [16 x i8]
%12 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = load i32, i32* %4
%14 = icmp slt i32 %13, 3
br i1 %14, label %15, label %21
15: ; preds = %2
%16 = load i32, i32* @stderr
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 0
%19 = load i8*, i8** %18
%20 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %19)
store i32 1, i32* %3
br label %122
21: ; preds = %2
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
%25 = call i32 @strcmp(i8* %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%26 = icmp ne i32 %25, 0
br i1 %26, label %38, label %27
27: ; preds = %21
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 2
%30 = load i8*, i8** %29
%31 = call i64 @str_to_ul(i8* %30)
store i64 %31, i64* %9
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 3
%34 = load i8*, i8** %33
%35 = call i64 @str_to_ul(i8* %34)
store i64 %35, i64* %10
%36 = load i32, i32* @O_RDONLY
%37 = call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %36)
store i32 %37, i32* %8
br label %49
38: ; preds = %21
%39 = load i8**, i8*** %5
%40 = getelementptr inbounds i8*, i8** %39, i64 1
%41 = load i8*, i8** %40
%42 = call i64 @str_to_ul(i8* %41)
store i64 %42, i64* %9
%43 = load i8**, i8*** %5
%44 = getelementptr inbounds i8*, i8** %43, i64 2
%45 = load i8*, i8** %44
%46 = call i64 @str_to_ul(i8* %45)
store i64 %46, i64* %10
%47 = load i32, i32* @O_RDONLY
%48 = call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %47)
store i32 %48, i32* %8
br label %49
49: ; preds = %38, %27
%50 = load i32, i32* %8
%51 = icmp eq i32 %50, -1
br i1 %51, label %52, label %54
52: ; preds = %49
%53 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %3
br label %122
54: ; preds = %49
%55 = load i32, i32* %8
%56 = load i64, i64* %9
%57 = load i32, i32* @SEEK_SET
%58 = call i64 @lseek64(i32 %55, i64 %56, i32 %57)
%59 = icmp slt i64 %58, 0
br i1 %59, label %60, label %62
60: ; preds = %54
%61 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
store i32 1, i32* %3
br label %122
62: ; preds = %54
%63 = load i64, i64* %9
%64 = load i64, i64* %10
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.6, i64 0, i64 0), i64 %63, i64 %64)
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.7, i64 0, i64 0))
br label %67
67: ; preds = %107, %62
%68 = load i64, i64* %10
%69 = icmp ugt i64 %68, 0
br i1 %69, label %70, label %119
70: ; preds = %67
%71 = load i64, i64* %9
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i64 %71)
%73 = load i32, i32* @PROT_READ
%74 = load i32, i32* @MAP_SHARED
%75 = load i32, i32* %8
%76 = load i64, i64* %9
%77 = call i8* @mmap(i32* null, i32 4096, i32 %73, i32 %74, i32 %75, i64 %76)
store i8* %77, i8** %12
%78 = load i8*, i8** %12
%79 = load i8*, i8** @MAP_FAILED
%80 = icmp eq i8* %78, %79
br i1 %80, label %81, label %83
81: ; preds = %70
%82 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
store i32 1, i32* %3
br label %122
83: ; preds = %70
store i32 4096, i32* %7
%84 = load i32, i32* %7
%85 = sext i32 %84 to i64
%86 = load i64, i64* %10
%87 = icmp ugt i64 %85, %86
br i1 %87, label %88, label %91
88: ; preds = %83
%89 = load i64, i64* %10
%90 = trunc i64 %89 to i32
store i32 %90, i32* %7
br label %91
91: ; preds = %88, %83
store i32 0, i32* %6
br label %92
92: ; preds = %104, %91
%93 = load i32, i32* %6
%94 = load i32, i32* %7
%95 = icmp slt i32 %93, %94
br i1 %95, label %96, label %107
96: ; preds = %92
%97 = load i8*, i8** %12
%98 = load i32, i32* %6
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds i8, i8* %97, i64 %99
%101 = load i8, i8* %100
%102 = sext i8 %101 to i32
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), i32 %102)
br label %104
104: ; preds = %96
%105 = load i32, i32* %6
%106 = add nsw i32 %105, 1
store i32 %106, i32* %6
br label %92
107: ; preds = %92
%108 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%109 = load i8*, i8** %12
%110 = call i32 @munmap(i8* %109, i32 4096)
%111 = load i32, i32* %7
%112 = sext i32 %111 to i64
%113 = load i64, i64* %10
%114 = sub i64 %113, %112
store i64 %114, i64* %10
%115 = load i32, i32* %7
%116 = sext i32 %115 to i64
%117 = load i64, i64* %9
%118 = add i64 %117, %116
store i64 %118, i64* %9
br label %67
119: ; preds = %67
%120 = load i32, i32* %8
%121 = call i32 @close(i32 %120)
store i32 0, i32* %3
br label %122
122: ; preds = %119, %81, %60, %52, %15
%123 = load i32, i32* %3
ret i32 %123
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"Usage: %s [-k] (offset) (length)\0A\00"
@.str.1 = [3 x i8] c"-k\00"
@.str.2 = [10 x i8] c"/dev/kmem\00"
@O_RDONLY = global i32 0
@.str.3 = [9 x i8] c"/dev/mem\00"
@.str.4 = [5 x i8] c"open\00"
@SEEK_SET = global i32 0
@.str.5 = [6 x i8] c"lseek\00"
@.str.6 = [43 x i8] c"Dump Offset : %016lx, Dump Length: %016lx\0A\00"
@.str.8 = [9 x i8] c"%016lx: \00"
@PROT_READ = global i32 0
@MAP_SHARED = global i32 0
@MAP_FAILED = global i8* null
@.str.9 = [5 x i8] c"mmap\00"
@.str.10 = [6 x i8] c"%02x \00"
@str = [66 x i8] c"(Address)------- +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +a +b +c +d +e +f\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %1
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %69
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @strcmp(i8* dereferenceable(1) %10, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = getelementptr inbounds i8*, i8** %1, i64 2
%15 = load i8*, i8** %14
br label %16
16: ; preds = %8, %13
%17 = phi i8* [ %15, %13 ], [ %10, %8 ]
%18 = phi i64 [ 3, %13 ], [ 2, %8 ]
%19 = phi i8* [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), %13 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), %8 ]
%20 = tail call i64 @str_to_ul(i8* %17)
%21 = getelementptr inbounds i8*, i8** %1, i64 %18
%22 = load i8*, i8** %21
%23 = tail call i64 @str_to_ul(i8* %22)
%24 = load i32, i32* @O_RDONLY
%25 = tail call i32 @open(i8* %19, i32 %24)
%26 = icmp eq i32 %25, -1
br i1 %26, label %27, label %29
27: ; preds = %16
%28 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
br label %69
29: ; preds = %16
%30 = load i32, i32* @SEEK_SET
%31 = tail call i64 @lseek64(i32 %25, i64 %20, i32 %30)
%32 = icmp slt i64 %31, 0
br i1 %32, label %33, label %35
33: ; preds = %29
%34 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
br label %69
35: ; preds = %29
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.6, i64 0, i64 0), i64 %20, i64 %23)
%37 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str, i64 0, i64 0))
%38 = icmp eq i64 %23, 0
br i1 %38, label %67, label %39
39: ; preds = %35, %61
%40 = phi i64 [ %64, %61 ], [ %23, %35 ]
%41 = phi i64 [ %65, %61 ], [ %20, %35 ]
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i64 %41)
%43 = load i32, i32* @PROT_READ
%44 = load i32, i32* @MAP_SHARED
%45 = tail call i8* @mmap(i32* null, i32 4096, i32 %43, i32 %44, i32 %25, i64 %41)
%46 = load i8*, i8** @MAP_FAILED
%47 = icmp eq i8* %45, %46
br i1 %47, label %48, label %50
48: ; preds = %39
%49 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
br label %69
50: ; preds = %39
%51 = icmp ult i64 %40, 4096
%52 = select i1 %51, i64 %40, i64 4096
br label %53
53: ; preds = %50, %53
%54 = phi i64 [ 0, %50 ], [ %59, %53 ]
%55 = getelementptr inbounds i8, i8* %45, i64 %54
%56 = load i8, i8* %55
%57 = sext i8 %56 to i32
%58 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), i32 %57)
%59 = add nuw nsw i64 %54, 1
%60 = icmp eq i64 %59, %52
br i1 %60, label %61, label %53
61: ; preds = %53
%62 = tail call i32 @putchar(i32 10)
%63 = tail call i32 @munmap(i8* %45, i32 4096)
%64 = sub i64 %40, %52
%65 = add i64 %52, %41
%66 = icmp eq i64 %64, 0
br i1 %66, label %67, label %39
67: ; preds = %61, %35
%68 = tail call i32 @close(i32 %25)
br label %69
69: ; preds = %48, %67, %33, %27, %4
%70 = phi i32 [ 1, %4 ], [ 1, %27 ], [ 1, %33 ], [ 0, %67 ], [ 1, %48 ]
ret i32 %70
}