#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 stat {
  int st_size;
};
typedef size_t ssize_t;
typedef int off_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
char *MAP_FAILED;
int /*<<< orphan*/ MAP_PRIVATE;
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ PROT_READ;
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ _SC_PAGE_SIZE;
void *atoi(char *);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int fstat(int, struct stat *);
char *mmap(int /*<<< orphan*/ *, size_t, int /*<<< orphan*/, int /*<<< orphan*/,
           int, int);
int /*<<< orphan*/ munmap(char *, size_t);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
int sysconf(int /*<<< orphan*/);
size_t write(int /*<<< orphan*/, char *, size_t);
int main(int argc, char *argv[]) {
  char *addr;
  int fd;
  struct stat sb;
  off_t offset, pa_offset;
  size_t length;
  ssize_t s;
  if (argc < 3 || argc > 4) {
    fprintf(stderr, "%s file offset [length]\n", argv[0]);
    exit(EXIT_FAILURE);
  }
  fd = open(argv[1], O_RDONLY);
  if (fd == -1)
    do {
      perror("open");
      exit(EXIT_FAILURE);
    } while (0);
  if (fstat(fd, &sb) == -1)
    do {
      perror("fstat");
      exit(EXIT_FAILURE);
    } while (0);
  offset = atoi(argv[2]);
  pa_offset = offset & ~(sysconf(_SC_PAGE_SIZE) - 1);
  if (offset >= sb.st_size) {
    fprintf(stderr, "offset is past end of file\n");
    exit(EXIT_FAILURE);
  }
  if (argc == 4) {
    length = atoi(argv[3]);
    if (offset + length > sb.st_size)
      length = sb.st_size - offset;
  } else {
    length = sb.st_size - offset;
  }
  addr = mmap(NULL, length + offset - pa_offset, PROT_READ, MAP_PRIVATE, fd,
              pa_offset);
  if (addr == MAP_FAILED)
    do {
      perror("mmap");
      exit(EXIT_FAILURE);
    } while (0);
  s = write(STDOUT_FILENO, addr + offset - pa_offset, length);
  if (s != length) {
    if (s == -1)
      do {
        perror("write");
        exit(EXIT_FAILURE);
      } while (0);
    fprintf(stderr, "partial write");
    exit(EXIT_FAILURE);
  }
  munmap(addr, length + offset - pa_offset);
  close(fd);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jl     11da <main+0x2a>
cmpl   $0x4,-0x8(%rbp)
jle    1206 <main+0x56>
mov    0x2de7(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe0f(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2dc1(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2dc3(%rip),%rax
mov    (%rax),%esi
call   1080 <open@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
jne    1248 <main+0x98>
jmp    122e <main+0x7e>
lea    0xde4(%rip),%rdi
call   1090 <perror@plt>
mov    0x2d7f(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
mov    -0x1c(%rbp),%edi
lea    -0x20(%rbp),%rsi
call   10d0 <fstat@plt>
cmp    $0xffffffff,%eax
jne    127c <main+0xcc>
jmp    1262 <main+0xb2>
lea    0xdb5(%rip),%rdi
call   1090 <perror@plt>
mov    0x2d4b(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10b0 <atoi@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    0x2d1f(%rip),%rax
mov    (%rax),%edi
call   10a0 <sysconf@plt>
mov    %eax,%ecx
mov    -0x3c(%rbp),%eax
sub    $0x1,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x20(%rbp),%eax
jl     12e1 <main+0x131>
mov    0x2d05(%rip),%rax
mov    (%rax),%edi
lea    0xd58(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2ce6(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
cmpl   $0x4,-0x8(%rbp)
jne    1322 <main+0x172>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   10b0 <atoi@plt>
mov    %rax,-0x30(%rbp)
movslq -0x24(%rbp),%rax
add    -0x30(%rbp),%rax
movslq -0x20(%rbp),%rcx
cmp    %rcx,%rax
jbe    131d <main+0x16d>
mov    -0x20(%rbp),%eax
sub    -0x24(%rbp),%eax
cltq
mov    %rax,-0x30(%rbp)
jmp    132e <main+0x17e>
mov    -0x20(%rbp),%eax
sub    -0x24(%rbp),%eax
cltq
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rsi
movslq -0x24(%rbp),%rax
add    %rax,%rsi
movslq -0x28(%rbp),%rax
sub    %rax,%rsi
mov    0x2cb1(%rip),%rax
mov    (%rax),%edx
mov    0x2c58(%rip),%rax
mov    (%rax),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x28(%rbp),%r9d
xor    %eax,%eax
mov    %eax,%edi
call   1040 <mmap@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0x2c2e(%rip),%rcx
cmp    (%rcx),%rax
jne    139a <main+0x1ea>
jmp    1380 <main+0x1d0>
lea    0xcb9(%rip),%rdi
call   1090 <perror@plt>
mov    0x2c2d(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
mov    0x2c47(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rsi
movslq -0x24(%rbp),%rax
add    %rax,%rsi
movslq -0x28(%rbp),%rcx
xor    %eax,%eax
sub    %rcx,%rax
add    %rax,%rsi
mov    -0x30(%rbp),%rdx
call   1030 <write@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
cmp    -0x30(%rbp),%rax
je     1424 <main+0x274>
cmpq   $0xffffffffffffffff,-0x38(%rbp)
jne    13ff <main+0x24f>
jmp    13e5 <main+0x235>
lea    0xc61(%rip),%rdi
call   1090 <perror@plt>
mov    0x2bc8(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
mov    0x2bc2(%rip),%rax
mov    (%rax),%edi
lea    0xc36(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2ba3(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
mov    -0x18(%rbp),%rdi
mov    -0x30(%rbp),%rsi
movslq -0x24(%rbp),%rax
add    %rax,%rsi
movslq -0x28(%rbp),%rax
sub    %rax,%rsi
call   1070 <munmap@plt>
mov    -0x1c(%rbp),%edi
call   1050 <close@plt>
mov    0x2b62(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    -0x5(%rbp),%eax
cmp    $0xfffffffd,%eax
ja     11e4 <main+0x34>
mov    0x2df9(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xe25(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
jmp    1222 <main+0x72>
mov    0x8(%rbx),%rdi
mov    0x2de9(%rip),%rax
mov    (%rax),%esi
call   1080 <open@plt>
cmp    $0xffffffff,%eax
jne    1204 <main+0x54>
lea    0xe17(%rip),%rdi
jmp    121d <main+0x6d>
mov    %eax,%r15d
mov    %rsp,%rsi
mov    %eax,%edi
call   10d0 <fstat@plt>
cmp    $0xffffffff,%eax
jne    1230 <main+0x80>
lea    0xe01(%rip),%rdi
call   1090 <perror@plt>
mov    0x2d97(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
mov    0x10(%rbx),%rdi
call   10b0 <atoi@plt>
mov    %rax,%r13
mov    0x2d75(%rip),%rax
mov    (%rax),%edi
call   10a0 <sysconf@plt>
movslq (%rsp),%r14
cmp    %r13d,%r14d
jle    1283 <main+0xd3>
mov    %eax,%r12d
neg    %r12d
and    %r13d,%r12d
cmp    $0x4,%ebp
jne    129c <main+0xec>
mov    0x18(%rbx),%rdi
call   10b0 <atoi@plt>
movslq %r13d,%rdx
mov    %rax,%rcx
mov    %rdx,%rbp
add    %rdx,%rcx
cmp    %r14,%rcx
jbe    12a7 <main+0xf7>
sub    %r13d,%r14d
movslq %r14d,%r14
jmp    12aa <main+0xfa>
mov    0x2d3e(%rip),%rax
mov    (%rax),%edi
lea    0xd91(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
jmp    1222 <main+0x72>
sub    %r13d,%r14d
movslq %r14d,%r14
movslq %r13d,%rbp
jmp    12aa <main+0xfa>
mov    %rax,%r14
movslq %r12d,%r13
mov    %rbp,%rbx
sub    %r13,%rbx
add    %r14,%rbx
mov    0x2d3b(%rip),%rax
mov    (%rax),%edx
mov    0x2ce2(%rip),%rax
mov    (%rax),%ecx
xor    %edi,%edi
mov    %rbx,%rsi
mov    %r15d,%r8d
mov    %r13d,%r9d
call   1040 <mmap@plt>
mov    %rax,%r12
mov    0x2cbe(%rip),%rax
cmp    (%rax),%r12
jne    12f3 <main+0x143>
lea    0xd52(%rip),%rdi
jmp    121d <main+0x6d>
mov    0x2cee(%rip),%rax
mov    (%rax),%edi
add    %r12,%rbp
sub    %r13,%rbp
mov    %rbp,%rsi
mov    %r14,%rdx
call   1030 <write@plt>
cmp    %r14,%rax
jne    1333 <main+0x183>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1070 <munmap@plt>
mov    %r15d,%edi
call   1050 <close@plt>
mov    0x2c84(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
cmp    $0xffffffffffffffff,%rax
jne    1345 <main+0x195>
lea    0xd0d(%rip),%rdi
jmp    121d <main+0x6d>
mov    0x2c7c(%rip),%rax
mov    (%rax),%edi
lea    0xcf0(%rip),%rsi
jmp    1293 <main+0xe3>

LLVM IR (-O0):
%struct.stat = type { i32 }
@stderr = global i32 0
@.str = [25 x i8] c"%s file offset [length]\0A\00"
@EXIT_FAILURE = global i32 0
@O_RDONLY = global i32 0
@.str.1 = [5 x i8] c"open\00"
@.str.2 = [6 x i8] c"fstat\00"
@_SC_PAGE_SIZE = global i32 0
@.str.3 = [28 x i8] c"offset is past end of file\0A\00"
@PROT_READ = global i32 0
@MAP_PRIVATE = global i32 0
@MAP_FAILED = global i8* null
@.str.4 = [5 x i8] c"mmap\00"
@STDOUT_FILENO = global i32 0
@.str.5 = [6 x i8] c"write\00"
@.str.6 = [14 x i8] c"partial write\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
%8 = alloca %struct.stat
%9 = alloca i32
%10 = alloca i32
%11 = alloca i64
%12 = alloca i64
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 %18, label %15
15: ; preds = %2
%16 = load i32, i32* %4
%17 = icmp sgt i32 %16, 4
br i1 %17, label %18, label %26
18: ; preds = %15, %2
%19 = load i32, i32* @stderr
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 0
%22 = load i8*, i8** %21
%23 = call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %22)
%24 = load i32, i32* @EXIT_FAILURE
%25 = call i32 @exit(i32 %24)
unreachable
26: ; preds = %15
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 1
%29 = load i8*, i8** %28
%30 = load i32, i32* @O_RDONLY
%31 = call i32 @open(i8* %29, i32 %30)
store i32 %31, i32* %7
%32 = load i32, i32* %7
%33 = icmp eq i32 %32, -1
br i1 %33, label %34, label %40
34: ; preds = %26
br label %35
35: ; preds = %34
%36 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%37 = load i32, i32* @EXIT_FAILURE
%38 = call i32 @exit(i32 %37)
unreachable
39: ; No predecessors!
br label %40
40: ; preds = %39, %26
%41 = load i32, i32* %7
%42 = call i32 @fstat(i32 %41, %struct.stat* %8)
%43 = icmp eq i32 %42, -1
br i1 %43, label %44, label %50
44: ; preds = %40
br label %45
45: ; preds = %44
%46 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%47 = load i32, i32* @EXIT_FAILURE
%48 = call i32 @exit(i32 %47)
unreachable
49: ; No predecessors!
br label %50
50: ; preds = %49, %40
%51 = load i8**, i8*** %5
%52 = getelementptr inbounds i8*, i8** %51, i64 2
%53 = load i8*, i8** %52
%54 = call i8* @atoi(i8* %53)
%55 = ptrtoint i8* %54 to i32
store i32 %55, i32* %9
%56 = load i32, i32* %9
%57 = load i32, i32* @_SC_PAGE_SIZE
%58 = call i32 @sysconf(i32 %57)
%59 = sub nsw i32 %58, 1
%60 = xor i32 %59, -1
%61 = and i32 %56, %60
store i32 %61, i32* %10
%62 = load i32, i32* %9
%63 = getelementptr inbounds %struct.stat, %struct.stat* %8, i32 0, i32 0
%64 = load i32, i32* %63
%65 = icmp sge i32 %62, %64
br i1 %65, label %66, label %71
66: ; preds = %50
%67 = load i32, i32* @stderr
%68 = call i32 (i32, i8*, ...) @fprintf(i32 %67, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%69 = load i32, i32* @EXIT_FAILURE
%70 = call i32 @exit(i32 %69)
unreachable
71: ; preds = %50
%72 = load i32, i32* %4
%73 = icmp eq i32 %72, 4
br i1 %73, label %74, label %95
74: ; preds = %71
%75 = load i8**, i8*** %5
%76 = getelementptr inbounds i8*, i8** %75, i64 3
%77 = load i8*, i8** %76
%78 = call i8* @atoi(i8* %77)
%79 = ptrtoint i8* %78 to i64
store i64 %79, i64* %11
%80 = load i32, i32* %9
%81 = sext i32 %80 to i64
%82 = load i64, i64* %11
%83 = add i64 %81, %82
%84 = getelementptr inbounds %struct.stat, %struct.stat* %8, i32 0, i32 0
%85 = load i32, i32* %84
%86 = sext i32 %85 to i64
%87 = icmp ugt i64 %83, %86
br i1 %87, label %88, label %94
88: ; preds = %74
%89 = getelementptr inbounds %struct.stat, %struct.stat* %8, i32 0, i32 0
%90 = load i32, i32* %89
%91 = load i32, i32* %9
%92 = sub nsw i32 %90, %91
%93 = sext i32 %92 to i64
store i64 %93, i64* %11
br label %94
94: ; preds = %88, %74
br label %101
95: ; preds = %71
%96 = getelementptr inbounds %struct.stat, %struct.stat* %8, i32 0, i32 0
%97 = load i32, i32* %96
%98 = load i32, i32* %9
%99 = sub nsw i32 %97, %98
%100 = sext i32 %99 to i64
store i64 %100, i64* %11
br label %101
101: ; preds = %95, %94
%102 = load i64, i64* %11
%103 = load i32, i32* %9
%104 = sext i32 %103 to i64
%105 = add i64 %102, %104
%106 = load i32, i32* %10
%107 = sext i32 %106 to i64
%108 = sub i64 %105, %107
%109 = load i32, i32* @PROT_READ
%110 = load i32, i32* @MAP_PRIVATE
%111 = load i32, i32* %7
%112 = load i32, i32* %10
%113 = call i8* @mmap(i32* null, i64 %108, i32 %109, i32 %110, i32 %111, i32 %112)
store i8* %113, i8** %6
%114 = load i8*, i8** %6
%115 = load i8*, i8** @MAP_FAILED
%116 = icmp eq i8* %114, %115
br i1 %116, label %117, label %123
117: ; preds = %101
br label %118
118: ; preds = %117
%119 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%120 = load i32, i32* @EXIT_FAILURE
%121 = call i32 @exit(i32 %120)
unreachable
122: ; No predecessors!
br label %123
123: ; preds = %122, %101
%124 = load i32, i32* @STDOUT_FILENO
%125 = load i8*, i8** %6
%126 = load i32, i32* %9
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds i8, i8* %125, i64 %127
%129 = load i32, i32* %10
%130 = sext i32 %129 to i64
%131 = sub i64 0, %130
%132 = getelementptr inbounds i8, i8* %128, i64 %131
%133 = load i64, i64* %11
%134 = call i64 @write(i32 %124, i8* %132, i64 %133)
store i64 %134, i64* %12
%135 = load i64, i64* %12
%136 = load i64, i64* %11
%137 = icmp ne i64 %135, %136
br i1 %137, label %138, label %152
138: ; preds = %123
%139 = load i64, i64* %12
%140 = icmp eq i64 %139, -1
br i1 %140, label %141, label %147
141: ; preds = %138
br label %142
142: ; preds = %141
%143 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%144 = load i32, i32* @EXIT_FAILURE
%145 = call i32 @exit(i32 %144)
unreachable
146: ; No predecessors!
br label %147
147: ; preds = %146, %138
%148 = load i32, i32* @stderr
%149 = call i32 (i32, i8*, ...) @fprintf(i32 %148, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0))
%150 = load i32, i32* @EXIT_FAILURE
%151 = call i32 @exit(i32 %150)
unreachable
152: ; preds = %123
%153 = load i8*, i8** %6
%154 = load i64, i64* %11
%155 = load i32, i32* %9
%156 = sext i32 %155 to i64
%157 = add i64 %154, %156
%158 = load i32, i32* %10
%159 = sext i32 %158 to i64
%160 = sub i64 %157, %159
%161 = call i32 @munmap(i8* %153, i64 %160)
%162 = load i32, i32* %7
%163 = call i32 @close(i32 %162)
%164 = load i32, i32* @EXIT_SUCCESS
%165 = call i32 @exit(i32 %164)
unreachable
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@stderr = global i32 0
@.str = [25 x i8] c"%s file offset [length]\0A\00"
@EXIT_FAILURE = global i32 0
@O_RDONLY = global i32 0
@.str.1 = [5 x i8] c"open\00"
@.str.2 = [6 x i8] c"fstat\00"
@_SC_PAGE_SIZE = global i32 0
@.str.3 = [28 x i8] c"offset is past end of file\0A\00"
@PROT_READ = global i32 0
@MAP_PRIVATE = global i32 0
@MAP_FAILED = global i8* null
@.str.4 = [5 x i8] c"mmap\00"
@STDOUT_FILENO = global i32 0
@.str.5 = [6 x i8] c"write\00"
@.str.6 = [14 x i8] c"partial write\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.stat
%4 = bitcast %struct.stat* %3 to i8*
%5 = add i32 %0, -5
%6 = icmp ult i32 %5, -2
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = load i8*, i8** %1
%10 = tail call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load i32, i32* @EXIT_FAILURE
%12 = tail call i32 @exit(i32 %11)
unreachable
13: ; preds = %2
%14 = getelementptr inbounds i8*, i8** %1, i64 1
%15 = load i8*, i8** %14
%16 = load i32, i32* @O_RDONLY
%17 = tail call i32 @open(i8* %15, i32 %16)
%18 = icmp eq i32 %17, -1
br i1 %18, label %19, label %23
19: ; preds = %13
%20 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%21 = load i32, i32* @EXIT_FAILURE
%22 = tail call i32 @exit(i32 %21)
unreachable
23: ; preds = %13
%24 = call i32 @fstat(i32 %17, %struct.stat* %3)
%25 = icmp eq i32 %24, -1
br i1 %25, label %26, label %30
26: ; preds = %23
%27 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%28 = load i32, i32* @EXIT_FAILURE
%29 = tail call i32 @exit(i32 %28)
unreachable
30: ; preds = %23
%31 = getelementptr inbounds i8*, i8** %1, i64 2
%32 = load i8*, i8** %31
%33 = tail call i8* @atoi(i8* %32)
%34 = ptrtoint i8* %33 to i64
%35 = trunc i64 %34 to i32
%36 = load i32, i32* @_SC_PAGE_SIZE
%37 = tail call i32 @sysconf(i32 %36)
%38 = sub i32 0, %37
%39 = and i32 %35, %38
%40 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
%41 = load i32, i32* %40
%42 = icmp sgt i32 %41, %35
br i1 %42, label %48, label %43
43: ; preds = %30
%44 = load i32, i32* @stderr
%45 = tail call i32 (i32, i8*, ...) @fprintf(i32 %44, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%46 = load i32, i32* @EXIT_FAILURE
%47 = tail call i32 @exit(i32 %46)
unreachable
48: ; preds = %30
%49 = icmp eq i32 %0, 4
br i1 %49, label %50, label %63
50: ; preds = %48
%51 = getelementptr inbounds i8*, i8** %1, i64 3
%52 = load i8*, i8** %51
%53 = tail call i8* @atoi(i8* %52)
%54 = ptrtoint i8* %53 to i64
%55 = shl i64 %34, 32
%56 = ashr exact i64 %55, 32
%57 = add i64 %56, %54
%58 = sext i32 %41 to i64
%59 = icmp ugt i64 %57, %58
br i1 %59, label %60, label %68
60: ; preds = %50
%61 = sub nsw i32 %41, %35
%62 = sext i32 %61 to i64
br label %68
63: ; preds = %48
%64 = sub nsw i32 %41, %35
%65 = sext i32 %64 to i64
%66 = shl i64 %34, 32
%67 = ashr exact i64 %66, 32
br label %68
68: ; preds = %50, %60, %63
%69 = phi i64 [ %56, %50 ], [ %56, %60 ], [ %67, %63 ]
%70 = phi i64 [ %54, %50 ], [ %62, %60 ], [ %65, %63 ]
%71 = sext i32 %39 to i64
%72 = sub nsw i64 %69, %71
%73 = add i64 %72, %70
%74 = load i32, i32* @PROT_READ
%75 = load i32, i32* @MAP_PRIVATE
%76 = tail call i8* @mmap(i32* null, i64 %73, i32 %74, i32 %75, i32 %17, i32 %39)
%77 = load i8*, i8** @MAP_FAILED
%78 = icmp eq i8* %76, %77
br i1 %78, label %79, label %83
79: ; preds = %68
%80 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%81 = load i32, i32* @EXIT_FAILURE
%82 = tail call i32 @exit(i32 %81)
unreachable
83: ; preds = %68
%84 = sub nsw i64 0, %71
%85 = load i32, i32* @STDOUT_FILENO
%86 = getelementptr inbounds i8, i8* %76, i64 %69
%87 = getelementptr inbounds i8, i8* %86, i64 %84
%88 = tail call i64 @write(i32 %85, i8* %87, i64 %70)
%89 = icmp eq i64 %88, %70
br i1 %89, label %101, label %90
90: ; preds = %83
%91 = icmp eq i64 %88, -1
br i1 %91, label %92, label %96
92: ; preds = %90
%93 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%94 = load i32, i32* @EXIT_FAILURE
%95 = tail call i32 @exit(i32 %94)
unreachable
96: ; preds = %90
%97 = load i32, i32* @stderr
%98 = tail call i32 (i32, i8*, ...) @fprintf(i32 %97, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0))
%99 = load i32, i32* @EXIT_FAILURE
%100 = tail call i32 @exit(i32 %99)
unreachable
101: ; preds = %83
%102 = tail call i32 @munmap(i8* %76, i64 %73)
%103 = tail call i32 @close(i32 %17)
%104 = load i32, i32* @EXIT_SUCCESS
%105 = tail call i32 @exit(i32 %104)
unreachable
}