#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 {
  scalar_t__ st_size;
};
typedef scalar_t__ off_t;

/* Variables and functions */
void *MAP_FAILED;
int /*<<< orphan*/ MAP_SHARED;
int O_CREAT;
int /*<<< orphan*/ O_RDONLY;
int O_RDWR;
int O_TRUNC;
int PROT_READ;
int PROT_WRITE;
int S_IRGRP;
int S_IROTH;
int S_IRUSR;
int S_IWUSR;
int /*<<< orphan*/ err_quit(char *, char *);
int /*<<< orphan*/ err_sys(char *, ...);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fstat(int, struct stat *);
scalar_t__ ftruncate(int, scalar_t__);
int /*<<< orphan*/ memcpy(void *, void *, size_t);
void *mmap(int /*<<< orphan*/, size_t, int, int /*<<< orphan*/, int,
           scalar_t__);
int /*<<< orphan*/ munmap(void *, size_t);
int open(char *, int, ...);
int main(int argc, char *argv[]) {
  int fdin, fdout;
  void *src, *dst;
  size_t copysz;
  struct stat sbuf;
  off_t fsz = 0;
  if (argc != 3)
    err_quit("usage: %s <fromfile> <tofile>", argv[0]);
  if ((fdin = open(argv[1], O_RDONLY)) < 0)
    err_sys("can't open %s for reading", argv[1]);
  if ((fdout = open(argv[2], O_RDWR | O_CREAT | O_TRUNC,
                    (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH))) < 0)
    err_sys("can't creat %s for writing", argv[2]);
  if (fstat(fdin, &sbuf) < 0)
    err_sys("fstat error");
  if (ftruncate(fdout, sbuf.st_size) < 0)
    err_sys("ftruncate error");
  while (fsz < sbuf.st_size) {
    if ((sbuf.st_size - fsz) > (1024 * 1024 * 1024))
      copysz = (1024 * 1024 * 1024);
    else
      copysz = sbuf.st_size - fsz;
    if ((src = mmap(0, copysz, PROT_READ, MAP_SHARED, fdin, fsz)) == MAP_FAILED)
      err_sys("mmap error for input");
    if ((dst = mmap(0, copysz, PROT_READ | PROT_WRITE, MAP_SHARED, fdout,
                    fsz)) == MAP_FAILED)
      err_sys("mmap error for output");
    memcpy(dst, src, copysz);
    munmap(src, copysz);
    munmap(dst, copysz);
    fsz += copysz;
  }
  exit(0);
}


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)
movq   $0x0,-0x40(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     11cb <main+0x3b>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe3a(%rip),%rdi
call   1060 <err_quit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2de6(%rip),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   1090 <open@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    1205 <main+0x75>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe20(%rip),%rdi
mov    $0x0,%al
call   1030 <err_sys@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    0x2db4(%rip),%rax
mov    (%rax),%esi
mov    0x2ddb(%rip),%rax
or     (%rax),%esi
mov    0x2dca(%rip),%rax
or     (%rax),%esi
mov    0x2d61(%rip),%rax
mov    (%rax),%edx
mov    0x2d80(%rip),%rax
or     (%rax),%edx
mov    0x2d67(%rip),%rax
or     (%rax),%edx
mov    0x2d56(%rip),%rax
or     (%rax),%edx
mov    $0x0,%al
call   1090 <open@plt>
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
jge    1275 <main+0xe5>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
lea    0xdca(%rip),%rdi
mov    $0x0,%al
call   1030 <err_sys@plt>
mov    -0x14(%rbp),%edi
lea    -0x38(%rbp),%rsi
call   10b0 <fstat@plt>
cmp    $0x0,%rax
jge    1299 <main+0x109>
lea    0xdc1(%rip),%rdi
mov    $0x0,%al
call   1030 <err_sys@plt>
mov    -0x18(%rbp),%edi
mov    -0x38(%rbp),%rsi
call   1050 <ftruncate@plt>
cmp    $0x0,%rax
jge    12bd <main+0x12d>
lea    0xda9(%rip),%rdi
mov    $0x0,%al
call   1030 <err_sys@plt>
jmp    12c2 <main+0x132>
mov    -0x40(%rbp),%rax
cmp    -0x38(%rbp),%rax
jge    13d0 <main+0x240>
mov    -0x38(%rbp),%rax
sub    -0x40(%rbp),%rax
cmp    $0x40000000,%rax
jle    12f1 <main+0x161>
movq   $0x40000000,-0x30(%rbp)
40
jmp    12fd <main+0x16d>
mov    -0x38(%rbp),%rax
sub    -0x40(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rsi
mov    0x2ce0(%rip),%rax
mov    (%rax),%edx
mov    0x2cc7(%rip),%rax
mov    (%rax),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x40(%rbp),%r9
xor    %edi,%edi
call   1040 <mmap@plt>
mov    %rax,-0x20(%rbp)
mov    0x2c5b(%rip),%rcx
cmp    (%rcx),%rax
jne    1344 <main+0x1b4>
lea    0xd32(%rip),%rdi
mov    $0x0,%al
call   1030 <err_sys@plt>
mov    -0x30(%rbp),%rsi
mov    0x2c99(%rip),%rax
mov    (%rax),%edx
mov    0x2c40(%rip),%rax
or     (%rax),%edx
mov    0x2c77(%rip),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x40(%rbp),%r9
xor    %edi,%edi
call   1040 <mmap@plt>
mov    %rax,-0x28(%rbp)
mov    0x2c0b(%rip),%rcx
cmp    (%rcx),%rax
jne    1394 <main+0x204>
lea    0xcf7(%rip),%rdi
mov    $0x0,%al
call   1030 <err_sys@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x30(%rbp),%rdx
call   1070 <memcpy@plt>
mov    -0x20(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1080 <munmap@plt>
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1080 <munmap@plt>
mov    -0x30(%rbp),%rax
add    -0x40(%rbp),%rax
mov    %rax,-0x40(%rbp)
jmp    12c2 <main+0x132>
xor    %edi,%edi
call   10a0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
cmp    $0x3,%edi
je     11b5 <main+0x25>
mov    (%rbx),%rsi
lea    0xe50(%rip),%rdi
call   1060 <err_quit@plt>
mov    0x8(%rbx),%rdi
mov    0x2e00(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
call   1090 <open@plt>
mov    %eax,0x4(%rsp)
test   %eax,%eax
jns    11e3 <main+0x53>
mov    0x8(%rbx),%rsi
lea    0xe42(%rip),%rdi
xor    %eax,%eax
call   1030 <err_sys@plt>
mov    0x2dde(%rip),%rax
mov    0x2e07(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2df4(%rip),%rax
or     (%rax),%esi
mov    0x2d8b(%rip),%rax
mov    0x2dac(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    0x2d91(%rip),%rax
or     (%rax),%edx
mov    0x10(%rbx),%rdi
mov    0x2d7c(%rip),%rax
or     (%rax),%edx
xor    %eax,%eax
call   1090 <open@plt>
mov    %eax,(%rsp)
test   %eax,%eax
jns    1246 <main+0xb6>
mov    0x10(%rbx),%rsi
lea    0xdf9(%rip),%rdi
xor    %eax,%eax
call   1030 <err_sys@plt>
lea    0x10(%rsp),%rsi
mov    0x4(%rsp),%edi
call   10b0 <fstat@plt>
test   %rax,%rax
jns    1267 <main+0xd7>
lea    0xdf3(%rip),%rdi
xor    %eax,%eax
call   1030 <err_sys@plt>
mov    0x10(%rsp),%rbx
mov    (%rsp),%edi
mov    %rbx,%rsi
call   1050 <ftruncate@plt>
test   %rax,%rax
jns    128a <main+0xfa>
lea    0xddc(%rip),%rdi
xor    %eax,%eax
call   1030 <err_sys@plt>
test   %rbx,%rbx
jle    137c <main+0x1ec>
mov    0x2d4e(%rip),%r14
mov    0x2d37(%rip),%r15
xor    %ebp,%ebp
mov    %rbx,0x8(%rsp)
jmp    12f3 <main+0x163>
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1070 <memcpy@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1080 <munmap@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1080 <munmap@plt>
add    %rbx,%rbp
mov    0x8(%rsp),%rbx
cmp    %rbp,%rbx
mov    0x2d02(%rip),%r14
mov    0x2ceb(%rip),%r15
jle    137c <main+0x1ec>
sub    %rbp,%rbx
cmp    $0x40000000,%rbx
mov    $0x40000000,%eax
cmovge %rax,%rbx
mov    (%r14),%edx
mov    (%r15),%ecx
xor    %edi,%edi
mov    %rbx,%rsi
mov    0x4(%rsp),%r8d
mov    %rbp,%r9
call   1040 <mmap@plt>
mov    %rax,%r12
mov    0x2c60(%rip),%r13
cmp    0x0(%r13),%rax
jne    133c <main+0x1ac>
lea    0xd3a(%rip),%rdi
xor    %eax,%eax
call   1030 <err_sys@plt>
mov    0x2c55(%rip),%rax
mov    (%rax),%edx
or     (%r14),%edx
mov    (%r15),%ecx
xor    %edi,%edi
mov    %rbx,%rsi
mov    (%rsp),%r8d
mov    %rbp,%r9
call   1040 <mmap@plt>
mov    %rax,%r14
cmp    0x0(%r13),%rax
jne    12b0 <main+0x120>
lea    0xd14(%rip),%rdi
xor    %eax,%eax
call   1030 <err_sys@plt>
jmp    12b0 <main+0x120>
xor    %edi,%edi
call   10a0 <exit@plt>

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

LLVM IR (-O2):
%struct.stat = type { i64 }
@.str = [30 x i8] c"usage: %s <fromfile> <tofile>\00"
@O_RDONLY = global i32 0
@.str.1 = [26 x i8] c"can't open %s for reading\00"
@O_RDWR = global i32 0
@O_CREAT = global i32 0
@O_TRUNC = global i32 0
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@S_IRGRP = global i32 0
@S_IROTH = global i32 0
@.str.2 = [27 x i8] c"can't creat %s for writing\00"
@.str.3 = [12 x i8] c"fstat error\00"
@.str.4 = [16 x i8] c"ftruncate error\00"
@PROT_READ = global i32 0
@MAP_SHARED = global i32 0
@MAP_FAILED = global i8* null
@.str.5 = [21 x i8] c"mmap error for input\00"
@PROT_WRITE = global i32 0
@.str.6 = [22 x i8] c"mmap error for output\00"
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 %9, label %6
6: ; preds = %2
%7 = load i8*, i8** %1
%8 = tail call i32 @err_quit(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %9
9: ; preds = %6, %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = load i32, i32* @O_RDONLY
%13 = tail call i32 (i8*, i32, ...) @open(i8* %11, i32 %12)
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %9
%16 = load i8*, i8** %10
%17 = tail call i32 (i8*, ...) @err_sys(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %16)
br label %18
18: ; preds = %15, %9
%19 = getelementptr inbounds i8*, i8** %1, i64 2
%20 = load i8*, i8** %19
%21 = load i32, i32* @O_RDWR
%22 = load i32, i32* @O_CREAT
%23 = or i32 %22, %21
%24 = load i32, i32* @O_TRUNC
%25 = or i32 %23, %24
%26 = load i32, i32* @S_IRUSR
%27 = load i32, i32* @S_IWUSR
%28 = or i32 %27, %26
%29 = load i32, i32* @S_IRGRP
%30 = or i32 %28, %29
%31 = load i32, i32* @S_IROTH
%32 = or i32 %30, %31
%33 = tail call i32 (i8*, i32, ...) @open(i8* %20, i32 %25, i32 %32)
%34 = icmp slt i32 %33, 0
br i1 %34, label %35, label %38
35: ; preds = %18
%36 = load i8*, i8** %19
%37 = tail call i32 (i8*, ...) @err_sys(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i8* %36)
br label %38
38: ; preds = %35, %18
%39 = call i64 @fstat(i32 %13, %struct.stat* %3)
%40 = icmp slt i64 %39, 0
br i1 %40, label %41, label %43
41: ; preds = %38
%42 = tail call i32 (i8*, ...) @err_sys(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %43
43: ; preds = %41, %38
%44 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
%45 = load i64, i64* %44
%46 = tail call i64 @ftruncate(i32 %33, i64 %45)
%47 = icmp slt i64 %46, 0
br i1 %47, label %48, label %50
48: ; preds = %43
%49 = tail call i32 (i8*, ...) @err_sys(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
br label %50
50: ; preds = %48, %43
%51 = icmp sgt i64 %45, 0
br i1 %51, label %52, label %80
52: ; preds = %50, %74
%53 = phi i64 [ %78, %74 ], [ 0, %50 ]
%54 = sub nsw i64 %45, %53
%55 = icmp slt i64 %54, 1073741824
%56 = select i1 %55, i64 %54, i64 1073741824
%57 = load i32, i32* @PROT_READ
%58 = load i32, i32* @MAP_SHARED
%59 = tail call i8* @mmap(i32 0, i64 %56, i32 %57, i32 %58, i32 %13, i64 %53)
%60 = load i8*, i8** @MAP_FAILED
%61 = icmp eq i8* %59, %60
br i1 %61, label %62, label %64
62: ; preds = %52
%63 = tail call i32 (i8*, ...) @err_sys(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0))
br label %64
64: ; preds = %62, %52
%65 = load i32, i32* @PROT_READ
%66 = load i32, i32* @PROT_WRITE
%67 = or i32 %66, %65
%68 = load i32, i32* @MAP_SHARED
%69 = tail call i8* @mmap(i32 0, i64 %56, i32 %67, i32 %68, i32 %33, i64 %53)
%70 = load i8*, i8** @MAP_FAILED
%71 = icmp eq i8* %69, %70
br i1 %71, label %72, label %74
72: ; preds = %64
%73 = tail call i32 (i8*, ...) @err_sys(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0))
br label %74
74: ; preds = %72, %64
%75 = tail call i32 @memcpy(i8* %69, i8* %59, i64 %56)
%76 = tail call i32 @munmap(i8* %59, i64 %56)
%77 = tail call i32 @munmap(i8* %69, i64 %56)
%78 = add i64 %56, %53
%79 = icmp sgt i64 %45, %78
br i1 %79, label %52, label %80
80: ; preds = %74, %50
%81 = tail call i32 @exit(i32 0)
unreachable
}