#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 /*<<< orphan*/ st_size;
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
void *MAP_FAILED;
int /*<<< orphan*/ MAP_PRIVATE;
int /*<<< orphan*/ MAP_SHARED;
int /*<<< orphan*/ MS_SYNC;
int O_CREAT;
int /*<<< orphan*/ O_RDONLY;
int O_RDWR;
int /*<<< orphan*/ PROT_READ;
int /*<<< orphan*/ PROT_WRITE;
int close(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int fstat(int, struct stat *);
int ftruncate(int, int /*<<< orphan*/);
int /*<<< orphan*/ helpAndExit(char *, int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(void *, void *, int /*<<< orphan*/);
void *mmap(int /*<<< orphan*/ *, int /*<<< orphan*/, int /*<<< orphan*/,
           int /*<<< orphan*/, int, int /*<<< orphan*/);
int msync(void *, int /*<<< orphan*/, int /*<<< orphan*/);
int munmap(void *, int /*<<< orphan*/);
int open(char *, int, ...);
int /*<<< orphan*/ pexit(char *);
int main(int argc, char *argv[]) {
  int srcfd, dstfd;
  struct stat st;
  void *srcmem, *dstmem;
  if (argc != 3)
    helpAndExit(argv[0], EXIT_FAILURE);
  srcfd = open(argv[1], O_RDONLY);
  if (srcfd == -1)
    pexit("open");
  if (fstat(srcfd, &st) == -1)
    pexit("fstat");
  srcmem = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, srcfd, 0);
  if (srcmem == MAP_FAILED)
    pexit("mmap");
  dstfd = open(argv[2], O_CREAT | O_RDWR, st.st_mode);
  if (dstfd == -1)
    pexit("open");
  if (ftruncate(dstfd, st.st_size) == -1)
    pexit("ftruncate");
  dstmem = mmap(NULL, st.st_size, PROT_WRITE, MAP_SHARED, dstfd, 0);
  if (dstmem == MAP_FAILED)
    pexit("mmap");
  memcpy(dstmem, srcmem, st.st_size);
  if (close(srcfd) == -1)
    pexit("close");
  if (close(dstfd) == -1)
    pexit("close");
  if (munmap(srcmem, st.st_size) == -1)
    pexit("munmap");
  if (msync(dstmem, st.st_size, MS_SYNC) == -1)
    pexit("msync");
  if (munmap(dstmem, st.st_size) == -1)
    pexit("munmap");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     11e5 <main+0x35>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    0x2dd2(%rip),%rax
mov    (%rax),%esi
call   10a0 <helpAndExit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2dd4(%rip),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   1090 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1216 <main+0x66>
lea    0xdef(%rip),%rdi
call   10c0 <pexit@plt>
mov    -0x14(%rbp),%edi
lea    -0x20(%rbp),%rsi
call   10d0 <fstat@plt>
cmp    $0xffffffff,%eax
jne    1237 <main+0x87>
lea    0xdd3(%rip),%rdi
call   10c0 <pexit@plt>
mov    -0x20(%rbp),%esi
mov    0x2daf(%rip),%rax
mov    (%rax),%edx
mov    0x2d4e(%rip),%rax
mov    (%rax),%ecx
mov    -0x14(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%edi
xor    %r9d,%r9d
call   1040 <mmap@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    0x2d25(%rip),%rcx
cmp    (%rcx),%rax
jne    1280 <main+0xd0>
lea    0xd90(%rip),%rdi
call   10c0 <pexit@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    0x2d69(%rip),%rax
mov    (%rax),%esi
mov    0x2d38(%rip),%rax
or     (%rax),%esi
mov    -0x1c(%rbp),%edx
mov    $0x0,%al
call   1090 <open@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
jne    12bd <main+0x10d>
lea    0xd48(%rip),%rdi
call   10c0 <pexit@plt>
mov    -0x18(%rbp),%edi
mov    -0x20(%rbp),%esi
call   1050 <ftruncate@plt>
cmp    $0xffffffff,%eax
jne    12dd <main+0x12d>
lea    0xd38(%rip),%rdi
call   10c0 <pexit@plt>
mov    -0x20(%rbp),%esi
mov    0x2cc1(%rip),%rax
mov    (%rax),%edx
mov    0x2cf0(%rip),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%edi
xor    %r9d,%r9d
call   1040 <mmap@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    0x2c7f(%rip),%rcx
cmp    (%rcx),%rax
jne    1326 <main+0x176>
lea    0xcea(%rip),%rdi
call   10c0 <pexit@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%edx
call   1070 <memcpy@plt>
mov    -0x14(%rbp),%edi
call   1060 <close@plt>
cmp    $0xffffffff,%eax
jne    1353 <main+0x1a3>
lea    0xccc(%rip),%rdi
call   10c0 <pexit@plt>
mov    -0x18(%rbp),%edi
call   1060 <close@plt>
cmp    $0xffffffff,%eax
jne    1370 <main+0x1c0>
lea    0xcaf(%rip),%rdi
call   10c0 <pexit@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%esi
call   1080 <munmap@plt>
cmp    $0xffffffff,%eax
jne    1391 <main+0x1e1>
lea    0xc94(%rip),%rdi
call   10c0 <pexit@plt>
mov    -0x30(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    0x2c19(%rip),%rax
mov    (%rax),%edx
call   1030 <msync@plt>
cmp    $0xffffffff,%eax
jne    13bb <main+0x20b>
lea    0xc71(%rip),%rdi
call   10c0 <pexit@plt>
mov    -0x30(%rbp),%rdi
mov    -0x20(%rbp),%esi
call   1080 <munmap@plt>
cmp    $0xffffffff,%eax
jne    13dc <main+0x22c>
lea    0xc49(%rip),%rdi
call   10c0 <pexit@plt>
mov    0x2bbd(%rip),%rax
mov    (%rax),%edi
call   10b0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbp
cmp    $0x3,%edi
je     11d5 <main+0x25>
mov    0x0(%rbp),%rdi
mov    0x2de2(%rip),%rax
mov    (%rax),%esi
call   10a0 <helpAndExit@plt>
mov    0x8(%rbp),%rdi
mov    0x2de8(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
call   1090 <open@plt>
mov    %eax,%r15d
cmp    $0xffffffff,%eax
jne    11fd <main+0x4d>
lea    0xe08(%rip),%rdi
call   10c0 <pexit@plt>
mov    %rsp,%rsi
mov    %r15d,%edi
call   10d0 <fstat@plt>
cmp    $0xffffffff,%eax
jne    1219 <main+0x69>
lea    0xdf1(%rip),%rdi
call   10c0 <pexit@plt>
mov    (%rsp),%r12d
mov    0x2dcc(%rip),%rax
mov    (%rax),%edx
mov    0x2d6b(%rip),%rax
mov    (%rax),%ecx
xor    %edi,%edi
mov    %r12d,%esi
mov    %r15d,%r8d
xor    %r9d,%r9d
call   1040 <mmap@plt>
mov    %rax,%r14
mov    0x2d47(%rip),%r13
cmp    0x0(%r13),%rax
jne    125b <main+0xab>
lea    0xdb5(%rip),%rdi
call   10c0 <pexit@plt>
mov    0x10(%rbp),%rdi
mov    0x2d92(%rip),%rax
mov    0x2d63(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x4(%rsp),%edx
xor    %eax,%eax
call   1090 <open@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
jne    128f <main+0xdf>
lea    0xd76(%rip),%rdi
call   10c0 <pexit@plt>
mov    %ebx,%edi
mov    %r12d,%esi
call   1050 <ftruncate@plt>
cmp    $0xffffffff,%eax
jne    12aa <main+0xfa>
lea    0xd6b(%rip),%rdi
call   10c0 <pexit@plt>
mov    0x2cf7(%rip),%rax
mov    (%rax),%edx
mov    0x2d26(%rip),%rax
mov    (%rax),%ecx
xor    %edi,%edi
mov    %r12d,%esi
mov    %ebx,%r8d
xor    %r9d,%r9d
call   1040 <mmap@plt>
mov    %rax,%rbp
cmp    0x0(%r13),%rax
jne    12e1 <main+0x131>
lea    0xd2f(%rip),%rdi
call   10c0 <pexit@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
mov    %r12d,%edx
call   1070 <memcpy@plt>
mov    %r15d,%edi
call   1060 <close@plt>
cmp    $0xffffffff,%eax
jne    1308 <main+0x158>
lea    0xd17(%rip),%rdi
call   10c0 <pexit@plt>
mov    %ebx,%edi
call   1060 <close@plt>
cmp    $0xffffffff,%eax
jne    1320 <main+0x170>
lea    0xcff(%rip),%rdi
call   10c0 <pexit@plt>
mov    %r14,%rdi
mov    %r12d,%esi
call   1080 <munmap@plt>
cmp    $0xffffffff,%eax
jne    133c <main+0x18c>
lea    0xce9(%rip),%rdi
call   10c0 <pexit@plt>
mov    0x2c75(%rip),%rax
mov    (%rax),%edx
mov    %rbp,%rdi
mov    %r12d,%esi
call   1030 <msync@plt>
cmp    $0xffffffff,%eax
jne    1361 <main+0x1b1>
lea    0xccb(%rip),%rdi
call   10c0 <pexit@plt>
mov    %rbp,%rdi
mov    %r12d,%esi
call   1080 <munmap@plt>
cmp    $0xffffffff,%eax
jne    137d <main+0x1cd>
lea    0xca8(%rip),%rdi
call   10c0 <pexit@plt>
mov    0x2c1c(%rip),%rax
mov    (%rax),%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
%struct.stat = type { i32, i32 }
@EXIT_FAILURE = global i32 0
@O_RDONLY = global i32 0
@.str = [5 x i8] c"open\00"
@.str.1 = [6 x i8] c"fstat\00"
@PROT_READ = global i32 0
@MAP_PRIVATE = global i32 0
@MAP_FAILED = global i8* null
@.str.2 = [5 x i8] c"mmap\00"
@O_CREAT = global i32 0
@O_RDWR = global i32 0
@.str.3 = [10 x i8] c"ftruncate\00"
@PROT_WRITE = global i32 0
@MAP_SHARED = global i32 0
@.str.4 = [6 x i8] c"close\00"
@.str.5 = [7 x i8] c"munmap\00"
@MS_SYNC = global i32 0
@.str.6 = [6 x i8] c"msync\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.stat
%9 = alloca i8*
%10 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = load i32, i32* %4
%12 = icmp ne i32 %11, 3
br i1 %12, label %13, label %19
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 0
%16 = load i8*, i8** %15
%17 = load i32, i32* @EXIT_FAILURE
%18 = call i32 @helpAndExit(i8* %16, i32 %17)
br label %19
19: ; preds = %13, %2
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = load i32, i32* @O_RDONLY
%24 = call i32 (i8*, i32, ...) @open(i8* %22, i32 %23)
store i32 %24, i32* %6
%25 = load i32, i32* %6
%26 = icmp eq i32 %25, -1
br i1 %26, label %27, label %29
27: ; preds = %19
%28 = call i32 @pexit(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %29
29: ; preds = %27, %19
%30 = load i32, i32* %6
%31 = call i32 @fstat(i32 %30, %struct.stat* %8)
%32 = icmp eq i32 %31, -1
br i1 %32, label %33, label %35
33: ; preds = %29
%34 = call i32 @pexit(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %35
35: ; preds = %33, %29
%36 = getelementptr inbounds %struct.stat, %struct.stat* %8, i32 0, i32 0
%37 = load i32, i32* %36
%38 = load i32, i32* @PROT_READ
%39 = load i32, i32* @MAP_PRIVATE
%40 = load i32, i32* %6
%41 = call i8* @mmap(i32* null, i32 %37, i32 %38, i32 %39, i32 %40, i32 0)
store i8* %41, i8** %9
%42 = load i8*, i8** %9
%43 = load i8*, i8** @MAP_FAILED
%44 = icmp eq i8* %42, %43
br i1 %44, label %45, label %47
45: ; preds = %35
%46 = call i32 @pexit(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %47
47: ; preds = %45, %35
%48 = load i8**, i8*** %5
%49 = getelementptr inbounds i8*, i8** %48, i64 2
%50 = load i8*, i8** %49
%51 = load i32, i32* @O_CREAT
%52 = load i32, i32* @O_RDWR
%53 = or i32 %51, %52
%54 = getelementptr inbounds %struct.stat, %struct.stat* %8, i32 0, i32 1
%55 = load i32, i32* %54
%56 = call i32 (i8*, i32, ...) @open(i8* %50, i32 %53, i32 %55)
store i32 %56, i32* %7
%57 = load i32, i32* %7
%58 = icmp eq i32 %57, -1
br i1 %58, label %59, label %61
59: ; preds = %47
%60 = call i32 @pexit(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %61
61: ; preds = %59, %47
%62 = load i32, i32* %7
%63 = getelementptr inbounds %struct.stat, %struct.stat* %8, i32 0, i32 0
%64 = load i32, i32* %63
%65 = call i32 @ftruncate(i32 %62, i32 %64)
%66 = icmp eq i32 %65, -1
br i1 %66, label %67, label %69
67: ; preds = %61
%68 = call i32 @pexit(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
br label %69
69: ; preds = %67, %61
%70 = getelementptr inbounds %struct.stat, %struct.stat* %8, i32 0, i32 0
%71 = load i32, i32* %70
%72 = load i32, i32* @PROT_WRITE
%73 = load i32, i32* @MAP_SHARED
%74 = load i32, i32* %7
%75 = call i8* @mmap(i32* null, i32 %71, i32 %72, i32 %73, i32 %74, i32 0)
store i8* %75, i8** %10
%76 = load i8*, i8** %10
%77 = load i8*, i8** @MAP_FAILED
%78 = icmp eq i8* %76, %77
br i1 %78, label %79, label %81
79: ; preds = %69
%80 = call i32 @pexit(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %81
81: ; preds = %79, %69
%82 = load i8*, i8** %10
%83 = load i8*, i8** %9
%84 = getelementptr inbounds %struct.stat, %struct.stat* %8, i32 0, i32 0
%85 = load i32, i32* %84
%86 = call i32 @memcpy(i8* %82, i8* %83, i32 %85)
%87 = load i32, i32* %6
%88 = call i32 @close(i32 %87)
%89 = icmp eq i32 %88, -1
br i1 %89, label %90, label %92
90: ; preds = %81
%91 = call i32 @pexit(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %92
92: ; preds = %90, %81
%93 = load i32, i32* %7
%94 = call i32 @close(i32 %93)
%95 = icmp eq i32 %94, -1
br i1 %95, label %96, label %98
96: ; preds = %92
%97 = call i32 @pexit(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %98
98: ; preds = %96, %92
%99 = load i8*, i8** %9
%100 = getelementptr inbounds %struct.stat, %struct.stat* %8, i32 0, i32 0
%101 = load i32, i32* %100
%102 = call i32 @munmap(i8* %99, i32 %101)
%103 = icmp eq i32 %102, -1
br i1 %103, label %104, label %106
104: ; preds = %98
%105 = call i32 @pexit(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
br label %106
106: ; preds = %104, %98
%107 = load i8*, i8** %10
%108 = getelementptr inbounds %struct.stat, %struct.stat* %8, i32 0, i32 0
%109 = load i32, i32* %108
%110 = load i32, i32* @MS_SYNC
%111 = call i32 @msync(i8* %107, i32 %109, i32 %110)
%112 = icmp eq i32 %111, -1
br i1 %112, label %113, label %115
113: ; preds = %106
%114 = call i32 @pexit(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
br label %115
115: ; preds = %113, %106
%116 = load i8*, i8** %10
%117 = getelementptr inbounds %struct.stat, %struct.stat* %8, i32 0, i32 0
%118 = load i32, i32* %117
%119 = call i32 @munmap(i8* %116, i32 %118)
%120 = icmp eq i32 %119, -1
br i1 %120, label %121, label %123
121: ; preds = %115
%122 = call i32 @pexit(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
br label %123
123: ; preds = %121, %115
%124 = load i32, i32* @EXIT_SUCCESS
%125 = call i32 @exit(i32 %124)
unreachable
}

LLVM IR (-O2):
%struct.stat = type { i32, i32 }
@EXIT_FAILURE = global i32 0
@O_RDONLY = global i32 0
@.str = [5 x i8] c"open\00"
@.str.1 = [6 x i8] c"fstat\00"
@PROT_READ = global i32 0
@MAP_PRIVATE = global i32 0
@MAP_FAILED = global i8* null
@.str.2 = [5 x i8] c"mmap\00"
@O_CREAT = global i32 0
@O_RDWR = global i32 0
@.str.3 = [10 x i8] c"ftruncate\00"
@PROT_WRITE = global i32 0
@MAP_SHARED = global i32 0
@.str.4 = [6 x i8] c"close\00"
@.str.5 = [7 x i8] c"munmap\00"
@MS_SYNC = global i32 0
@.str.6 = [6 x i8] c"msync\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 = icmp eq i32 %0, 3
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = load i8*, i8** %1
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @helpAndExit(i8* %7, i32 %8)
br label %10
10: ; preds = %6, %2
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = load i32, i32* @O_RDONLY
%14 = tail call i32 (i8*, i32, ...) @open(i8* %12, i32 %13)
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %18
16: ; preds = %10
%17 = tail call i32 @pexit(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %10
%19 = call i32 @fstat(i32 %14, %struct.stat* %3)
%20 = icmp eq i32 %19, -1
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = tail call i32 @pexit(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %23
23: ; preds = %21, %18
%24 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
%25 = load i32, i32* %24
%26 = load i32, i32* @PROT_READ
%27 = load i32, i32* @MAP_PRIVATE
%28 = tail call i8* @mmap(i32* null, i32 %25, i32 %26, i32 %27, i32 %14, i32 0)
%29 = load i8*, i8** @MAP_FAILED
%30 = icmp eq i8* %28, %29
br i1 %30, label %31, label %33
31: ; preds = %23
%32 = tail call i32 @pexit(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %33
33: ; preds = %31, %23
%34 = getelementptr inbounds i8*, i8** %1, i64 2
%35 = load i8*, i8** %34
%36 = load i32, i32* @O_CREAT
%37 = load i32, i32* @O_RDWR
%38 = or i32 %37, %36
%39 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 1
%40 = load i32, i32* %39
%41 = tail call i32 (i8*, i32, ...) @open(i8* %35, i32 %38, i32 %40)
%42 = icmp eq i32 %41, -1
br i1 %42, label %43, label %45
43: ; preds = %33
%44 = tail call i32 @pexit(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %45
45: ; preds = %43, %33
%46 = tail call i32 @ftruncate(i32 %41, i32 %25)
%47 = icmp eq i32 %46, -1
br i1 %47, label %48, label %50
48: ; preds = %45
%49 = tail call i32 @pexit(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
br label %50
50: ; preds = %48, %45
%51 = load i32, i32* @PROT_WRITE
%52 = load i32, i32* @MAP_SHARED
%53 = tail call i8* @mmap(i32* null, i32 %25, i32 %51, i32 %52, i32 %41, i32 0)
%54 = load i8*, i8** @MAP_FAILED
%55 = icmp eq i8* %53, %54
br i1 %55, label %56, label %58
56: ; preds = %50
%57 = tail call i32 @pexit(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %58
58: ; preds = %56, %50
%59 = tail call i32 @memcpy(i8* %53, i8* %28, i32 %25)
%60 = tail call i32 @close(i32 %14)
%61 = icmp eq i32 %60, -1
br i1 %61, label %62, label %64
62: ; preds = %58
%63 = tail call i32 @pexit(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %64
64: ; preds = %62, %58
%65 = tail call i32 @close(i32 %41)
%66 = icmp eq i32 %65, -1
br i1 %66, label %67, label %69
67: ; preds = %64
%68 = tail call i32 @pexit(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %69
69: ; preds = %67, %64
%70 = tail call i32 @munmap(i8* %28, i32 %25)
%71 = icmp eq i32 %70, -1
br i1 %71, label %72, label %74
72: ; preds = %69
%73 = tail call i32 @pexit(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
br label %74
74: ; preds = %72, %69
%75 = load i32, i32* @MS_SYNC
%76 = tail call i32 @msync(i8* %53, i32 %25, i32 %75)
%77 = icmp eq i32 %76, -1
br i1 %77, label %78, label %80
78: ; preds = %74
%79 = tail call i32 @pexit(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
br label %80
80: ; preds = %78, %74
%81 = tail call i32 @munmap(i8* %53, i32 %25)
%82 = icmp eq i32 %81, -1
br i1 %82, label %83, label %85
83: ; preds = %80
%84 = tail call i32 @pexit(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
br label %85
85: ; preds = %83, %80
%86 = load i32, i32* @EXIT_SUCCESS
%87 = tail call i32 @exit(i32 %86)
unreachable
}