#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 int /*<<< orphan*/ ssize_t;
typedef int off_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
char *MAP_FAILED;
int /*<<< orphan*/ MS_SYNC;
int /*<<< orphan*/ O_RDWR;
int PROT_READ;
int PROT_WRITE;
int /*<<< orphan*/ _SC_PAGE_SIZE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int fstat(int, struct stat *);
int getpid();
char *mmap(int /*<<< orphan*/ *, size_t, int, int, int, int);
int /*<<< orphan*/ msync(char *, size_t, int /*<<< orphan*/);
int munmap(char *, size_t);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ stderr;
int sysconf(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  char *addr, strg;
  int fd;
  struct stat sb;
  off_t offset, pa_offset;
  size_t length;
  ssize_t s;
  int x, error;
  printf("My process ID : %d\n", getpid());
  fd = open("/mnt/pmfs/test", O_RDWR);
  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 = 0;
  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);
  }
  printf("sizes - %lld \n", sb.st_size);
  length = sb.st_size - offset;
  addr = mmap(NULL, length + offset - pa_offset, PROT_READ | PROT_WRITE, 0x04,
              fd, pa_offset);
  if (addr == MAP_FAILED)
    do {
      perror("mmap");
      exit(EXIT_FAILURE);
    } while (0);
  printf("ok\n");
stuff:
  scanf("%d", &x);
  if (x)
    offset = x;
  else
    goto out;
  addr[offset++] = 'b';
  addr[offset++] = 'y';
  printf("ok\n");
  goto stuff;
out:
  msync(addr, length, MS_SYNC);
  error = munmap(addr, length);
  if (error)
    printf("\nerror: %d", error);
  exit(EXIT_SUCCESS);
}


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    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xe1a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x2dec(%rip),%rax
mov    (%rax),%esi
lea    0xe17(%rip),%rdi
call   10a0 <open@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0xffffffff,-0x20(%rbp)
jne    122e <main+0x6e>
jmp    1214 <main+0x54>
lea    0xe08(%rip),%rdi
call   10b0 <perror@plt>
mov    0x2d99(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
mov    -0x20(%rbp),%edi
lea    -0x28(%rbp),%rsi
call   10e0 <fstat@plt>
cmp    $0xffffffff,%eax
jne    1262 <main+0xa2>
jmp    1248 <main+0x88>
lea    0xdd9(%rip),%rdi
call   10b0 <perror@plt>
mov    0x2d65(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x48(%rbp)
mov    0x2d3a(%rip),%rax
mov    (%rax),%edi
call   10c0 <sysconf@plt>
mov    %eax,%ecx
mov    -0x48(%rbp),%eax
sub    $0x1,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0x30(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x28(%rbp),%eax
jl     12bc <main+0xfc>
mov    0x2d30(%rip),%rax
mov    (%rax),%edi
lea    0xd85(%rip),%rsi
call   1070 <fprintf@plt>
mov    0x2d0b(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
mov    -0x28(%rbp),%esi
lea    0xd84(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x28(%rbp),%eax
sub    -0x2c(%rbp),%eax
cltq
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rsi
movslq -0x2c(%rbp),%rax
add    %rax,%rsi
movslq -0x30(%rbp),%rax
sub    %rax,%rsi
mov    0x2d06(%rip),%rax
mov    (%rax),%edx
mov    0x2cbd(%rip),%rax
or     (%rax),%edx
mov    -0x20(%rbp),%r8d
mov    -0x30(%rbp),%r9d
xor    %eax,%eax
mov    %eax,%edi
mov    $0x4,%ecx
call   1050 <mmap@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0x2c7e(%rip),%rcx
cmp    (%rcx),%rax
jne    134a <main+0x18a>
jmp    1330 <main+0x170>
lea    0xd22(%rip),%rdi
call   10b0 <perror@plt>
mov    0x2c7d(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
lea    0xd0d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xd0b(%rip),%rdi
lea    -0x40(%rbp),%rsi
call   1090 <scanf@plt>
cmpl   $0x0,-0x40(%rbp)
je     137d <main+0x1bd>
mov    -0x40(%rbp),%eax
mov    %eax,-0x2c(%rbp)
jmp    1382 <main+0x1c2>
jmp    13c1 <main+0x201>
mov    -0x18(%rbp),%rax
mov    -0x2c(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x2c(%rbp)
movslq %ecx,%rcx
movb   $0x62,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
mov    -0x2c(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x2c(%rbp)
movslq %ecx,%rcx
movb   $0x79,(%rax,%rcx,1)
lea    0xca9(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1358 <main+0x198>
mov    -0x18(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    0x2bf8(%rip),%rax
mov    (%rax),%edx
call   1040 <msync@plt>
mov    -0x18(%rbp),%rdi
mov    -0x38(%rbp),%rsi
call   1080 <munmap@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x0,-0x44(%rbp)
je     1402 <main+0x242>
mov    -0x44(%rbp),%esi
lea    0xc67(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x2b9f(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1040 <getpid@plt>
lea    0xe15(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x2de5(%rip),%rax
mov    (%rax),%esi
lea    0xe10(%rip),%rdi
call   10b0 <open@plt>
cmp    $0xffffffff,%eax
jne    121a <main+0x4a>
lea    0xe0e(%rip),%rdi
jmp    12b3 <main+0xe3>
mov    %eax,%ebx
lea    0x8(%rsp),%rsi
mov    %eax,%edi
call   10f0 <fstat@plt>
cmp    $0xffffffff,%eax
jne    1236 <main+0x66>
lea    0xdf4(%rip),%rdi
jmp    12b3 <main+0xe3>
mov    0x2d73(%rip),%rax
mov    (%rax),%edi
call   10d0 <sysconf@plt>
mov    0x8(%rsp),%r14d
test   %r14d,%r14d
jg     1265 <main+0x95>
mov    0x2d7b(%rip),%rax
mov    (%rax),%edi
lea    0xdd0(%rip),%rsi
call   1080 <fprintf@plt>
jmp    12b8 <main+0xe8>
lea    0xdde(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x2d7b(%rip),%rax
mov    0x2d34(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
xor    %edi,%edi
mov    %r14,%rsi
mov    $0x4,%ecx
mov    %ebx,%r8d
xor    %r9d,%r9d
call   1060 <mmap@plt>
mov    %rax,%rbx
mov    0x2cf9(%rip),%rax
cmp    (%rax),%rbx
jne    12c6 <main+0xf6>
lea    0xda6(%rip),%rdi
call   10c0 <perror@plt>
mov    0x2d01(%rip),%rax
mov    (%rax),%edi
call   10e0 <exit@plt>
lea    0xd9c(%rip),%rdi
call   1030 <puts@plt>
lea    0xd8d(%rip),%rdi
lea    0x4(%rsp),%rsi
call   10a0 <scanf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
je     1323 <main+0x153>
lea    0xd77(%rip),%r15
lea    0xd6d(%rip),%r12
lea    0x4(%rsp),%r13
xchg   %ax,%ax
cltq
movw   $0x7962,(%rbx,%rax,1)
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
mov    %r13,%rsi
call   10a0 <scanf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jne    1300 <main+0x130>
mov    0x2c9e(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <msync@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1090 <munmap@plt>
test   %eax,%eax
je     1356 <main+0x186>
lea    0xd11(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x2c4b(%rip),%rax
mov    (%rax),%edi
call   10e0 <exit@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [20 x i8] c"My process ID : %d\0A\00"
@.str.1 = [15 x i8] c"/mnt/pmfs/test\00"
@O_RDWR = global i32 0
@.str.2 = [5 x i8] c"open\00"
@EXIT_FAILURE = global i32 0
@.str.3 = [6 x i8] c"fstat\00"
@_SC_PAGE_SIZE = global i32 0
@stderr = global i32 0
@.str.4 = [28 x i8] c"offset is past end of file\0A\00"
@.str.5 = [15 x i8] c"sizes - %lld \0A\00"
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_FAILED = global i8* null
@.str.6 = [5 x i8] c"mmap\00"
@.str.7 = [4 x i8] c"ok\0A\00"
@.str.8 = [3 x i8] c"%d\00"
@MS_SYNC = global i32 0
@.str.9 = [11 x i8] c"\0Aerror: %d\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 i8
%8 = alloca i32
%9 = alloca %struct.stat
%10 = alloca i32
%11 = alloca i32
%12 = alloca i64
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%16 = call i32 (...) @getpid()
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %16)
%18 = load i32, i32* @O_RDWR
%19 = call i32 @open(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %18)
store i32 %19, i32* %8
%20 = load i32, i32* %8
%21 = icmp eq i32 %20, -1
br i1 %21, label %22, label %28
22: ; preds = %2
br label %23
23: ; preds = %22
%24 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%25 = load i32, i32* @EXIT_FAILURE
%26 = call i32 @exit(i32 %25)
unreachable
27: ; No predecessors!
br label %28
28: ; preds = %27, %2
%29 = load i32, i32* %8
%30 = call i32 @fstat(i32 %29, %struct.stat* %9)
%31 = icmp eq i32 %30, -1
br i1 %31, label %32, label %38
32: ; preds = %28
br label %33
33: ; preds = %32
%34 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%35 = load i32, i32* @EXIT_FAILURE
%36 = call i32 @exit(i32 %35)
unreachable
37: ; No predecessors!
br label %38
38: ; preds = %37, %28
store i32 0, i32* %10
%39 = load i32, i32* %10
%40 = load i32, i32* @_SC_PAGE_SIZE
%41 = call i32 @sysconf(i32 %40)
%42 = sub nsw i32 %41, 1
%43 = xor i32 %42, -1
%44 = and i32 %39, %43
store i32 %44, i32* %11
%45 = load i32, i32* %10
%46 = getelementptr inbounds %struct.stat, %struct.stat* %9, i32 0, i32 0
%47 = load i32, i32* %46
%48 = icmp sge i32 %45, %47
br i1 %48, label %49, label %54
49: ; preds = %38
%50 = load i32, i32* @stderr
%51 = call i32 @fprintf(i32 %50, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
%52 = load i32, i32* @EXIT_FAILURE
%53 = call i32 @exit(i32 %52)
unreachable
54: ; preds = %38
%55 = getelementptr inbounds %struct.stat, %struct.stat* %9, i32 0, i32 0
%56 = load i32, i32* %55
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 %56)
%58 = getelementptr inbounds %struct.stat, %struct.stat* %9, i32 0, i32 0
%59 = load i32, i32* %58
%60 = load i32, i32* %10
%61 = sub nsw i32 %59, %60
%62 = sext i32 %61 to i64
store i64 %62, i64* %12
%63 = load i64, i64* %12
%64 = load i32, i32* %10
%65 = sext i32 %64 to i64
%66 = add i64 %63, %65
%67 = load i32, i32* %11
%68 = sext i32 %67 to i64
%69 = sub i64 %66, %68
%70 = load i32, i32* @PROT_READ
%71 = load i32, i32* @PROT_WRITE
%72 = or i32 %70, %71
%73 = load i32, i32* %8
%74 = load i32, i32* %11
%75 = call i8* @mmap(i32* null, i64 %69, i32 %72, i32 4, i32 %73, i32 %74)
store i8* %75, i8** %6
%76 = load i8*, i8** %6
%77 = load i8*, i8** @MAP_FAILED
%78 = icmp eq i8* %76, %77
br i1 %78, label %79, label %85
79: ; preds = %54
br label %80
80: ; preds = %79
%81 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%82 = load i32, i32* @EXIT_FAILURE
%83 = call i32 @exit(i32 %82)
unreachable
84: ; No predecessors!
br label %85
85: ; preds = %84, %54
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
br label %87
87: ; preds = %94, %85
%88 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %14)
%89 = load i32, i32* %14
%90 = icmp ne i32 %89, 0
br i1 %90, label %91, label %93
91: ; preds = %87
%92 = load i32, i32* %14
store i32 %92, i32* %10
br label %94
93: ; preds = %87
br label %106
94: ; preds = %91
%95 = load i8*, i8** %6
%96 = load i32, i32* %10
%97 = add nsw i32 %96, 1
store i32 %97, i32* %10
%98 = sext i32 %96 to i64
%99 = getelementptr inbounds i8, i8* %95, i64 %98
store i8 98, i8* %99
%100 = load i8*, i8** %6
%101 = load i32, i32* %10
%102 = add nsw i32 %101, 1
store i32 %102, i32* %10
%103 = sext i32 %101 to i64
%104 = getelementptr inbounds i8, i8* %100, i64 %103
store i8 121, i8* %104
%105 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
br label %87
106: ; preds = %93
%107 = load i8*, i8** %6
%108 = load i64, i64* %12
%109 = load i32, i32* @MS_SYNC
%110 = call i32 @msync(i8* %107, i64 %108, i32 %109)
%111 = load i8*, i8** %6
%112 = load i64, i64* %12
%113 = call i32 @munmap(i8* %111, i64 %112)
store i32 %113, i32* %15
%114 = load i32, i32* %15
%115 = icmp ne i32 %114, 0
br i1 %115, label %116, label %119
116: ; preds = %106
%117 = load i32, i32* %15
%118 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0), i32 %117)
br label %119
119: ; preds = %116, %106
%120 = load i32, i32* @EXIT_SUCCESS
%121 = call i32 @exit(i32 %120)
unreachable
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [20 x i8] c"My process ID : %d\0A\00"
@.str.1 = [15 x i8] c"/mnt/pmfs/test\00"
@O_RDWR = global i32 0
@.str.2 = [5 x i8] c"open\00"
@EXIT_FAILURE = global i32 0
@.str.3 = [6 x i8] c"fstat\00"
@_SC_PAGE_SIZE = global i32 0
@stderr = global i32 0
@.str.4 = [28 x i8] c"offset is past end of file\0A\00"
@.str.5 = [15 x i8] c"sizes - %lld \0A\00"
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_FAILED = global i8* null
@.str.6 = [5 x i8] c"mmap\00"
@.str.8 = [3 x i8] c"%d\00"
@MS_SYNC = global i32 0
@.str.9 = [11 x i8] c"\0Aerror: %d\00"
@EXIT_SUCCESS = global i32 0
@str.10 = [3 x i8] c"ok\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.stat
%4 = alloca i32
%5 = bitcast %struct.stat* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = tail call i32 (...) @getpid()
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* @O_RDWR
%10 = tail call i32 @open(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %16
12: ; preds = %2
%13 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%14 = load i32, i32* @EXIT_FAILURE
%15 = tail call i32 @exit(i32 %14)
unreachable
16: ; preds = %2
%17 = call i32 @fstat(i32 %10, %struct.stat* %3)
%18 = icmp eq i32 %17, -1
br i1 %18, label %19, label %23
19: ; preds = %16
%20 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%21 = load i32, i32* @EXIT_FAILURE
%22 = tail call i32 @exit(i32 %21)
unreachable
23: ; preds = %16
%24 = load i32, i32* @_SC_PAGE_SIZE
%25 = tail call i32 @sysconf(i32 %24)
%26 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
%27 = load i32, i32* %26
%28 = icmp slt i32 %27, 1
br i1 %28, label %29, label %34
29: ; preds = %23
%30 = load i32, i32* @stderr
%31 = tail call i32 @fprintf(i32 %30, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
%32 = load i32, i32* @EXIT_FAILURE
%33 = tail call i32 @exit(i32 %32)
unreachable
34: ; preds = %23
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 %27)
%36 = zext i32 %27 to i64
%37 = load i32, i32* @PROT_READ
%38 = load i32, i32* @PROT_WRITE
%39 = or i32 %38, %37
%40 = tail call i8* @mmap(i32* null, i64 %36, i32 %39, i32 4, i32 %10, i32 0)
%41 = load i8*, i8** @MAP_FAILED
%42 = icmp eq i8* %40, %41
br i1 %42, label %43, label %47
43: ; preds = %34
%44 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%45 = load i32, i32* @EXIT_FAILURE
%46 = tail call i32 @exit(i32 %45)
unreachable
47: ; preds = %34
%48 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.10, i64 0, i64 0))
%49 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %4)
%50 = load i32, i32* %4
%51 = icmp eq i32 %50, 0
br i1 %51, label %63, label %52
52: ; preds = %47, %52
%53 = phi i32 [ %61, %52 ], [ %50, %47 ]
%54 = add nsw i32 %53, 1
%55 = sext i32 %53 to i64
%56 = getelementptr inbounds i8, i8* %40, i64 %55
store i8 98, i8* %56
%57 = sext i32 %54 to i64
%58 = getelementptr inbounds i8, i8* %40, i64 %57
store i8 121, i8* %58
%59 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.10, i64 0, i64 0))
%60 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %4)
%61 = load i32, i32* %4
%62 = icmp eq i32 %61, 0
br i1 %62, label %63, label %52
63: ; preds = %52, %47
%64 = load i32, i32* @MS_SYNC
%65 = call i32 @msync(i8* %40, i64 %36, i32 %64)
%66 = call i32 @munmap(i8* %40, i64 %36)
%67 = icmp eq i32 %66, 0
br i1 %67, label %70, label %68
68: ; preds = %63
%69 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0), i32 %66)
br label %70
70: ; preds = %68, %63
%71 = load i32, i32* @EXIT_SUCCESS
%72 = call i32 @exit(i32 %71)
unreachable
}