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

/* Variables and functions */
void *MAP_FAILED;
int /*<<< orphan*/ MAP_PRIVATE;
int /*<<< orphan*/ MS_SYNC;
int O_CREAT;
int O_EXCL;
int O_RDWR;
int PROT_READ;
int PROT_WRITE;
int S_IRUSR;
int S_IWUSR;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ free(char *);
int getpid();
char *malloc(scalar_t__);
int /*<<< orphan*/ memset(char *, char, scalar_t__);
void *mmap(int /*<<< orphan*/ *, scalar_t__, int, int /*<<< orphan*/, int,
           int /*<<< orphan*/);
scalar_t__ msync(void *, scalar_t__, int /*<<< orphan*/);
int /*<<< orphan*/ munmap(void *, scalar_t__);
int open(char *, int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
char *strerror(int /*<<< orphan*/);
int /*<<< orphan*/ unlink(char *);
scalar_t__ write(int, char *, scalar_t__);
int main(void) {
  char tmpfname[256];
  char *data;
  void *pa;
  ssize_t size = 1024;
  int fd;
  snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_mmap_7_2_%d", getpid());
  unlink(tmpfname);
  fd = open(tmpfname, O_CREAT | O_RDWR | O_EXCL, S_IRUSR | S_IWUSR);
  if (fd == -1) {
    printf("Error at open(): %s\n", strerror(errno));
    return 2;
  }
  unlink(tmpfname);
  data = malloc(size);
  memset(data, 'a', size);
  if (write(fd, data, size) != size) {
    printf("Error at write(): %s\n", strerror(errno));
    return 2;
  }
  free(data);
  pa = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
  if (pa == MAP_FAILED) {
    printf("Error at mmap(): %s\n", strerror(errno));
    return 1;
  }
  *(char *)pa = 'b';
  if (msync(pa, size, MS_SYNC) != 0) {
    printf("Error at msync(): %s\n", strerror(errno));
    return 2;
  }
  munmap(pa, size);
  pa = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
  if (pa == MAP_FAILED) {
    printf("Error at 2nd mmap(): %s\n", strerror(errno));
    return 1;
  }
  if (*(char *)pa == 'b') {
    printf("Memory write with MAP_PRIVATE has changed "
           "the underlying file\n"
           "Test FAILED\n");
    exit(1);
  }
  close(fd);
  printf("Memory write with MAP_PRIVATE has not changed "
         "the underlying file\n"
         "Test PASSED\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x400,-0x128(%rbp)
lea    -0x110(%rbp),%rax
mov    %rax,-0x138(%rbp)
mov    $0x0,%al
call   1060 <getpid@plt>
mov    -0x138(%rbp),%rdi
mov    %eax,%ecx
mov    $0x100,%esi
lea    0xdc9(%rip),%rdx
call   10a0 <snprintf@plt>
lea    -0x110(%rbp),%rdi
call   1040 <unlink@plt>
lea    -0x110(%rbp),%rdi
mov    0x2da2(%rip),%rax
mov    (%rax),%esi
mov    0x2d79(%rip),%rax
or     (%rax),%esi
mov    0x2d58(%rip),%rax
or     (%rax),%esi
mov    0x2d2f(%rip),%rax
mov    (%rax),%edx
mov    0x2d56(%rip),%rax
or     (%rax),%edx
call   10f0 <open@plt>
mov    %eax,-0x12c(%rbp)
cmpl   $0xffffffff,-0x12c(%rbp)
jne    12bf <main+0xcf>
mov    0x2d1d(%rip),%rax
mov    (%rax),%edi
call   1110 <strerror@plt>
mov    %rax,%rsi
lea    0xd69(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
movl   $0x2,-0x4(%rbp)
jmp    1508 <main+0x318>
lea    -0x110(%rbp),%rdi
call   1040 <unlink@plt>
mov    -0x128(%rbp),%rdi
call   10d0 <malloc@plt>
mov    %rax,-0x118(%rbp)
mov    -0x118(%rbp),%rdi
mov    -0x128(%rbp),%rdx
mov    $0x61,%esi
call   10b0 <memset@plt>
mov    -0x12c(%rbp),%edi
mov    -0x118(%rbp),%rsi
mov    -0x128(%rbp),%rdx
call   1050 <write@plt>
cmp    -0x128(%rbp),%rax
je     1347 <main+0x157>
mov    0x2c95(%rip),%rax
mov    (%rax),%edi
call   1110 <strerror@plt>
mov    %rax,%rsi
lea    0xcf6(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
movl   $0x2,-0x4(%rbp)
jmp    1508 <main+0x318>
mov    -0x118(%rbp),%rdi
call   1030 <free@plt>
mov    -0x128(%rbp),%rsi
mov    0x2c8f(%rip),%rax
mov    (%rax),%edx
mov    0x2c3e(%rip),%rax
or     (%rax),%edx
mov    0x2c25(%rip),%rax
mov    (%rax),%ecx
mov    -0x12c(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%edi
xor    %r9d,%r9d
call   1080 <mmap@plt>
mov    %rax,-0x120(%rbp)
mov    -0x120(%rbp),%rax
mov    0x2bf3(%rip),%rcx
cmp    (%rcx),%rax
jne    13d1 <main+0x1e1>
mov    0x2c0b(%rip),%rax
mov    (%rax),%edi
call   1110 <strerror@plt>
mov    %rax,%rsi
lea    0xc82(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1508 <main+0x318>
mov    -0x120(%rbp),%rax
movb   $0x62,(%rax)
mov    -0x120(%rbp),%rdi
mov    -0x128(%rbp),%rsi
mov    0x2bc0(%rip),%rax
mov    (%rax),%edx
call   1070 <msync@plt>
cmp    $0x0,%rax
je     142c <main+0x23c>
mov    0x2bb0(%rip),%rax
mov    (%rax),%edi
call   1110 <strerror@plt>
mov    %rax,%rsi
lea    0xc3c(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
movl   $0x2,-0x4(%rbp)
jmp    1508 <main+0x318>
mov    -0x120(%rbp),%rdi
mov    -0x128(%rbp),%rsi
call   10e0 <munmap@plt>
mov    -0x128(%rbp),%rsi
mov    0x2ba3(%rip),%rax
mov    (%rax),%edx
mov    0x2b52(%rip),%rax
or     (%rax),%edx
mov    0x2b39(%rip),%rax
mov    (%rax),%ecx
mov    -0x12c(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%edi
xor    %r9d,%r9d
call   1080 <mmap@plt>
mov    %rax,-0x120(%rbp)
mov    -0x120(%rbp),%rax
mov    0x2b07(%rip),%rcx
cmp    (%rcx),%rax
jne    14bd <main+0x2cd>
mov    0x2b1f(%rip),%rax
mov    (%rax),%edi
call   1110 <strerror@plt>
mov    %rax,%rsi
lea    0xbc1(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1508 <main+0x318>
mov    -0x120(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x62,%eax
jne    14e8 <main+0x2f8>
lea    0xbad(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
mov    -0x12c(%rbp),%edi
call   10c0 <close@plt>
lea    0xbd5(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x108,%rsp
xor    %eax,%eax
call   1070 <getpid@plt>
lea    0xde1(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x100,%esi
mov    %eax,%ecx
call   10b0 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <unlink@plt>
mov    0x2db8(%rip),%rax
mov    0x2d91(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2d6e(%rip),%rax
or     (%rax),%esi
mov    0x2d45(%rip),%rax
mov    0x2d6e(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    %rbx,%rdi
call   1100 <open@plt>
cmp    $0xffffffff,%eax
je     1341 <main+0x141>
mov    %eax,%ebp
mov    %rsp,%rdi
call   1040 <unlink@plt>
mov    $0x400,%edi
call   10e0 <malloc@plt>
mov    %rax,%rbx
mov    $0x400,%edx
mov    %rax,%rdi
mov    $0x61,%esi
call   10c0 <memset@plt>
mov    $0x400,%edx
mov    %ebp,%edi
mov    %rbx,%rsi
call   1060 <write@plt>
cmp    $0x400,%rax
jne    1358 <main+0x158>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    0x2d26(%rip),%r15
mov    0x2cd7(%rip),%r12
mov    (%r12),%edx
or     (%r15),%edx
mov    0x2cb9(%rip),%r13
mov    0x0(%r13),%ecx
mov    $0x400,%esi
xor    %edi,%edi
mov    %ebp,%r8d
xor    %r9d,%r9d
call   1090 <mmap@plt>
mov    0x2c94(%rip),%rbx
cmp    (%rbx),%rax
je     138e <main+0x18e>
mov    %rax,%r14
movb   $0x62,(%rax)
mov    0x2c9e(%rip),%rax
mov    (%rax),%edx
mov    $0x400,%esi
mov    %r14,%rdi
call   1080 <msync@plt>
test   %rax,%rax
je     13b4 <main+0x1b4>
mov    0x2c87(%rip),%rax
mov    (%rax),%edi
call   1120 <strerror@plt>
lea    0xd16(%rip),%rdi
jmp    136d <main+0x16d>
mov    0x2c70(%rip),%rax
mov    (%rax),%edi
call   1120 <strerror@plt>
lea    0xcbf(%rip),%rdi
jmp    136d <main+0x16d>
mov    0x2c59(%rip),%rax
mov    (%rax),%edi
call   1120 <strerror@plt>
lea    0xcbd(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   10a0 <printf@plt>
mov    $0x2,%eax
add    $0x108,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2c23(%rip),%rax
mov    (%rax),%edi
call   1120 <strerror@plt>
lea    0xc9d(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   10a0 <printf@plt>
mov    $0x1,%eax
jmp    137c <main+0x17c>
mov    $0x400,%esi
mov    %r14,%rdi
call   10f0 <munmap@plt>
mov    (%r12),%edx
or     (%r15),%edx
mov    0x0(%r13),%ecx
mov    $0x400,%esi
xor    %edi,%edi
mov    %ebp,%r8d
xor    %r9d,%r9d
call   1090 <mmap@plt>
cmp    (%rbx),%rax
je     1402 <main+0x202>
cmpb   $0x62,(%rax)
je     1419 <main+0x219>
mov    %ebp,%edi
call   10d0 <close@plt>
lea    0xc8e(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
jmp    137c <main+0x17c>
mov    0x2baf(%rip),%rax
mov    (%rax),%edi
call   1120 <strerror@plt>
lea    0xc54(%rip),%rdi
jmp    13a3 <main+0x1a3>
lea    0xcb2(%rip),%rdi
call   1050 <puts@plt>
mov    $0x1,%edi
call   1110 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"/tmp/pts_mmap_7_2_%d\00"
@O_CREAT = global i32 0
@O_RDWR = global i32 0
@O_EXCL = global i32 0
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@.str.1 = [21 x i8] c"Error at open(): %s\0A\00"
@errno = global i32 0
@.str.2 = [22 x i8] c"Error at write(): %s\0A\00"
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_PRIVATE = global i32 0
@MAP_FAILED = global i8* null
@.str.3 = [21 x i8] c"Error at mmap(): %s\0A\00"
@MS_SYNC = global i32 0
@.str.4 = [22 x i8] c"Error at msync(): %s\0A\00"
@.str.5 = [25 x i8] c"Error at 2nd mmap(): %s\0A\00"
@.str.6 = [75 x i8] c"Memory write with MAP_PRIVATE has changed the underlying file\0ATest FAILED\0A\00"
@.str.7 = [79 x i8] c"Memory write with MAP_PRIVATE has not changed the underlying file\0ATest PASSED\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [256 x i8]
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
store i32 0, i32* %1
store i64 1024, i64* %5
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%8 = call i32 (...) @getpid()
%9 = call i32 @snprintf(i8* %7, i32 256, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%11 = call i32 @unlink(i8* %10)
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%13 = load i32, i32* @O_CREAT
%14 = load i32, i32* @O_RDWR
%15 = or i32 %13, %14
%16 = load i32, i32* @O_EXCL
%17 = or i32 %15, %16
%18 = load i32, i32* @S_IRUSR
%19 = load i32, i32* @S_IWUSR
%20 = or i32 %18, %19
%21 = call i32 @open(i8* %12, i32 %17, i32 %20)
store i32 %21, i32* %6
%22 = load i32, i32* %6
%23 = icmp eq i32 %22, -1
br i1 %23, label %24, label %28
24: ; preds = %0
%25 = load i32, i32* @errno
%26 = call i8* @strerror(i32 %25)
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %26)
store i32 2, i32* %1
br label %104
28: ; preds = %0
%29 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%30 = call i32 @unlink(i8* %29)
%31 = load i64, i64* %5
%32 = call i8* @malloc(i64 %31)
store i8* %32, i8** %3
%33 = load i8*, i8** %3
%34 = load i64, i64* %5
%35 = call i32 @memset(i8* %33, i8 signext 97, i64 %34)
%36 = load i32, i32* %6
%37 = load i8*, i8** %3
%38 = load i64, i64* %5
%39 = call i64 @write(i32 %36, i8* %37, i64 %38)
%40 = load i64, i64* %5
%41 = icmp ne i64 %39, %40
br i1 %41, label %42, label %46
42: ; preds = %28
%43 = load i32, i32* @errno
%44 = call i8* @strerror(i32 %43)
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* %44)
store i32 2, i32* %1
br label %104
46: ; preds = %28
%47 = load i8*, i8** %3
%48 = call i32 @free(i8* %47)
%49 = load i64, i64* %5
%50 = load i32, i32* @PROT_READ
%51 = load i32, i32* @PROT_WRITE
%52 = or i32 %50, %51
%53 = load i32, i32* @MAP_PRIVATE
%54 = load i32, i32* %6
%55 = call i8* @mmap(i32* null, i64 %49, i32 %52, i32 %53, i32 %54, i32 0)
store i8* %55, i8** %4
%56 = load i8*, i8** %4
%57 = load i8*, i8** @MAP_FAILED
%58 = icmp eq i8* %56, %57
br i1 %58, label %59, label %63
59: ; preds = %46
%60 = load i32, i32* @errno
%61 = call i8* @strerror(i32 %60)
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* %61)
store i32 1, i32* %1
br label %104
63: ; preds = %46
%64 = load i8*, i8** %4
store i8 98, i8* %64
%65 = load i8*, i8** %4
%66 = load i64, i64* %5
%67 = load i32, i32* @MS_SYNC
%68 = call i64 @msync(i8* %65, i64 %66, i32 %67)
%69 = icmp ne i64 %68, 0
br i1 %69, label %70, label %74
70: ; preds = %63
%71 = load i32, i32* @errno
%72 = call i8* @strerror(i32 %71)
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i8* %72)
store i32 2, i32* %1
br label %104
74: ; preds = %63
%75 = load i8*, i8** %4
%76 = load i64, i64* %5
%77 = call i32 @munmap(i8* %75, i64 %76)
%78 = load i64, i64* %5
%79 = load i32, i32* @PROT_READ
%80 = load i32, i32* @PROT_WRITE
%81 = or i32 %79, %80
%82 = load i32, i32* @MAP_PRIVATE
%83 = load i32, i32* %6
%84 = call i8* @mmap(i32* null, i64 %78, i32 %81, i32 %82, i32 %83, i32 0)
store i8* %84, i8** %4
%85 = load i8*, i8** %4
%86 = load i8*, i8** @MAP_FAILED
%87 = icmp eq i8* %85, %86
br i1 %87, label %88, label %92
88: ; preds = %74
%89 = load i32, i32* @errno
%90 = call i8* @strerror(i32 %89)
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i8* %90)
store i32 1, i32* %1
br label %104
92: ; preds = %74
%93 = load i8*, i8** %4
%94 = load i8, i8* %93
%95 = sext i8 %94 to i32
%96 = icmp eq i32 %95, 98
br i1 %96, label %97, label %100
97: ; preds = %92
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.6, i64 0, i64 0))
%99 = call i32 @exit(i32 1)
unreachable
100: ; preds = %92
%101 = load i32, i32* %6
%102 = call i32 @close(i32 %101)
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.7, i64 0, i64 0))
store i32 0, i32* %1
br label %104
104: ; preds = %100, %88, %70, %59, %42, %24
%105 = load i32, i32* %1
ret i32 %105
}

LLVM IR (-O2):
@.str = [21 x i8] c"/tmp/pts_mmap_7_2_%d\00"
@O_CREAT = global i32 0
@O_RDWR = global i32 0
@O_EXCL = global i32 0
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@.str.1 = [21 x i8] c"Error at open(): %s\0A\00"
@errno = global i32 0
@.str.2 = [22 x i8] c"Error at write(): %s\0A\00"
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_PRIVATE = global i32 0
@MAP_FAILED = global i8* null
@.str.3 = [21 x i8] c"Error at mmap(): %s\0A\00"
@MS_SYNC = global i32 0
@.str.4 = [22 x i8] c"Error at msync(): %s\0A\00"
@.str.5 = [25 x i8] c"Error at 2nd mmap(): %s\0A\00"
@str = [78 x i8] c"Memory write with MAP_PRIVATE has not changed the underlying file\0ATest PASSED\00"
@str.8 = [74 x i8] c"Memory write with MAP_PRIVATE has changed the underlying file\0ATest FAILED\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (...) @getpid()
%4 = call i32 @snprintf(i8* %2, i32 256, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @unlink(i8* %2)
%6 = load i32, i32* @O_CREAT
%7 = load i32, i32* @O_RDWR
%8 = or i32 %7, %6
%9 = load i32, i32* @O_EXCL
%10 = or i32 %8, %9
%11 = load i32, i32* @S_IRUSR
%12 = load i32, i32* @S_IWUSR
%13 = or i32 %12, %11
%14 = call i32 @open(i8* %2, i32 %10, i32 %13)
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %20
16: ; preds = %0
%17 = load i32, i32* @errno
%18 = call i8* @strerror(i32 %17)
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %18)
br label %73
20: ; preds = %0
%21 = call i32 @unlink(i8* %2)
%22 = call dereferenceable_or_null(1024) i8* @malloc(i64 1024)
%23 = call i32 @memset(i8* %22, i8 signext 97, i64 1024)
%24 = call i64 @write(i32 %14, i8* %22, i64 1024)
%25 = icmp eq i64 %24, 1024
br i1 %25, label %30, label %26
26: ; preds = %20
%27 = load i32, i32* @errno
%28 = call i8* @strerror(i32 %27)
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* %28)
br label %73
30: ; preds = %20
%31 = call i32 @free(i8* %22)
%32 = load i32, i32* @PROT_READ
%33 = load i32, i32* @PROT_WRITE
%34 = or i32 %33, %32
%35 = load i32, i32* @MAP_PRIVATE
%36 = call i8* @mmap(i32* null, i64 1024, i32 %34, i32 %35, i32 %14, i32 0)
%37 = load i8*, i8** @MAP_FAILED
%38 = icmp eq i8* %36, %37
br i1 %38, label %39, label %43
39: ; preds = %30
%40 = load i32, i32* @errno
%41 = call i8* @strerror(i32 %40)
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* %41)
br label %73
43: ; preds = %30
store i8 98, i8* %36
%44 = load i32, i32* @MS_SYNC
%45 = call i64 @msync(i8* %36, i64 1024, i32 %44)
%46 = icmp eq i64 %45, 0
br i1 %46, label %51, label %47
47: ; preds = %43
%48 = load i32, i32* @errno
%49 = call i8* @strerror(i32 %48)
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i8* %49)
br label %73
51: ; preds = %43
%52 = call i32 @munmap(i8* %36, i64 1024)
%53 = load i32, i32* @PROT_READ
%54 = load i32, i32* @PROT_WRITE
%55 = or i32 %54, %53
%56 = load i32, i32* @MAP_PRIVATE
%57 = call i8* @mmap(i32* null, i64 1024, i32 %55, i32 %56, i32 %14, i32 0)
%58 = load i8*, i8** @MAP_FAILED
%59 = icmp eq i8* %57, %58
br i1 %59, label %60, label %64
60: ; preds = %51
%61 = load i32, i32* @errno
%62 = call i8* @strerror(i32 %61)
%63 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i8* %62)
br label %73
64: ; preds = %51
%65 = load i8, i8* %57
%66 = icmp eq i8 %65, 98
br i1 %66, label %67, label %70
67: ; preds = %64
%68 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @str.8, i64 0, i64 0))
%69 = call i32 @exit(i32 1)
unreachable
70: ; preds = %64
%71 = call i32 @close(i32 %14)
%72 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str, i64 0, i64 0))
br label %73
73: ; preds = %70, %60, %47, %39, %26, %16
%74 = phi i32 [ 2, %16 ], [ 2, %26 ], [ 1, %39 ], [ 2, %47 ], [ 1, %60 ], [ 0, %70 ]
ret i32 %74
}