#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 int ssize_t;

/* Variables and functions */
void *MAP_FAILED;
int /*<<< orphan*/ MAP_SHARED;
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 ftruncate(int, int);
int getpid();
void *mmap(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/, int,
           int /*<<< orphan*/);
int /*<<< orphan*/ msync(void *, int, int /*<<< orphan*/);
int /*<<< orphan*/ munmap(void *, int);
int open(char *, int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
char *strerror(int /*<<< orphan*/);
int /*<<< orphan*/ unlink(char *);
int main(void) {
  char tmpfname[256];
  void *pa;
  ssize_t size = 1024;
  int fd, i;
  snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_mmap_12_1_%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);
  if (ftruncate(fd, size) == -1) {
    printf("Error at ftruncate(): %s\n", strerror(errno));
    return 2;
  }
  pa = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
  if (pa == MAP_FAILED) {
    printf("Error at mmap: %s\n", strerror(errno));
    return 1;
  }
  close(fd);
  for (i = 0; i < size; i++)
    ((char *)pa)[i] = (13 * i) % 21;
  msync(pa, size, MS_SYNC);
  for (i = 0; i < size; i++) {
    if (((char *)pa)[i] != (13 * i) % 21) {
      printf("FAILED: Mapped buffer was not preserved\n");
      return 1;
    }
  }
  munmap(pa, size);
  printf("Test PASSED\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x400,-0x11c(%rbp)
lea    -0x110(%rbp),%rax
mov    %rax,-0x130(%rbp)
mov    $0x0,%al
call   1040 <getpid@plt>
mov    -0x130(%rbp),%rdi
mov    %eax,%ecx
mov    $0x100,%esi
lea    0xe0a(%rip),%rdx
call   1080 <snprintf@plt>
lea    -0x110(%rbp),%rdi
call   1030 <unlink@plt>
lea    -0x110(%rbp),%rdi
mov    0x2de3(%rip),%rax
mov    (%rax),%esi
mov    0x2db2(%rip),%rax
or     (%rax),%esi
mov    0x2d91(%rip),%rax
or     (%rax),%esi
mov    0x2d68(%rip),%rax
mov    (%rax),%edx
mov    0x2d8f(%rip),%rax
or     (%rax),%edx
call   10c0 <open@plt>
mov    %eax,-0x120(%rbp)
cmpl   $0xffffffff,-0x120(%rbp)
jne    127e <main+0xce>
mov    0x2d56(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    %rax,%rsi
lea    0xdab(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x2,-0x4(%rbp)
jmp    146d <main+0x2bd>
lea    -0x110(%rbp),%rdi
call   1030 <unlink@plt>
mov    -0x120(%rbp),%edi
mov    -0x11c(%rbp),%esi
call   1090 <ftruncate@plt>
cmp    $0xffffffff,%eax
jne    12cf <main+0x11f>
mov    0x2d05(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    %rax,%rsi
lea    0xd6f(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x2,-0x4(%rbp)
jmp    146d <main+0x2bd>
mov    -0x11c(%rbp),%esi
mov    0x2d14(%rip),%rax
mov    (%rax),%edx
mov    0x2cbb(%rip),%rax
or     (%rax),%edx
mov    0x2cf2(%rip),%rax
mov    (%rax),%ecx
mov    -0x120(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%edi
xor    %r9d,%r9d
call   1060 <mmap@plt>
mov    %rax,-0x118(%rbp)
mov    -0x118(%rbp),%rax
mov    0x2c78(%rip),%rcx
cmp    (%rcx),%rax
jne    134c <main+0x19c>
mov    0x2c88(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    %rax,%rsi
lea    0xd0c(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    146d <main+0x2bd>
mov    -0x120(%rbp),%edi
call   10a0 <close@plt>
movl   $0x0,-0x124(%rbp)
mov    -0x124(%rbp),%eax
cmp    -0x11c(%rbp),%eax
jge    13a7 <main+0x1f7>
imul   $0xd,-0x124(%rbp),%eax
mov    $0x15,%ecx
cltd
idiv   %ecx
mov    -0x118(%rbp),%rax
movslq -0x124(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x124(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x124(%rbp)
jmp    1361 <main+0x1b1>
mov    -0x118(%rbp),%rdi
mov    -0x11c(%rbp),%esi
mov    0x2bed(%rip),%rax
mov    (%rax),%edx
call   1050 <msync@plt>
movl   $0x0,-0x124(%rbp)
mov    -0x124(%rbp),%eax
cmp    -0x11c(%rbp),%eax
jge    1446 <main+0x296>
mov    -0x118(%rbp),%rax
movslq -0x124(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x134(%rbp)
imul   $0xd,-0x124(%rbp),%eax
mov    $0x15,%ecx
cltd
idiv   %ecx
mov    -0x134(%rbp),%eax
cmp    %edx,%eax
je     142d <main+0x27d>
lea    0xc3e(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    146d <main+0x2bd>
jmp    1432 <main+0x282>
mov    -0x124(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x124(%rbp)
jmp    13cc <main+0x21c>
mov    -0x118(%rbp),%rdi
mov    -0x11c(%rbp),%esi
call   10b0 <munmap@plt>
lea    0xc22(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x108,%rsp
xor    %eax,%eax
call   1050 <getpid@plt>
lea    0xe99(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x100,%esi
mov    %eax,%ecx
call   1090 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <unlink@plt>
mov    0x2e00(%rip),%rax
mov    0x2dd1(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2dae(%rip),%rax
or     (%rax),%esi
mov    0x2d85(%rip),%rax
mov    0x2dae(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    %rbx,%rdi
call   10d0 <open@plt>
cmp    $0xffffffff,%eax
je     1491 <main+0x2d1>
mov    %eax,%ebp
mov    %rsp,%rdi
call   1030 <unlink@plt>
mov    %ebp,%edi
mov    $0x400,%esi
call   10a0 <ftruncate@plt>
cmp    $0xffffffff,%eax
je     14a8 <main+0x2e8>
mov    0x2d9b(%rip),%rax
mov    0x2d44(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    0x2d79(%rip),%rax
mov    (%rax),%ecx
xor    %edi,%edi
mov    $0x400,%esi
mov    %ebp,%r8d
xor    %r9d,%r9d
call   1070 <mmap@plt>
mov    %rax,%rbx
mov    0x2d0b(%rip),%rax
cmp    (%rax),%rbx
je     14dc <main+0x31c>
mov    %ebp,%edi
call   10b0 <close@plt>
movdqa 0xd63(%rip),%xmm3
movdqa 0xd6b(%rip),%xmm2
xor    %eax,%eax
movdqa 0xd70(%rip),%xmm8
movdqa 0xd77(%rip),%xmm11
movdqa 0xd7f(%rip),%xmm4
movdqa 0xd86(%rip),%xmm9
movdqa 0xd8d(%rip),%xmm10
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movdqa %xmm3,%xmm0
pmullw %xmm8,%xmm0
movdqa %xmm2,%xmm5
pmullw %xmm8,%xmm5
movdqa %xmm5,%xmm6
pmulhuw %xmm11,%xmm6
movdqa %xmm5,%xmm1
psubw  %xmm6,%xmm1
psrlw  $0x1,%xmm1
paddw  %xmm6,%xmm1
psrlw  $0x4,%xmm1
pmullw %xmm4,%xmm1
movdqa %xmm5,%xmm6
psubw  %xmm1,%xmm6
movdqa %xmm0,%xmm1
pmulhuw %xmm11,%xmm1
movdqa %xmm0,%xmm7
psubw  %xmm1,%xmm7
psrlw  $0x1,%xmm7
paddw  %xmm1,%xmm7
psrlw  $0x4,%xmm7
pmullw %xmm4,%xmm7
movdqa %xmm0,%xmm1
psubw  %xmm7,%xmm1
packuswb %xmm1,%xmm6
movdqu %xmm6,(%rbx,%rax,1)
paddw  %xmm9,%xmm0
paddw  %xmm9,%xmm5
movdqa %xmm5,%xmm1
pmulhuw %xmm11,%xmm1
movdqa %xmm5,%xmm6
psubw  %xmm1,%xmm6
psrlw  $0x1,%xmm6
paddw  %xmm1,%xmm6
psrlw  $0x4,%xmm6
pmullw %xmm4,%xmm6
psubw  %xmm6,%xmm5
movdqa %xmm0,%xmm1
pmulhuw %xmm11,%xmm1
movdqa %xmm0,%xmm6
psubw  %xmm1,%xmm6
psrlw  $0x1,%xmm6
paddw  %xmm1,%xmm6
psrlw  $0x4,%xmm6
pmullw %xmm4,%xmm6
psubw  %xmm6,%xmm0
packuswb %xmm0,%xmm5
movdqu %xmm5,0x10(%rbx,%rax,1)
add    $0x20,%rax
paddw  %xmm10,%xmm2
paddw  %xmm10,%xmm3
cmp    $0x400,%rax
jne    12e0 <main+0x120>
mov    0x2bd4(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    $0x400,%esi
call   1060 <msync@plt>
mov    $0xfffffff3,%edx
xor    %ecx,%ecx
mov    $0x86186187,%r8d
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzwl %cx,%eax
imul   $0x8619,%eax,%eax
shr    $0x10,%eax
mov    %ecx,%edi
sub    %eax,%edi
movzwl %di,%edi
shr    %edi
add    %eax,%edi
movzwl %di,%eax
shr    $0x4,%eax
lea    (%rax,%rax,4),%edi
lea    (%rax,%rdi,4),%eax
mov    %ecx,%edi
sub    %eax,%edi
movsbl (%rbx,%rsi,1),%eax
movzwl %di,%edi
cmp    %eax,%edi
jne    14ce <main+0x30e>
movsbl 0x1(%rbx,%rsi,1),%edi
add    $0x1a,%edx
mov    %rdx,%rax
imul   %r8,%rax
shr    $0x20,%rax
mov    %edx,%ebp
sub    %eax,%ebp
shr    %ebp
add    %eax,%ebp
shr    $0x4,%ebp
lea    0x0(%rbp,%rbp,4),%eax
lea    0x0(%rbp,%rax,4),%eax
mov    %edx,%ebp
sub    %eax,%ebp
cmp    %edi,%ebp
jne    14ce <main+0x30e>
add    $0x1a,%ecx
add    $0x2,%rsi
cmp    $0x400,%rsi
jne    1400 <main+0x240>
mov    %rbx,%rdi
mov    $0x400,%esi
call   10c0 <munmap@plt>
lea    0xc40(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
jmp    1500 <main+0x340>
mov    0x2b18(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
lea    0xbe0(%rip),%rdi
jmp    14bd <main+0x2fd>
mov    0x2b01(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
lea    0xbde(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0x2,%eax
jmp    1500 <main+0x340>
lea    0xbff(%rip),%rdi
call   1040 <puts@plt>
jmp    14fb <main+0x33b>
mov    0x2acd(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
lea    0xbc4(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0x1,%eax
add    $0x108,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"/tmp/pts_mmap_12_1_%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 = [26 x i8] c"Error at ftruncate(): %s\0A\00"
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_SHARED = global i32 0
@MAP_FAILED = global i8* null
@.str.3 = [19 x i8] c"Error at mmap: %s\0A\00"
@MS_SYNC = global i32 0
@.str.4 = [41 x i8] c"FAILED: Mapped buffer was not preserved\0A\00"
@.str.5 = [13 x i8] c"Test PASSED\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [256 x i8]
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 1024, i32* %4
%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 ([22 x i8], [22 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* %5
%22 = load i32, i32* %5
%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 i32, i32* %5
%32 = load i32, i32* %4
%33 = call i32 @ftruncate(i32 %31, i32 %32)
%34 = icmp eq i32 %33, -1
br i1 %34, label %35, label %39
35: ; preds = %28
%36 = load i32, i32* @errno
%37 = call i8* @strerror(i32 %36)
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* %37)
store i32 2, i32* %1
br label %104
39: ; preds = %28
%40 = load i32, i32* %4
%41 = load i32, i32* @PROT_READ
%42 = load i32, i32* @PROT_WRITE
%43 = or i32 %41, %42
%44 = load i32, i32* @MAP_SHARED
%45 = load i32, i32* %5
%46 = call i8* @mmap(i32* null, i32 %40, i32 %43, i32 %44, i32 %45, i32 0)
store i8* %46, i8** %3
%47 = load i8*, i8** %3
%48 = load i8*, i8** @MAP_FAILED
%49 = icmp eq i8* %47, %48
br i1 %49, label %50, label %54
50: ; preds = %39
%51 = load i32, i32* @errno
%52 = call i8* @strerror(i32 %51)
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8* %52)
store i32 1, i32* %1
br label %104
54: ; preds = %39
%55 = load i32, i32* %5
%56 = call i32 @close(i32 %55)
store i32 0, i32* %6
br label %57
57: ; preds = %70, %54
%58 = load i32, i32* %6
%59 = load i32, i32* %4
%60 = icmp slt i32 %58, %59
br i1 %60, label %61, label %73
61: ; preds = %57
%62 = load i32, i32* %6
%63 = mul nsw i32 13, %62
%64 = srem i32 %63, 21
%65 = trunc i32 %64 to i8
%66 = load i8*, i8** %3
%67 = load i32, i32* %6
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds i8, i8* %66, i64 %68
store i8 %65, i8* %69
br label %70
70: ; preds = %61
%71 = load i32, i32* %6
%72 = add nsw i32 %71, 1
store i32 %72, i32* %6
br label %57
73: ; preds = %57
%74 = load i8*, i8** %3
%75 = load i32, i32* %4
%76 = load i32, i32* @MS_SYNC
%77 = call i32 @msync(i8* %74, i32 %75, i32 %76)
store i32 0, i32* %6
br label %78
78: ; preds = %96, %73
%79 = load i32, i32* %6
%80 = load i32, i32* %4
%81 = icmp slt i32 %79, %80
br i1 %81, label %82, label %99
82: ; preds = %78
%83 = load i8*, i8** %3
%84 = load i32, i32* %6
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds i8, i8* %83, i64 %85
%87 = load i8, i8* %86
%88 = sext i8 %87 to i32
%89 = load i32, i32* %6
%90 = mul nsw i32 13, %89
%91 = srem i32 %90, 21
%92 = icmp ne i32 %88, %91
br i1 %92, label %93, label %95
93: ; preds = %82
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %1
br label %104
95: ; preds = %82
br label %96
96: ; preds = %95
%97 = load i32, i32* %6
%98 = add nsw i32 %97, 1
store i32 %98, i32* %6
br label %78
99: ; preds = %78
%100 = load i8*, i8** %3
%101 = load i32, i32* %4
%102 = call i32 @munmap(i8* %100, i32 %101)
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %1
br label %104
104: ; preds = %99, %93, %50, %35, %24
%105 = load i32, i32* %1
ret i32 %105
}

LLVM IR (-O2):
@.str = [22 x i8] c"/tmp/pts_mmap_12_1_%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 = [26 x i8] c"Error at ftruncate(): %s\0A\00"
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_SHARED = global i32 0
@MAP_FAILED = global i8* null
@.str.3 = [19 x i8] c"Error at mmap: %s\0A\00"
@MS_SYNC = global i32 0
@str = [12 x i8] c"Test PASSED\00"
@str.6 = [40 x i8] c"FAILED: Mapped buffer was not preserved\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 ([22 x i8], [22 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 %91
20: ; preds = %0
%21 = call i32 @unlink(i8* %2)
%22 = call i32 @ftruncate(i32 %14, i32 1024)
%23 = icmp eq i32 %22, -1
br i1 %23, label %24, label %28
24: ; preds = %20
%25 = load i32, i32* @errno
%26 = call i8* @strerror(i32 %25)
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* %26)
br label %91
28: ; preds = %20
%29 = load i32, i32* @PROT_READ
%30 = load i32, i32* @PROT_WRITE
%31 = or i32 %30, %29
%32 = load i32, i32* @MAP_SHARED
%33 = call i8* @mmap(i32* null, i32 1024, i32 %31, i32 %32, i32 %14, i32 0)
%34 = load i8*, i8** @MAP_FAILED
%35 = icmp eq i8* %33, %34
br i1 %35, label %36, label %40
36: ; preds = %28
%37 = load i32, i32* @errno
%38 = call i8* @strerror(i32 %37)
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8* %38)
br label %91
40: ; preds = %28
%41 = call i32 @close(i32 %14)
br label %42
42: ; preds = %42, %40
%43 = phi i64 [ 0, %40 ], [ %57, %42 ]
%44 = phi <16 x i16> [ <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7, i16 8, i16 9, i16 10, i16 11, i16 12, i16 13, i16 14, i16 15>, %40 ], [ %58, %42 ]
%45 = mul <16 x i16> %44, <i16 13, i16 13, i16 13, i16 13, i16 13, i16 13, i16 13, i16 13, i16 13, i16 13, i16 13, i16 13, i16 13, i16 13, i16 13, i16 13>
%46 = urem <16 x i16> %45, <i16 21, i16 21, i16 21, i16 21, i16 21, i16 21, i16 21, i16 21, i16 21, i16 21, i16 21, i16 21, i16 21, i16 21, i16 21, i16 21>
%47 = trunc <16 x i16> %46 to <16 x i8>
%48 = getelementptr inbounds i8, i8* %33, i64 %43
%49 = bitcast i8* %48 to <16 x i8>*
store <16 x i8> %47, <16 x i8>* %49
%50 = or i64 %43, 16
%51 = mul <16 x i16> %44, <i16 13, i16 13, i16 13, i16 13, i16 13, i16 13, i16 13, i16 13, i16 13, i16 13, i16 13, i16 13, i16 13, i16 13, i16 13, i16 13>
%52 = add <16 x i16> %51, <i16 208, i16 208, i16 208, i16 208, i16 208, i16 208, i16 208, i16 208, i16 208, i16 208, i16 208, i16 208, i16 208, i16 208, i16 208, i16 208>
%53 = urem <16 x i16> %52, <i16 21, i16 21, i16 21, i16 21, i16 21, i16 21, i16 21, i16 21, i16 21, i16 21, i16 21, i16 21, i16 21, i16 21, i16 21, i16 21>
%54 = trunc <16 x i16> %53 to <16 x i8>
%55 = getelementptr inbounds i8, i8* %33, i64 %50
%56 = bitcast i8* %55 to <16 x i8>*
store <16 x i8> %54, <16 x i8>* %56
%57 = add nuw nsw i64 %43, 32
%58 = add <16 x i16> %44, <i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32>
%59 = icmp eq i64 %57, 1024
br i1 %59, label %60, label %42
60: ; preds = %42
%61 = load i32, i32* @MS_SYNC
%62 = call i32 @msync(i8* %33, i32 1024, i32 %61)
br label %76
63: ; preds = %76
%64 = or i64 %77, 1
%65 = getelementptr inbounds i8, i8* %33, i64 %64
%66 = load i8, i8* %65
%67 = sext i8 %66 to i32
%68 = trunc i64 %64 to i16
%69 = mul nuw nsw i16 %68, 13
%70 = urem i16 %69, 21
%71 = zext i16 %70 to i32
%72 = icmp eq i32 %71, %67
br i1 %72, label %73, label %86
73: ; preds = %63
%74 = add nuw nsw i64 %77, 2
%75 = icmp eq i64 %74, 1024
br i1 %75, label %88, label %76
76: ; preds = %73, %60
%77 = phi i64 [ 0, %60 ], [ %74, %73 ]
%78 = getelementptr inbounds i8, i8* %33, i64 %77
%79 = load i8, i8* %78
%80 = sext i8 %79 to i32
%81 = trunc i64 %77 to i16
%82 = mul nsw i16 %81, 13
%83 = urem i16 %82, 21
%84 = zext i16 %83 to i32
%85 = icmp eq i32 %84, %80
br i1 %85, label %63, label %86
86: ; preds = %63, %76
%87 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.6, i64 0, i64 0))
br label %91
88: ; preds = %73
%89 = call i32 @munmap(i8* %33, i32 1024)
%90 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
br label %91
91: ; preds = %88, %86, %36, %24, %16
%92 = phi i32 [ 2, %16 ], [ 2, %24 ], [ 1, %36 ], [ 1, %86 ], [ 0, %88 ]
ret i32 %92
}