#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;
};
typedef int /*<<< orphan*/ srcinfo;
typedef int /*<<< orphan*/ dstinfo;
typedef int /*<<< orphan*/ caddr_t;

/* Variables and functions */
char *MAP_FAILED;
int /*<<< orphan*/ MAP_SHARED;
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ O_RDWR;
int PROT_READ;
int PROT_WRITE;
size_t atol(char *);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ fstat(int, struct stat *);
int /*<<< orphan*/ memcpy(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ memset(struct stat *, int, int);
char *mmap(int /*<<< orphan*/, int /*<<< orphan*/, int, int /*<<< orphan*/, int,
           int /*<<< orphan*/);
int /*<<< orphan*/ munmap(char *, int /*<<< orphan*/);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, ...);
int /*<<< orphan*/ puts(char *);
int main(int argc, char *argv[]) {
  char *dstfile = argv[1];
  char *srcfile = argv[2];
  size_t offset = atol(argv[3]);
  int dstfd;
  int srcfd;
  printf("dst=%s, src=%s, offset=%lu\n", dstfile, srcfile, offset);
  dstfd = open(dstfile, O_RDWR);
  srcfd = open(srcfile, O_RDONLY);
  if (dstfd < 0 || srcfd < 0) {
    puts("Can't open file");
    return -1;
  }
  {
    struct stat dstinfo;
    struct stat srcinfo;
    char *dst_ptr;
    char *src_ptr;
    memset(&dstinfo, 0x00, sizeof(dstinfo));
    memset(&srcinfo, 0x00, sizeof(srcinfo));
    fstat(dstfd, &dstinfo);
    fstat(srcfd, &srcinfo);
    dst_ptr = mmap((caddr_t)0, dstinfo.st_size, PROT_READ | PROT_WRITE,
                   MAP_SHARED, dstfd, 0);
    src_ptr =
        mmap((caddr_t)0, srcinfo.st_size, PROT_READ, MAP_SHARED, srcfd, 0);
    if (dst_ptr == MAP_FAILED || src_ptr == MAP_FAILED) {
      puts("Failed: memmap");
      printf("dst_ptr=%p, src_ptr=%p\n", dst_ptr, src_ptr);
      printf("dst_size=%lu, src_size=%lu\n", dstinfo.st_size, srcinfo.st_size);
      return -1;
    }
    printf("dst_ptr=%p, offset=%lu, src_ptr=%p, size=%lu\n", dst_ptr, offset,
           src_ptr, srcinfo.st_size);
    printf("dstsize = %lu\n", dstinfo.st_size);
    memcpy(dst_ptr + offset, src_ptr, srcinfo.st_size);
    munmap(dst_ptr, dstinfo.st_size);
    munmap(src_ptr, srcinfo.st_size);
    close(srcfd);
    close(dstfd);
  }
  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    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   10a0 <atol@plt>
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
lea    0xe0e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    0x2dd4(%rip),%rax
mov    (%rax),%esi
call   10b0 <open@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x20(%rbp),%rdi
mov    0x2db7(%rip),%rax
mov    (%rax),%esi
call   10b0 <open@plt>
mov    %eax,-0x30(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jl     1237 <main+0x97>
cmpl   $0x0,-0x30(%rbp)
jge    124f <main+0xaf>
lea    0xdde(%rip),%rdi
call   1030 <puts@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13be <main+0x21e>
lea    -0x38(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1060 <memset@plt>
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1060 <memset@plt>
mov    -0x2c(%rbp),%edi
lea    -0x38(%rbp),%rsi
call   10c0 <fstat@plt>
mov    -0x30(%rbp),%edi
lea    -0x40(%rbp),%rsi
call   10c0 <fstat@plt>
mov    -0x38(%rbp),%esi
mov    0x2d67(%rip),%rax
mov    (%rax),%edx
mov    0x2d26(%rip),%rax
or     (%rax),%edx
mov    0x2d45(%rip),%rax
mov    (%rax),%ecx
mov    -0x2c(%rbp),%r8d
xor    %r9d,%r9d
mov    %r9d,%edi
call   1040 <mmap@plt>
mov    %rax,-0x48(%rbp)
mov    -0x40(%rbp),%esi
mov    0x2d36(%rip),%rax
mov    (%rax),%edx
mov    0x2d1d(%rip),%rax
mov    (%rax),%ecx
mov    -0x30(%rbp),%r8d
xor    %r9d,%r9d
mov    %r9d,%edi
call   1040 <mmap@plt>
mov    %rax,-0x50(%rbp)
mov    -0x48(%rbp),%rax
mov    0x2ccd(%rip),%rcx
cmp    (%rcx),%rax
je     1308 <main+0x168>
mov    -0x50(%rbp),%rax
mov    0x2cb9(%rip),%rcx
cmp    (%rcx),%rax
jne    134b <main+0x1ab>
lea    0xd1d(%rip),%rdi
call   1030 <puts@plt>
mov    -0x48(%rbp),%rsi
mov    -0x50(%rbp),%rdx
lea    0xd18(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movslq -0x38(%rbp),%rsi
mov    -0x40(%rbp),%edx
lea    0xd1b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13be <main+0x21e>
mov    -0x48(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x50(%rbp),%rcx
mov    -0x40(%rbp),%r8d
lea    0xd0d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movslq -0x38(%rbp),%rsi
lea    0xd29(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x48(%rbp),%rdi
add    -0x28(%rbp),%rdi
mov    -0x50(%rbp),%rsi
mov    -0x40(%rbp),%edx
call   1080 <memcpy@plt>
mov    -0x48(%rbp),%rdi
mov    -0x38(%rbp),%esi
call   1090 <munmap@plt>
mov    -0x50(%rbp),%rdi
mov    -0x40(%rbp),%esi
call   1090 <munmap@plt>
mov    -0x30(%rbp),%edi
call   1070 <close@plt>
mov    -0x2c(%rbp),%edi
call   1070 <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   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    0x8(%rsi),%rbx
mov    0x10(%rsi),%rbp
mov    0x18(%rsi),%rdi
call   10a0 <atol@plt>
mov    %rax,%r14
lea    0xe37(%rip),%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2df8(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   10b0 <open@plt>
mov    %eax,%r15d
mov    0x2ddc(%rip),%rax
mov    (%rax),%esi
mov    %rbp,%rdi
call   10b0 <open@plt>
mov    %eax,%r12d
or     %r15d,%eax
js     131b <main+0x17b>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1060 <memset@plt>
lea    0x8(%rsp),%rbp
mov    %rbp,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1060 <memset@plt>
mov    %r15d,%edi
mov    %rbx,%rsi
call   10c0 <fstat@plt>
mov    %r12d,%edi
mov    %rbp,%rsi
call   10c0 <fstat@plt>
mov    0x10(%rsp),%esi
mov    0x2da5(%rip),%r13
mov    0x2d66(%rip),%rax
mov    (%rax),%edx
or     0x0(%r13),%edx
mov    0x2d81(%rip),%rbp
mov    0x0(%rbp),%ecx
xor    %edi,%edi
mov    %r15d,%r8d
xor    %r9d,%r9d
call   1040 <mmap@plt>
mov    %rax,%rbx
mov    0x8(%rsp),%esi
mov    0x0(%r13),%edx
mov    0x0(%rbp),%ecx
xor    %edi,%edi
mov    %r12d,%r8d
xor    %r9d,%r9d
call   1040 <mmap@plt>
mov    %rax,%rbp
mov    0x2d1c(%rip),%rax
mov    (%rax),%rax
cmp    %rax,%rbx
je     1329 <main+0x189>
cmp    %rax,%rbp
je     1329 <main+0x189>
mov    0x8(%rsp),%r8d
lea    0xdb6(%rip),%rdi
xor    %r13d,%r13d
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %rbp,%rcx
xor    %eax,%eax
call   1050 <printf@plt>
movslq 0x10(%rsp),%rsi
lea    0xdc5(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
add    %r14,%rdi
mov    0x8(%rsp),%edx
mov    %rbp,%rsi
call   1080 <memcpy@plt>
mov    0x10(%rsp),%esi
mov    %rbx,%rdi
call   1090 <munmap@plt>
mov    0x8(%rsp),%esi
mov    %rbp,%rdi
call   1090 <munmap@plt>
mov    %r12d,%edi
call   1070 <close@plt>
mov    %r15d,%edi
call   1070 <close@plt>
jmp    1366 <main+0x1c6>
lea    0xcfa(%rip),%rdi
call   1030 <puts@plt>
jmp    1360 <main+0x1c0>
lea    0xcfc(%rip),%rdi
call   1030 <puts@plt>
lea    0xcff(%rip),%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1050 <printf@plt>
movslq 0x10(%rsp),%rsi
mov    0x8(%rsp),%edx
lea    0xcfa(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xffffffff,%r13d
mov    %r13d,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [28 x i8] c"dst=%s, src=%s, offset=%lu\0A\00"
@O_RDWR = global i32 0
@O_RDONLY = global i32 0
@.str.1 = [16 x i8] c"Can't open file\00"
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_SHARED = global i32 0
@MAP_FAILED = global i8* null
@.str.2 = [15 x i8] c"Failed: memmap\00"
@.str.3 = [24 x i8] c"dst_ptr=%p, src_ptr=%p\0A\00"
@.str.4 = [28 x i8] c"dst_size=%lu, src_size=%lu\0A\00"
@.str.5 = [46 x i8] c"dst_ptr=%p, offset=%lu, src_ptr=%p, size=%lu\0A\00"
@.str.6 = [15 x i8] c"dstsize = %lu\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32
%10 = alloca i32
%11 = alloca %struct.stat
%12 = alloca %struct.stat
%13 = alloca i8*
%14 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
store i8* %17, i8** %6
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 2
%20 = load i8*, i8** %19
store i8* %20, i8** %7
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 3
%23 = load i8*, i8** %22
%24 = call i64 @atol(i8* %23)
store i64 %24, i64* %8
%25 = load i8*, i8** %6
%26 = load i8*, i8** %7
%27 = load i64, i64* %8
%28 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %25, i8* %26, i64 %27)
%29 = load i8*, i8** %6
%30 = load i32, i32* @O_RDWR
%31 = call i32 @open(i8* %29, i32 %30)
store i32 %31, i32* %9
%32 = load i8*, i8** %7
%33 = load i32, i32* @O_RDONLY
%34 = call i32 @open(i8* %32, i32 %33)
store i32 %34, i32* %10
%35 = load i32, i32* %9
%36 = icmp slt i32 %35, 0
br i1 %36, label %40, label %37
37: ; preds = %2
%38 = load i32, i32* %10
%39 = icmp slt i32 %38, 0
br i1 %39, label %40, label %42
40: ; preds = %37, %2
%41 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %3
br label %113
42: ; preds = %37
%43 = call i32 @memset(%struct.stat* %11, i32 0, i32 4)
%44 = call i32 @memset(%struct.stat* %12, i32 0, i32 4)
%45 = load i32, i32* %9
%46 = call i32 @fstat(i32 %45, %struct.stat* %11)
%47 = load i32, i32* %10
%48 = call i32 @fstat(i32 %47, %struct.stat* %12)
%49 = getelementptr inbounds %struct.stat, %struct.stat* %11, i32 0, i32 0
%50 = load i32, i32* %49
%51 = load i32, i32* @PROT_READ
%52 = load i32, i32* @PROT_WRITE
%53 = or i32 %51, %52
%54 = load i32, i32* @MAP_SHARED
%55 = load i32, i32* %9
%56 = call i8* @mmap(i32 0, i32 %50, i32 %53, i32 %54, i32 %55, i32 0)
store i8* %56, i8** %13
%57 = getelementptr inbounds %struct.stat, %struct.stat* %12, i32 0, i32 0
%58 = load i32, i32* %57
%59 = load i32, i32* @PROT_READ
%60 = load i32, i32* @MAP_SHARED
%61 = load i32, i32* %10
%62 = call i8* @mmap(i32 0, i32 %58, i32 %59, i32 %60, i32 %61, i32 0)
store i8* %62, i8** %14
%63 = load i8*, i8** %13
%64 = load i8*, i8** @MAP_FAILED
%65 = icmp eq i8* %63, %64
br i1 %65, label %70, label %66
66: ; preds = %42
%67 = load i8*, i8** %14
%68 = load i8*, i8** @MAP_FAILED
%69 = icmp eq i8* %67, %68
br i1 %69, label %70, label %82
70: ; preds = %66, %42
%71 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%72 = load i8*, i8** %13
%73 = load i8*, i8** %14
%74 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i8* %72, i8* %73)
%75 = getelementptr inbounds %struct.stat, %struct.stat* %11, i32 0, i32 0
%76 = load i32, i32* %75
%77 = sext i32 %76 to i64
%78 = inttoptr i64 %77 to i8*
%79 = getelementptr inbounds %struct.stat, %struct.stat* %12, i32 0, i32 0
%80 = load i32, i32* %79
%81 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), i8* %78, i32 %80)
store i32 -1, i32* %3
br label %113
82: ; preds = %66
%83 = load i8*, i8** %13
%84 = load i64, i64* %8
%85 = load i8*, i8** %14
%86 = getelementptr inbounds %struct.stat, %struct.stat* %12, i32 0, i32 0
%87 = load i32, i32* %86
%88 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.5, i64 0, i64 0), i8* %83, i64 %84, i8* %85, i32 %87)
%89 = getelementptr inbounds %struct.stat, %struct.stat* %11, i32 0, i32 0
%90 = load i32, i32* %89
%91 = sext i32 %90 to i64
%92 = inttoptr i64 %91 to i8*
%93 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i8* %92)
%94 = load i8*, i8** %13
%95 = load i64, i64* %8
%96 = getelementptr inbounds i8, i8* %94, i64 %95
%97 = load i8*, i8** %14
%98 = getelementptr inbounds %struct.stat, %struct.stat* %12, i32 0, i32 0
%99 = load i32, i32* %98
%100 = call i32 @memcpy(i8* %96, i8* %97, i32 %99)
%101 = load i8*, i8** %13
%102 = getelementptr inbounds %struct.stat, %struct.stat* %11, i32 0, i32 0
%103 = load i32, i32* %102
%104 = call i32 @munmap(i8* %101, i32 %103)
%105 = load i8*, i8** %14
%106 = getelementptr inbounds %struct.stat, %struct.stat* %12, i32 0, i32 0
%107 = load i32, i32* %106
%108 = call i32 @munmap(i8* %105, i32 %107)
%109 = load i32, i32* %10
%110 = call i32 @close(i32 %109)
%111 = load i32, i32* %9
%112 = call i32 @close(i32 %111)
store i32 0, i32* %3
br label %113
113: ; preds = %82, %70, %40
%114 = load i32, i32* %3
ret i32 %114
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [28 x i8] c"dst=%s, src=%s, offset=%lu\0A\00"
@O_RDWR = global i32 0
@O_RDONLY = global i32 0
@.str.1 = [16 x i8] c"Can't open file\00"
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_SHARED = global i32 0
@MAP_FAILED = global i8* null
@.str.2 = [15 x i8] c"Failed: memmap\00"
@.str.3 = [24 x i8] c"dst_ptr=%p, src_ptr=%p\0A\00"
@.str.4 = [28 x i8] c"dst_size=%lu, src_size=%lu\0A\00"
@.str.5 = [46 x i8] c"dst_ptr=%p, offset=%lu, src_ptr=%p, size=%lu\0A\00"
@.str.6 = [15 x i8] c"dstsize = %lu\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.stat
%4 = alloca %struct.stat
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = getelementptr inbounds i8*, i8** %1, i64 2
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8*, i8** %1, i64 3
%10 = load i8*, i8** %9
%11 = tail call i64 @atol(i8* %10)
%12 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %8, i64 %11)
%13 = load i32, i32* @O_RDWR
%14 = tail call i32 @open(i8* %6, i32 %13)
%15 = load i32, i32* @O_RDONLY
%16 = tail call i32 @open(i8* %8, i32 %15)
%17 = or i32 %16, %14
%18 = icmp sgt i32 %17, -1
br i1 %18, label %21, label %19
19: ; preds = %2
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %68
21: ; preds = %2
%22 = bitcast %struct.stat* %3 to i8*
%23 = bitcast %struct.stat* %4 to i8*
%24 = call i32 @memset(%struct.stat* %3, i32 0, i32 4)
%25 = call i32 @memset(%struct.stat* %4, i32 0, i32 4)
%26 = call i32 @fstat(i32 %14, %struct.stat* %3)
%27 = call i32 @fstat(i32 %16, %struct.stat* %4)
%28 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
%29 = load i32, i32* %28
%30 = load i32, i32* @PROT_READ
%31 = load i32, i32* @PROT_WRITE
%32 = or i32 %31, %30
%33 = load i32, i32* @MAP_SHARED
%34 = call i8* @mmap(i32 0, i32 %29, i32 %32, i32 %33, i32 %14, i32 0)
%35 = getelementptr inbounds %struct.stat, %struct.stat* %4, i64 0, i32 0
%36 = load i32, i32* %35
%37 = load i32, i32* @PROT_READ
%38 = load i32, i32* @MAP_SHARED
%39 = call i8* @mmap(i32 0, i32 %36, i32 %37, i32 %38, i32 %16, i32 0)
%40 = load i8*, i8** @MAP_FAILED
%41 = icmp eq i8* %34, %40
%42 = icmp eq i8* %39, %40
%43 = select i1 %41, i1 true, i1 %42
br i1 %43, label %44, label %52
44: ; preds = %21
%45 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%46 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i8* %34, i8* %39)
%47 = load i32, i32* %28
%48 = sext i32 %47 to i64
%49 = inttoptr i64 %48 to i8*
%50 = load i32, i32* %35
%51 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), i8* %49, i32 %50)
br label %68
52: ; preds = %21
%53 = load i32, i32* %35
%54 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.5, i64 0, i64 0), i8* %34, i64 %11, i8* %39, i32 %53)
%55 = load i32, i32* %28
%56 = sext i32 %55 to i64
%57 = inttoptr i64 %56 to i8*
%58 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i8* %57)
%59 = getelementptr inbounds i8, i8* %34, i64 %11
%60 = load i32, i32* %35
%61 = call i32 @memcpy(i8* %59, i8* %39, i32 %60)
%62 = load i32, i32* %28
%63 = call i32 @munmap(i8* %34, i32 %62)
%64 = load i32, i32* %35
%65 = call i32 @munmap(i8* %39, i32 %64)
%66 = call i32 @close(i32 %16)
%67 = call i32 @close(i32 %14)
br label %68
68: ; preds = %52, %44, %19
%69 = phi i32 [ -1, %19 ], [ 0, %52 ], [ -1, %44 ]
ret i32 %69
}