#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_PRIVATE;
int /*<<< orphan*/ PROT_READ;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ _SC_PAGESIZE;
int /*<<< orphan*/ close(int);
int errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ ftruncate(int, int);
int /*<<< orphan*/ lseek(int, unsigned int, int /*<<< orphan*/);
scalar_t__ memcmp(void *, char *, int);
int mkstemp(char *);
void *mmap(int /*<<< orphan*/ *, int, int /*<<< orphan*/, int /*<<< orphan*/,
           int, unsigned int);
scalar_t__ munmap(void *, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
unsigned int sysconf(int /*<<< orphan*/);
int /*<<< orphan*/ unlink(char *);
int /*<<< orphan*/ write(int, char *, int);
int main(int argc, char *argv[]) {
  int fd;
  void *filememory_1;
  void *filememory_2;
  void *filememory_3;
  unsigned int pg_sz = sysconf(_SC_PAGESIZE);
  char fname[] = "/tmp/test-mmap.XXXXXX";
  fd = mkstemp(fname);
  if (fd < 0) {
    fprintf(stderr, "Couldn't open %s for writing\n", fname);
    return (1);
  }
  unlink(fname);
  write(fd, "This is a test string", sizeof "This is a test string");
  ftruncate(fd, pg_sz);
  lseek(fd, pg_sz, SEEK_SET);
  write(fd, "Another string for testing", sizeof "Another string for testing");
  ftruncate(fd, 2 * pg_sz);
  filememory_1 = mmap(NULL, 0x0100, PROT_READ, MAP_PRIVATE, fd, 0);
  if (filememory_1 == (void *)-1) {
    perror("mmap returned error");
    return (1);
  }
  filememory_3 = mmap(NULL, 0x0100, PROT_READ, MAP_PRIVATE, fd, pg_sz);
  if (filememory_3 == (void *)-1) {
    perror("mmap (pg_sz) returned error");
    return (1);
  }
  filememory_2 = mmap(NULL, 0x0100, PROT_READ, MAP_PRIVATE, fd + 10, 0);
  if ((filememory_2 != (void *)-1) || (errno != 9)) {
    fprintf(stderr, "mmap allowed a bogus file descriptor...\n");
    return (1);
  }
  if (memcmp(filememory_1, "This is a test string",
             sizeof "This is a test string") != 0) {
    fprintf(stderr, "mmap doesn't give expected data...\n");
    return (1);
  }
  if (memcmp(filememory_3, "Another string for testing",
             sizeof "Another string for testing") != 0) {
    fprintf(stderr, "mmap (pg_sz) doesn't give expected data...\n");
    return (1);
  }
  if (munmap(filememory_3, 0x0100) < 0 || munmap(filememory_1, 0x0100) < 0) {
    perror("munmap()");
    return 1;
  }
  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)
mov    0x2e03(%rip),%rax
mov    (%rax),%edi
call   10e0 <sysconf@plt>
mov    %eax,-0x34(%rbp)
mov    0xe12(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xe0f(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xe0d(%rip),%eax
mov    %eax,-0x40(%rbp)
mov    0xe07(%rip),%ax
mov    %ax,-0x3c(%rbp)
lea    -0x50(%rbp),%rdi
call   10b0 <mkstemp@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    124e <main+0x8e>
mov    0x2da2(%rip),%rax
mov    (%rax),%edi
lea    -0x50(%rbp),%rdx
lea    0xddb(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    14a3 <main+0x2e3>
lea    -0x50(%rbp),%rdi
call   1030 <unlink@plt>
mov    -0x14(%rbp),%edi
lea    0xdd3(%rip),%rsi
mov    $0x16,%edx
call   1040 <write@plt>
mov    -0x14(%rbp),%edi
mov    -0x34(%rbp),%esi
call   1060 <ftruncate@plt>
mov    -0x14(%rbp),%edi
mov    -0x34(%rbp),%esi
mov    0x2d3d(%rip),%rax
mov    (%rax),%edx
call   1070 <lseek@plt>
mov    -0x14(%rbp),%edi
lea    0xdb6(%rip),%rsi
mov    $0x1b,%edx
call   1040 <write@plt>
mov    -0x14(%rbp),%edi
mov    -0x34(%rbp),%esi
shl    $0x1,%esi
call   1060 <ftruncate@plt>
mov    0x2d45(%rip),%rax
mov    (%rax),%edx
mov    0x2cfc(%rip),%rax
mov    (%rax),%ecx
mov    -0x14(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%edi
mov    $0x100,%esi
xor    %r9d,%r9d
call   1050 <mmap@plt>
mov    %rax,-0x20(%rbp)
mov    $0xffffffffffffffff,%rax
cmp    %rax,-0x20(%rbp)
jne    1300 <main+0x140>
lea    0xd76(%rip),%rdi
call   10d0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    14a3 <main+0x2e3>
mov    0x2cf1(%rip),%rax
mov    (%rax),%edx
mov    0x2ca8(%rip),%rax
mov    (%rax),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x34(%rbp),%r9d
xor    %eax,%eax
mov    %eax,%edi
mov    $0x100,%esi
call   1050 <mmap@plt>
mov    %rax,-0x30(%rbp)
mov    $0xffffffffffffffff,%rax
cmp    %rax,-0x30(%rbp)
jne    1355 <main+0x195>
lea    0xd35(%rip),%rdi
call   10d0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    14a3 <main+0x2e3>
mov    0x2c9c(%rip),%rax
mov    (%rax),%edx
mov    0x2c53(%rip),%rax
mov    (%rax),%ecx
mov    -0x14(%rbp),%r8d
add    $0xa,%r8d
xor    %eax,%eax
mov    %eax,%edi
mov    $0x100,%esi
xor    %r9d,%r9d
call   1050 <mmap@plt>
mov    %rax,-0x28(%rbp)
mov    $0xffffffffffffffff,%rax
cmp    %rax,-0x28(%rbp)
jne    13a5 <main+0x1e5>
mov    0x2c2c(%rip),%rax
cmpl   $0x9,(%rax)
je     13c8 <main+0x208>
mov    0x2c24(%rip),%rax
mov    (%rax),%edi
lea    0xce0(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    14a3 <main+0x2e3>
mov    -0x20(%rbp),%rdi
lea    0xc61(%rip),%rsi
mov    $0x16,%edx
call   1090 <memcmp@plt>
cmp    $0x0,%rax
je     140a <main+0x24a>
mov    0x2be2(%rip),%rax
mov    (%rax),%edi
lea    0xcc7(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    14a3 <main+0x2e3>
mov    -0x30(%rbp),%rdi
lea    0xc35(%rip),%rsi
mov    $0x1b,%edx
call   1090 <memcmp@plt>
cmp    $0x0,%rax
je     144c <main+0x28c>
mov    0x2ba0(%rip),%rax
mov    (%rax),%edi
lea    0xca9(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    14a3 <main+0x2e3>
mov    -0x30(%rbp),%rdi
mov    $0x100,%esi
call   10c0 <munmap@plt>
cmp    $0x0,%rax
jl     147c <main+0x2bc>
mov    -0x20(%rbp),%rdi
mov    $0x100,%esi
call   10c0 <munmap@plt>
cmp    $0x0,%rax
jge    1494 <main+0x2d4>
lea    0xc8b(%rip),%rdi
call   10d0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    14a3 <main+0x2e3>
mov    -0x14(%rbp),%edi
call   1080 <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   %r12
push   %rbx
sub    $0x20,%rsp
mov    0x2e0d(%rip),%rax
mov    (%rax),%edi
call   10e0 <sysconf@plt>
mov    %eax,%ebp
movaps 0xe1d(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x5858585858582e,%rax
mov    %rax,0xe(%rsp)
mov    %rsp,%rdi
call   10b0 <mkstemp@plt>
test   %eax,%eax
js     1310 <main+0x150>
mov    %eax,%ebx
mov    %rsp,%rdi
call   1030 <unlink@plt>
lea    0xe1d(%rip),%rsi
mov    %ebx,%edi
mov    $0x16,%edx
call   1040 <write@plt>
mov    %ebx,%edi
mov    %ebp,%esi
call   1060 <ftruncate@plt>
mov    0x2d8d(%rip),%rax
mov    (%rax),%edx
mov    %ebx,%edi
mov    %ebp,%esi
call   1070 <lseek@plt>
lea    0xe05(%rip),%rsi
mov    %ebx,%edi
mov    $0x1b,%edx
call   1040 <write@plt>
mov    %ebp,%esi
add    %ebp,%esi
mov    %ebx,%edi
call   1060 <ftruncate@plt>
mov    0x2d95(%rip),%r15
mov    (%r15),%edx
mov    0x2d4b(%rip),%r12
mov    (%r12),%ecx
xor    %edi,%edi
mov    $0x100,%esi
mov    %ebx,%r8d
xor    %r9d,%r9d
call   1050 <mmap@plt>
cmp    $0xffffffffffffffff,%rax
je     13af <main+0x1ef>
mov    %rax,%r14
mov    (%r15),%edx
mov    (%r12),%ecx
xor    %edi,%edi
mov    $0x100,%esi
mov    %ebx,%r8d
mov    %ebp,%r9d
call   1050 <mmap@plt>
cmp    $0xffffffffffffffff,%rax
je     13b8 <main+0x1f8>
mov    %rax,%rbp
mov    (%r15),%edx
mov    (%r12),%ecx
mov    %ebx,%r8d
add    $0xa,%r8d
xor    %edi,%edi
mov    $0x100,%esi
xor    %r9d,%r9d
call   1050 <mmap@plt>
cmp    $0xffffffffffffffff,%rax
jne    132c <main+0x16c>
mov    0x2ce8(%rip),%rax
cmpl   $0x9,(%rax)
jne    132c <main+0x16c>
lea    0xd48(%rip),%rsi
mov    %r14,%rdi
mov    $0x16,%edx
call   1090 <memcmp@plt>
test   %rax,%rax
je     1355 <main+0x195>
mov    0x2ccb(%rip),%rax
mov    (%rax),%edi
lea    0xdb0(%rip),%rsi
jmp    133c <main+0x17c>
mov    0x2cb9(%rip),%rax
mov    (%rax),%edi
lea    0xcf6(%rip),%rsi
mov    %rsp,%rdx
xor    %eax,%eax
call   10a0 <fprintf@plt>
jmp    1343 <main+0x183>
mov    0x2c9d(%rip),%rax
mov    (%rax),%edi
lea    0xd59(%rip),%rsi
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xcee(%rip),%rsi
mov    %rbp,%rdi
mov    $0x1b,%edx
call   1090 <memcmp@plt>
test   %rax,%rax
je     1380 <main+0x1c0>
mov    0x2c5b(%rip),%rax
mov    (%rax),%edi
lea    0xd64(%rip),%rsi
jmp    133c <main+0x17c>
mov    %rbp,%rdi
mov    $0x100,%esi
call   10c0 <munmap@plt>
test   %rax,%rax
js     13c9 <main+0x209>
mov    %r14,%rdi
mov    $0x100,%esi
call   10c0 <munmap@plt>
test   %rax,%rax
js     13c9 <main+0x209>
mov    %ebx,%edi
call   1080 <close@plt>
xor    %eax,%eax
jmp    1348 <main+0x188>
lea    0xcaf(%rip),%rdi
jmp    13bf <main+0x1ff>
lea    0xcba(%rip),%rdi
call   10d0 <perror@plt>
jmp    1343 <main+0x183>
lea    0xd3e(%rip),%rdi
jmp    13bf <main+0x1ff>

LLVM IR (-O0):
@_SC_PAGESIZE = global i32 0
@__const.main.fname = [22 x i8] c"/tmp/test-mmap.XXXXXX\00"
@stderr = global i32 0
@.str = [30 x i8] c"Couldn't open %s for writing\0A\00"
@.str.1 = [22 x i8] c"This is a test string\00"
@SEEK_SET = global i32 0
@.str.2 = [27 x i8] c"Another string for testing\00"
@PROT_READ = global i32 0
@MAP_PRIVATE = global i32 0
@.str.3 = [20 x i8] c"mmap returned error\00"
@.str.4 = [28 x i8] c"mmap (pg_sz) returned error\00"
@errno = global i32 0
@.str.5 = [41 x i8] c"mmap allowed a bogus file descriptor...\0A\00"
@.str.6 = [36 x i8] c"mmap doesn't give expected data...\0A\00"
@.str.7 = [44 x i8] c"mmap (pg_sz) doesn't give expected data...\0A\00"
@.str.8 = [9 x i8] c"munmap()\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca [22 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = load i32, i32* @_SC_PAGESIZE
%13 = call i32 @sysconf(i32 %12)
store i32 %13, i32* %10
%14 = bitcast [22 x i8]* %11 to i8*
%15 = getelementptr inbounds [22 x i8], [22 x i8]* %11, i64 0, i64 0
%16 = call i32 @mkstemp(i8* %15)
store i32 %16, i32* %6
%17 = load i32, i32* %6
%18 = icmp slt i32 %17, 0
br i1 %18, label %19, label %23
19: ; preds = %2
%20 = load i32, i32* @stderr
%21 = getelementptr inbounds [22 x i8], [22 x i8]* %11, i64 0, i64 0
%22 = call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %21)
store i32 1, i32* %3
br label %100
23: ; preds = %2
%24 = getelementptr inbounds [22 x i8], [22 x i8]* %11, i64 0, i64 0
%25 = call i32 @unlink(i8* %24)
%26 = load i32, i32* %6
%27 = call i32 @write(i32 %26, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 22)
%28 = load i32, i32* %6
%29 = load i32, i32* %10
%30 = call i32 @ftruncate(i32 %28, i32 %29)
%31 = load i32, i32* %6
%32 = load i32, i32* %10
%33 = load i32, i32* @SEEK_SET
%34 = call i32 @lseek(i32 %31, i32 %32, i32 %33)
%35 = load i32, i32* %6
%36 = call i32 @write(i32 %35, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 27)
%37 = load i32, i32* %6
%38 = load i32, i32* %10
%39 = mul i32 2, %38
%40 = call i32 @ftruncate(i32 %37, i32 %39)
%41 = load i32, i32* @PROT_READ
%42 = load i32, i32* @MAP_PRIVATE
%43 = load i32, i32* %6
%44 = call i8* @mmap(i32* null, i32 256, i32 %41, i32 %42, i32 %43, i32 0)
store i8* %44, i8** %7
%45 = load i8*, i8** %7
%46 = icmp eq i8* %45, inttoptr (i64 -1 to i8*)
br i1 %46, label %47, label %49
47: ; preds = %23
%48 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %3
br label %100
49: ; preds = %23
%50 = load i32, i32* @PROT_READ
%51 = load i32, i32* @MAP_PRIVATE
%52 = load i32, i32* %6
%53 = load i32, i32* %10
%54 = call i8* @mmap(i32* null, i32 256, i32 %50, i32 %51, i32 %52, i32 %53)
store i8* %54, i8** %9
%55 = load i8*, i8** %9
%56 = icmp eq i8* %55, inttoptr (i64 -1 to i8*)
br i1 %56, label %57, label %59
57: ; preds = %49
%58 = call i32 @perror(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %3
br label %100
59: ; preds = %49
%60 = load i32, i32* @PROT_READ
%61 = load i32, i32* @MAP_PRIVATE
%62 = load i32, i32* %6
%63 = add nsw i32 %62, 10
%64 = call i8* @mmap(i32* null, i32 256, i32 %60, i32 %61, i32 %63, i32 0)
store i8* %64, i8** %8
%65 = load i8*, i8** %8
%66 = icmp ne i8* %65, inttoptr (i64 -1 to i8*)
br i1 %66, label %70, label %67
67: ; preds = %59
%68 = load i32, i32* @errno
%69 = icmp ne i32 %68, 9
br i1 %69, label %70, label %73
70: ; preds = %67, %59
%71 = load i32, i32* @stderr
%72 = call i32 (i32, i8*, ...) @fprintf(i32 %71, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0))
store i32 1, i32* %3
br label %100
73: ; preds = %67
%74 = load i8*, i8** %7
%75 = call i64 @memcmp(i8* %74, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 22)
%76 = icmp ne i64 %75, 0
br i1 %76, label %77, label %80
77: ; preds = %73
%78 = load i32, i32* @stderr
%79 = call i32 (i32, i8*, ...) @fprintf(i32 %78, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.6, i64 0, i64 0))
store i32 1, i32* %3
br label %100
80: ; preds = %73
%81 = load i8*, i8** %9
%82 = call i64 @memcmp(i8* %81, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 27)
%83 = icmp ne i64 %82, 0
br i1 %83, label %84, label %87
84: ; preds = %80
%85 = load i32, i32* @stderr
%86 = call i32 (i32, i8*, ...) @fprintf(i32 %85, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.7, i64 0, i64 0))
store i32 1, i32* %3
br label %100
87: ; preds = %80
%88 = load i8*, i8** %9
%89 = call i64 @munmap(i8* %88, i32 256)
%90 = icmp slt i64 %89, 0
br i1 %90, label %95, label %91
91: ; preds = %87
%92 = load i8*, i8** %7
%93 = call i64 @munmap(i8* %92, i32 256)
%94 = icmp slt i64 %93, 0
br i1 %94, label %95, label %97
95: ; preds = %91, %87
%96 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
store i32 1, i32* %3
br label %100
97: ; preds = %91
%98 = load i32, i32* %6
%99 = call i32 @close(i32 %98)
store i32 0, i32* %3
br label %100
100: ; preds = %97, %95, %84, %77, %70, %57, %47, %19
%101 = load i32, i32* %3
ret i32 %101
}

LLVM IR (-O2):
@_SC_PAGESIZE = global i32 0
@__const.main.fname = [22 x i8] c"/tmp/test-mmap.XXXXXX\00"
@stderr = global i32 0
@.str = [30 x i8] c"Couldn't open %s for writing\0A\00"
@.str.1 = [22 x i8] c"This is a test string\00"
@SEEK_SET = global i32 0
@.str.2 = [27 x i8] c"Another string for testing\00"
@PROT_READ = global i32 0
@MAP_PRIVATE = global i32 0
@.str.3 = [20 x i8] c"mmap returned error\00"
@.str.4 = [28 x i8] c"mmap (pg_sz) returned error\00"
@errno = global i32 0
@.str.5 = [41 x i8] c"mmap allowed a bogus file descriptor...\0A\00"
@.str.6 = [36 x i8] c"mmap doesn't give expected data...\0A\00"
@.str.7 = [44 x i8] c"mmap (pg_sz) doesn't give expected data...\0A\00"
@.str.8 = [9 x i8] c"munmap()\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [22 x i8]
%4 = load i32, i32* @_SC_PAGESIZE
%5 = tail call i32 @sysconf(i32 %4)
%6 = getelementptr inbounds [22 x i8], [22 x i8]* %3, i64 0, i64 0
%7 = call i32 @mkstemp(i8* %6)
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %68
12: ; preds = %2
%13 = call i32 @unlink(i8* %6)
%14 = call i32 @write(i32 %7, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 22)
%15 = call i32 @ftruncate(i32 %7, i32 %5)
%16 = load i32, i32* @SEEK_SET
%17 = call i32 @lseek(i32 %7, i32 %5, i32 %16)
%18 = call i32 @write(i32 %7, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 27)
%19 = shl i32 %5, 1
%20 = call i32 @ftruncate(i32 %7, i32 %19)
%21 = load i32, i32* @PROT_READ
%22 = load i32, i32* @MAP_PRIVATE
%23 = call i8* @mmap(i32* null, i32 256, i32 %21, i32 %22, i32 %7, i32 0)
%24 = icmp eq i8* %23, inttoptr (i64 -1 to i8*)
br i1 %24, label %25, label %27
25: ; preds = %12
%26 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
br label %68
27: ; preds = %12
%28 = load i32, i32* @PROT_READ
%29 = load i32, i32* @MAP_PRIVATE
%30 = call i8* @mmap(i32* null, i32 256, i32 %28, i32 %29, i32 %7, i32 %5)
%31 = icmp eq i8* %30, inttoptr (i64 -1 to i8*)
br i1 %31, label %32, label %34
32: ; preds = %27
%33 = call i32 @perror(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
br label %68
34: ; preds = %27
%35 = load i32, i32* @PROT_READ
%36 = load i32, i32* @MAP_PRIVATE
%37 = add nuw nsw i32 %7, 10
%38 = call i8* @mmap(i32* null, i32 256, i32 %35, i32 %36, i32 %37, i32 0)
%39 = icmp ne i8* %38, inttoptr (i64 -1 to i8*)
%40 = load i32, i32* @errno
%41 = icmp ne i32 %40, 9
%42 = select i1 %39, i1 true, i1 %41
br i1 %42, label %43, label %46
43: ; preds = %34
%44 = load i32, i32* @stderr
%45 = call i32 (i32, i8*, ...) @fprintf(i32 %44, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0))
br label %68
46: ; preds = %34
%47 = call i64 @memcmp(i8* %23, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 22)
%48 = icmp eq i64 %47, 0
br i1 %48, label %52, label %49
49: ; preds = %46
%50 = load i32, i32* @stderr
%51 = call i32 (i32, i8*, ...) @fprintf(i32 %50, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.6, i64 0, i64 0))
br label %68
52: ; preds = %46
%53 = call i64 @memcmp(i8* %30, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 27)
%54 = icmp eq i64 %53, 0
br i1 %54, label %58, label %55
55: ; preds = %52
%56 = load i32, i32* @stderr
%57 = call i32 (i32, i8*, ...) @fprintf(i32 %56, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.7, i64 0, i64 0))
br label %68
58: ; preds = %52
%59 = call i64 @munmap(i8* %30, i32 256)
%60 = icmp slt i64 %59, 0
br i1 %60, label %64, label %61
61: ; preds = %58
%62 = call i64 @munmap(i8* %23, i32 256)
%63 = icmp slt i64 %62, 0
br i1 %63, label %64, label %66
64: ; preds = %61, %58
%65 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
br label %68
66: ; preds = %61
%67 = call i32 @close(i32 %7)
br label %68
68: ; preds = %66, %64, %55, %49, %43, %32, %25, %9
%69 = phi i32 [ 1, %9 ], [ 1, %25 ], [ 1, %32 ], [ 1, %43 ], [ 1, %49 ], [ 1, %55 ], [ 1, %64 ], [ 0, %66 ]
ret i32 %69
}