#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int MAP_FILE;
int MAP_PRIVATE;
int /*<<< orphan*/ PROT_READ;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fileno(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, ...);
unsigned int fwrite(void *, int, unsigned int, int /*<<< orphan*/);
int getpagesize();
void *mmap(int /*<<< orphan*/, unsigned int, int /*<<< orphan*/, int,
           int /*<<< orphan*/, unsigned int);
int sscanf(char *, char *, unsigned int *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
char *strerror(int /*<<< orphan*/);
unsigned int strtoul(char *, char **, int /*<<< orphan*/);
int main(int argc, char **argv) {
  char *fname;
  FILE *f;
  int pagesize = getpagesize();
  unsigned int pos, pos_pg, pos_off;
  unsigned int len, len_pg, len_off;
  void *address;
  char *rest;
  if (argc != 4 || sscanf(argv[2], "%i", &pos) != 1 ||
      sscanf(argv[3], "%i", &len) != 1) {
    fprintf(stderr, "%s: Usage \"%s <file> <offset> <len>\"\n", argv[0],
            argv[0]);
    exit(1);
  }
  pos = strtoul(argv[2], &rest, 0);
  if (rest && *rest) {
    fprintf(stderr, "%s: Usage \"%s <file> <offset> <len>\"\n", argv[0],
            argv[0]);
    exit(1);
  }
  fname = argv[1];
  if (!(f = fopen(fname, "r"))) {
    fprintf(stderr, "%s: %s: %s\n", argv[0], fname, strerror(errno));
    exit(1);
  }
  pos_pg = pos & ~(pagesize - 1);
  pos_off = pos & (pagesize - 1);
  len_pg = (len + pos_off + pagesize - 1) & ~(pagesize - 1);
  len_off = (len + pos_off) & (pagesize - 1);
  address =
      mmap(0, len_pg, PROT_READ, MAP_FILE | MAP_PRIVATE, fileno(f), pos_pg);
  if (address == (void *)-1) {
    fprintf(stderr, "%s: mmap(): %s\n", argv[0], strerror(errno));
    exit(1);
  }
  fclose(f);
  fprintf(stderr, "mapped \"%s\" from %i to %i (0x%x to 0x%x) \n", fname, pos,
          pos + len, pos_pg, pos_pg + len_pg);
  if (fwrite(address + pos_off, 1, len, stdout) != len) {
    fprintf(stderr, "%s: write(): %s\n", argv[0], strerror(errno));
    exit(1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   10a0 <getpagesize@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x4,-0x8(%rbp)
jne    121f <main+0x6f>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe14(%rip),%rsi
lea    -0x28(%rbp),%rdx
call   1070 <sscanf@plt>
cmp    $0x1,%eax
jne    121f <main+0x6f>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xdf3(%rip),%rsi
lea    -0x34(%rbp),%rdx
call   1070 <sscanf@plt>
cmp    $0x1,%eax
je     124e <main+0x9e>
mov    0x2daa(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
lea    0xdc6(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    -0x50(%rbp),%rsi
xor    %edx,%edx
call   1090 <strtoul@plt>
mov    %eax,-0x28(%rbp)
cmpq   $0x0,-0x50(%rbp)
je     12ae <main+0xfe>
mov    -0x50(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     12ae <main+0xfe>
mov    0x2d4a(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
lea    0xd66(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xd64(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    132b <main+0x17b>
mov    0x2cf1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x64(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x60(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    0x2cca(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0x64(%rbp),%edi
mov    -0x60(%rbp),%rdx
mov    -0x58(%rbp),%rcx
mov    %rax,%r8
lea    0xd11(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
mov    -0x28(%rbp),%eax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%eax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
mov    %eax,-0x30(%rbp)
mov    -0x34(%rbp),%eax
add    -0x30(%rbp),%eax
add    -0x24(%rbp),%eax
sub    $0x1,%eax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0x38(%rbp)
mov    -0x34(%rbp),%eax
add    -0x30(%rbp),%eax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x38(%rbp),%eax
mov    %eax,-0x70(%rbp)
mov    0x2c76(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x6c(%rbp)
mov    0x2c52(%rip),%rax
mov    (%rax),%eax
mov    0x2c21(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x68(%rbp)
mov    -0x20(%rbp),%rdi
call   1060 <fileno@plt>
mov    -0x70(%rbp),%esi
mov    -0x6c(%rbp),%edx
mov    -0x68(%rbp),%ecx
mov    %eax,%r8d
mov    -0x2c(%rbp),%r9d
xor    %edi,%edi
call   1040 <mmap@plt>
mov    %rax,-0x48(%rbp)
mov    $0xffffffffffffffff,%rax
cmp    %rax,-0x48(%rbp)
jne    1418 <main+0x268>
mov    0x2bf8(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x7c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x78(%rbp)
mov    0x2bd9(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0x7c(%rbp),%edi
mov    -0x78(%rbp),%rdx
mov    %rax,%rcx
lea    0xc30(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
mov    0x2ba8(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
mov    -0x28(%rbp),%ecx
mov    -0x28(%rbp),%r8d
add    -0x34(%rbp),%r8d
mov    -0x2c(%rbp),%r9d
mov    -0x2c(%rbp),%eax
add    -0x38(%rbp),%eax
lea    0xbfd(%rip),%rsi
mov    %eax,(%rsp)
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x48(%rbp),%rdi
mov    -0x30(%rbp),%eax
add    %rax,%rdi
mov    -0x34(%rbp),%edx
mov    0x2b58(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%esi
call   10c0 <fwrite@plt>
cmp    -0x34(%rbp),%eax
je     14d0 <main+0x320>
mov    0x2b4c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x88(%rbp)
mov    0x2b27(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0x8c(%rbp),%edi
mov    -0x88(%rbp),%rdx
mov    %rax,%rcx
lea    0xbb3(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbp
mov    %edi,%ebx
xor    %eax,%eax
call   10a0 <getpagesize@plt>
cmp    $0x4,%ebx
jne    1339 <main+0x189>
mov    %eax,%r12d
mov    0x10(%rbp),%rdi
lea    0xe1f(%rip),%rsi
lea    0xc(%rsp),%rdx
call   1070 <sscanf@plt>
cmp    $0x1,%eax
jne    1339 <main+0x189>
mov    0x18(%rbp),%rdi
lea    0xe01(%rip),%rsi
lea    0x8(%rsp),%rdx
call   1070 <sscanf@plt>
cmp    $0x1,%eax
jne    1339 <main+0x189>
mov    0x10(%rbp),%rdi
lea    0x20(%rsp),%rsi
xor    %edx,%edx
call   1090 <strtoul@plt>
mov    %eax,0xc(%rsp)
mov    0x20(%rsp),%rax
test   %rax,%rax
je     1239 <main+0x89>
cmpb   $0x0,(%rax)
jne    1339 <main+0x189>
mov    %rbp,0x10(%rsp)
mov    0x8(%rbp),%rdi
lea    0xde0(%rip),%rsi
mov    %rdi,0x18(%rsp)
call   1080 <fopen@plt>
test   %rax,%rax
je     1355 <main+0x1a5>
mov    %rax,%r13
mov    0xc(%rsp),%r14d
lea    -0x1(%r12),%r15d
mov    %r12d,%eax
neg    %eax
and    %r14d,%r15d
and    %eax,%r14d
lea    (%r12,%r15,1),%ebx
add    $0xffffffff,%ebx
add    0x8(%rsp),%ebx
and    %eax,%ebx
mov    0x2d70(%rip),%rax
mov    (%rax),%r12d
mov    0x2d4e(%rip),%rax
mov    0x2d1f(%rip),%rcx
mov    (%rcx),%ebp
or     (%rax),%ebp
mov    %r13,%rdi
call   1060 <fileno@plt>
xor    %edi,%edi
mov    %ebx,%esi
mov    %r12d,%edx
mov    %ebp,%ecx
mov    %eax,%r8d
mov    %r14d,%r9d
call   1040 <mmap@plt>
cmp    $0xffffffffffffffff,%rax
je     1399 <main+0x1e9>
mov    %rax,%rbp
mov    %r13,%rdi
call   1030 <fclose@plt>
mov    0x2cfb(%rip),%r12
mov    (%r12),%edi
mov    0xc(%rsp),%ecx
mov    0x8(%rsp),%r8d
add    %ecx,%r8d
add    %r14d,%ebx
mov    %ebx,(%rsp)
lea    0xd55(%rip),%rsi
mov    0x18(%rsp),%rdx
mov    %r14d,%r9d
xor    %eax,%eax
call   1050 <fprintf@plt>
add    %r15,%rbp
mov    0x8(%rsp),%edx
mov    0x2cb1(%rip),%rax
mov    (%rax),%ecx
mov    %rbp,%rdi
mov    $0x1,%esi
call   10c0 <fwrite@plt>
cmp    0x8(%rsp),%eax
jne    13c1 <main+0x211>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2c90(%rip),%rax
mov    (%rax),%edi
mov    0x0(%rbp),%rcx
lea    0xcb6(%rip),%rsi
mov    %rcx,%rdx
jmp    13ea <main+0x23a>
mov    0x2c74(%rip),%rax
mov    (%rax),%ebx
mov    0x10(%rsp),%rax
mov    (%rax),%rbp
mov    0x2c5b(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
lea    0xcb0(%rip),%rsi
mov    %ebx,%edi
mov    %rbp,%rdx
mov    0x18(%rsp),%rcx
mov    %rax,%r8
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
mov    0x2c30(%rip),%rax
mov    (%rax),%ebx
mov    0x10(%rsp),%rax
mov    (%rax),%rbp
mov    0x2c17(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
lea    0xc78(%rip),%rsi
jmp    13e2 <main+0x232>
mov    (%r12),%ebx
mov    0x10(%rsp),%rax
mov    (%rax),%rbp
mov    0x2bf4(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
lea    0xc90(%rip),%rsi
mov    %ebx,%edi
mov    %rbp,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%i\00"
@stderr = global i32 0
@.str.1 = [38 x i8] c"%s: Usage \22%s <file> <offset> <len>\22\0A\00"
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [12 x i8] c"%s: %s: %s\0A\00"
@errno = global i32 0
@PROT_READ = global i32 0
@MAP_FILE = global i32 0
@MAP_PRIVATE = global i32 0
@.str.4 = [16 x i8] c"%s: mmap(): %s\0A\00"
@.str.5 = [43 x i8] c"mapped \22%s\22 from %i to %i (0x%x to 0x%x) \0A\00"
@stdout = global i32 0
@.str.6 = [17 x i8] c"%s: write(): %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i8*
%16 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%17 = call i32 (...) @getpagesize()
store i32 %17, i32* %8
%18 = load i32, i32* %4
%19 = icmp ne i32 %18, 4
br i1 %19, label %32, label %20
20: ; preds = %2
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 2
%23 = load i8*, i8** %22
%24 = call i32 @sscanf(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %9)
%25 = icmp ne i32 %24, 1
br i1 %25, label %32, label %26
26: ; preds = %20
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 3
%29 = load i8*, i8** %28
%30 = call i32 @sscanf(i8* %29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %12)
%31 = icmp ne i32 %30, 1
br i1 %31, label %32, label %42
32: ; preds = %26, %20, %2
%33 = load i32, i32* @stderr
%34 = load i8**, i8*** %5
%35 = getelementptr inbounds i8*, i8** %34, i64 0
%36 = load i8*, i8** %35
%37 = load i8**, i8*** %5
%38 = getelementptr inbounds i8*, i8** %37, i64 0
%39 = load i8*, i8** %38
%40 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %33, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %36, i8* %39)
%41 = call i32 @exit(i32 1)
unreachable
42: ; preds = %26
%43 = load i8**, i8*** %5
%44 = getelementptr inbounds i8*, i8** %43, i64 2
%45 = load i8*, i8** %44
%46 = call i32 @strtoul(i8* %45, i8** %16, i32 0)
store i32 %46, i32* %9
%47 = load i8*, i8** %16
%48 = icmp ne i8* %47, null
br i1 %48, label %49, label %64
49: ; preds = %42
%50 = load i8*, i8** %16
%51 = load i8, i8* %50
%52 = sext i8 %51 to i32
%53 = icmp ne i32 %52, 0
br i1 %53, label %54, label %64
54: ; preds = %49
%55 = load i32, i32* @stderr
%56 = load i8**, i8*** %5
%57 = getelementptr inbounds i8*, i8** %56, i64 0
%58 = load i8*, i8** %57
%59 = load i8**, i8*** %5
%60 = getelementptr inbounds i8*, i8** %59, i64 0
%61 = load i8*, i8** %60
%62 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %55, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %58, i8* %61)
%63 = call i32 @exit(i32 1)
unreachable
64: ; preds = %49, %42
%65 = load i8**, i8*** %5
%66 = getelementptr inbounds i8*, i8** %65, i64 1
%67 = load i8*, i8** %66
store i8* %67, i8** %6
%68 = load i8*, i8** %6
%69 = call i32* @fopen(i8* %68, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %69, i32** %7
%70 = icmp ne i32* %69, null
br i1 %70, label %81, label %71
71: ; preds = %64
%72 = load i32, i32* @stderr
%73 = load i8**, i8*** %5
%74 = getelementptr inbounds i8*, i8** %73, i64 0
%75 = load i8*, i8** %74
%76 = load i8*, i8** %6
%77 = load i32, i32* @errno
%78 = call i8* @strerror(i32 %77)
%79 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %72, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8* %75, i8* %76, i8* %78)
%80 = call i32 @exit(i32 1)
unreachable
81: ; preds = %64
%82 = load i32, i32* %9
%83 = load i32, i32* %8
%84 = sub nsw i32 %83, 1
%85 = xor i32 %84, -1
%86 = and i32 %82, %85
store i32 %86, i32* %10
%87 = load i32, i32* %9
%88 = load i32, i32* %8
%89 = sub nsw i32 %88, 1
%90 = and i32 %87, %89
store i32 %90, i32* %11
%91 = load i32, i32* %12
%92 = load i32, i32* %11
%93 = add i32 %91, %92
%94 = load i32, i32* %8
%95 = add i32 %93, %94
%96 = sub i32 %95, 1
%97 = load i32, i32* %8
%98 = sub nsw i32 %97, 1
%99 = xor i32 %98, -1
%100 = and i32 %96, %99
store i32 %100, i32* %13
%101 = load i32, i32* %12
%102 = load i32, i32* %11
%103 = add i32 %101, %102
%104 = load i32, i32* %8
%105 = sub nsw i32 %104, 1
%106 = and i32 %103, %105
store i32 %106, i32* %14
%107 = load i32, i32* %13
%108 = load i32, i32* @PROT_READ
%109 = load i32, i32* @MAP_FILE
%110 = load i32, i32* @MAP_PRIVATE
%111 = or i32 %109, %110
%112 = load i32*, i32** %7
%113 = call i32 @fileno(i32* %112)
%114 = load i32, i32* %10
%115 = call i8* @mmap(i32 0, i32 %107, i32 %108, i32 %111, i32 %113, i32 %114)
store i8* %115, i8** %15
%116 = load i8*, i8** %15
%117 = icmp eq i8* %116, inttoptr (i64 -1 to i8*)
br i1 %117, label %118, label %127
118: ; preds = %81
%119 = load i32, i32* @stderr
%120 = load i8**, i8*** %5
%121 = getelementptr inbounds i8*, i8** %120, i64 0
%122 = load i8*, i8** %121
%123 = load i32, i32* @errno
%124 = call i8* @strerror(i32 %123)
%125 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %119, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8* %122, i8* %124)
%126 = call i32 @exit(i32 1)
unreachable
127: ; preds = %81
%128 = load i32*, i32** %7
%129 = call i32 @fclose(i32* %128)
%130 = load i32, i32* @stderr
%131 = load i8*, i8** %6
%132 = load i32, i32* %9
%133 = load i32, i32* %9
%134 = load i32, i32* %12
%135 = add i32 %133, %134
%136 = load i32, i32* %10
%137 = load i32, i32* %10
%138 = load i32, i32* %13
%139 = add i32 %137, %138
%140 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %130, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0), i8* %131, i32 %132, i32 %135, i32 %136, i32 %139)
%141 = load i8*, i8** %15
%142 = load i32, i32* %11
%143 = zext i32 %142 to i64
%144 = getelementptr i8, i8* %141, i64 %143
%145 = load i32, i32* %12
%146 = load i32, i32* @stdout
%147 = call i32 @fwrite(i8* %144, i32 1, i32 %145, i32 %146)
%148 = load i32, i32* %12
%149 = icmp ne i32 %147, %148
br i1 %149, label %150, label %159
150: ; preds = %127
%151 = load i32, i32* @stderr
%152 = load i8**, i8*** %5
%153 = getelementptr inbounds i8*, i8** %152, i64 0
%154 = load i8*, i8** %153
%155 = load i32, i32* @errno
%156 = call i8* @strerror(i32 %155)
%157 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %151, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i8* %154, i8* %156)
%158 = call i32 @exit(i32 1)
unreachable
159: ; preds = %127
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
@stderr = global i32 0
@.str.1 = [38 x i8] c"%s: Usage \22%s <file> <offset> <len>\22\0A\00"
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [12 x i8] c"%s: %s: %s\0A\00"
@errno = global i32 0
@PROT_READ = global i32 0
@MAP_FILE = global i32 0
@MAP_PRIVATE = global i32 0
@.str.4 = [16 x i8] c"%s: mmap(): %s\0A\00"
@.str.5 = [43 x i8] c"mapped \22%s\22 from %i to %i (0x%x to 0x%x) \0A\00"
@stdout = global i32 0
@.str.6 = [17 x i8] c"%s: write(): %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = tail call i32 (...) @getpagesize()
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = bitcast i8** %5 to i8*
%10 = icmp eq i32 %0, 4
br i1 %10, label %11, label %21
11: ; preds = %2
%12 = getelementptr inbounds i8*, i8** %1, i64 2
%13 = load i8*, i8** %12
%14 = call i32 @sscanf(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%15 = icmp eq i32 %14, 1
br i1 %15, label %16, label %21
16: ; preds = %11
%17 = getelementptr inbounds i8*, i8** %1, i64 3
%18 = load i8*, i8** %17
%19 = call i32 @sscanf(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%20 = icmp eq i32 %19, 1
br i1 %20, label %26, label %21
21: ; preds = %16, %11, %2
%22 = load i32, i32* @stderr
%23 = load i8*, i8** %1
%24 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %23, i8* %23)
%25 = call i32 @exit(i32 1)
unreachable
26: ; preds = %16
%27 = load i8*, i8** %12
%28 = call i32 @strtoul(i8* %27, i8** %5, i32 0)
store i32 %28, i32* %3
%29 = load i8*, i8** %5
%30 = icmp eq i8* %29, null
br i1 %30, label %39, label %31
31: ; preds = %26
%32 = load i8, i8* %29
%33 = icmp eq i8 %32, 0
br i1 %33, label %39, label %34
34: ; preds = %31
%35 = load i32, i32* @stderr
%36 = load i8*, i8** %1
%37 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %35, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %36, i8* %36)
%38 = call i32 @exit(i32 1)
unreachable
39: ; preds = %31, %26
%40 = getelementptr inbounds i8*, i8** %1, i64 1
%41 = load i8*, i8** %40
%42 = call i32* @fopen(i8* %41, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%43 = icmp eq i32* %42, null
br i1 %43, label %44, label %51
44: ; preds = %39
%45 = load i32, i32* @stderr
%46 = load i8*, i8** %1
%47 = load i32, i32* @errno
%48 = call i8* @strerror(i32 %47)
%49 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %45, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8* %46, i8* %41, i8* %48)
%50 = call i32 @exit(i32 1)
unreachable
51: ; preds = %39
%52 = load i32, i32* %3
%53 = add i32 %6, -1
%54 = sub i32 0, %6
%55 = and i32 %52, %54
%56 = and i32 %52, %53
%57 = load i32, i32* %4
%58 = add i32 %53, %56
%59 = add i32 %58, %57
%60 = and i32 %59, %54
%61 = load i32, i32* @PROT_READ
%62 = load i32, i32* @MAP_FILE
%63 = load i32, i32* @MAP_PRIVATE
%64 = or i32 %63, %62
%65 = call i32 @fileno(i32* %42)
%66 = call i8* @mmap(i32 0, i32 %60, i32 %61, i32 %64, i32 %65, i32 %55)
%67 = icmp eq i8* %66, inttoptr (i64 -1 to i8*)
br i1 %67, label %68, label %75
68: ; preds = %51
%69 = load i32, i32* @stderr
%70 = load i8*, i8** %1
%71 = load i32, i32* @errno
%72 = call i8* @strerror(i32 %71)
%73 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %69, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8* %70, i8* %72)
%74 = call i32 @exit(i32 1)
unreachable
75: ; preds = %51
%76 = call i32 @fclose(i32* %42)
%77 = load i32, i32* @stderr
%78 = load i32, i32* %3
%79 = load i32, i32* %4
%80 = add i32 %79, %78
%81 = add i32 %60, %55
%82 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %77, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0), i8* %41, i32 %78, i32 %80, i32 %55, i32 %81)
%83 = zext i32 %56 to i64
%84 = getelementptr i8, i8* %66, i64 %83
%85 = load i32, i32* %4
%86 = load i32, i32* @stdout
%87 = call i32 @fwrite(i8* %84, i32 1, i32 %85, i32 %86)
%88 = load i32, i32* %4
%89 = icmp eq i32 %87, %88
br i1 %89, label %97, label %90
90: ; preds = %75
%91 = load i32, i32* @stderr
%92 = load i8*, i8** %1
%93 = load i32, i32* @errno
%94 = call i8* @strerror(i32 %93)
%95 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %91, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i8* %92, i8* %94)
%96 = call i32 @exit(i32 1)
unreachable
97: ; preds = %75
ret i32 0
}