#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 */

/* Variables and functions */
scalar_t__ ENOENT;
char *MAP_FAILED;
int /*<<< orphan*/ MAP_SHARED;
int O_CREAT;
int O_RDONLY;
int O_RDWR;
int /*<<< orphan*/ PROT_READ;
int /*<<< orphan*/ PROT_WRITE;
int S_IRUSR;
int S_IWUSR;
scalar_t__ close(int);
scalar_t__ errno;
scalar_t__ ftruncate(int, int);
char *mmap(int /*<<< orphan*/ *, int, int /*<<< orphan*/, int /*<<< orphan*/,
           int, int /*<<< orphan*/);
scalar_t__ munmap(char *, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *);
int shm_open(char *, int, int);
int /*<<< orphan*/ shm_unlink(char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main(void) {
  int fd;
  char str[8] = "qwerty";
  char *buf;
  fd = shm_open("posixtest_28-1", O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
  if (fd == -1) {
    perror("An error occurs when calling shm_open()");
    return 2;
  }
  if (ftruncate(fd, 8) != 0) {
    perror("An error occurs when calling ftruncate()");
    shm_unlink("posixtest_28-1");
    return 2;
  }
  buf = mmap(NULL, 8, PROT_WRITE, MAP_SHARED, fd, 0);
  if (buf == MAP_FAILED) {
    perror("An error occurs when calling mmap()");
    shm_unlink("posixtest_28-1");
    return 2;
  }
  strcpy(buf, str);
  if (munmap(buf, 8) != 0) {
    perror("An error occurs when calling munmap()");
    shm_unlink("posixtest_28-1");
    return 2;
  }
  if (close(fd) != 0) {
    perror("An error occurs when calling close()");
    shm_unlink("posixtest_28-1");
    return 2;
  }
  fd = shm_open("posixtest_28-1", O_RDONLY, S_IRUSR | S_IWUSR);
  if (fd == -1 && errno == ENOENT) {
    printf("The name of the shared memory object was removed.\n");
    return 1;
  } else if (fd == -1) {
    perror("An error occurs when calling shm_open()");
    shm_unlink("posixtest_28-1");
    return 2;
  }
  buf = mmap(NULL, 8, PROT_READ, MAP_SHARED, fd, 0);
  if (buf == MAP_FAILED) {
    perror("An error occurs when calling mmap()");
    shm_unlink("posixtest_28-1");
    return 2;
  }
  if (strcmp(buf, str) == 0) {
    printf("Test PASSED\n");
    shm_unlink("posixtest_28-1");
    return 0;
  }
  printf("The content of the shared memory object was removed.\n");
  shm_unlink("posixtest_28-1");
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xe4a(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e0f(%rip),%rax
mov    (%rax),%esi
mov    0x2e2e(%rip),%rax
or     (%rax),%esi
mov    0x2dcd(%rip),%rax
mov    (%rax),%edx
mov    0x2de4(%rip),%rax
or     (%rax),%edx
lea    0xe23(%rip),%rdi
call   10b0 <shm_open@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    120f <main+0x6f>
lea    0xe19(%rip),%rdi
call   10a0 <perror@plt>
movl   $0x2,-0x4(%rbp)
jmp    1482 <main+0x2e2>
mov    -0x8(%rbp),%edi
mov    $0x8,%esi
call   1060 <ftruncate@plt>
cmp    $0x0,%rax
je     124a <main+0xaa>
lea    0xe12(%rip),%rdi
call   10a0 <perror@plt>
lea    0xdcf(%rip),%rdi
call   10c0 <shm_unlink@plt>
movl   $0x2,-0x4(%rbp)
jmp    1482 <main+0x2e2>
mov    0x2d57(%rip),%rax
mov    (%rax),%edx
mov    0x2d86(%rip),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%edi
mov    $0x8,%esi
xor    %r9d,%r9d
call   1040 <mmap@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0x2d18(%rip),%rcx
cmp    (%rcx),%rax
jne    12ad <main+0x10d>
lea    0xdd8(%rip),%rdi
call   10a0 <perror@plt>
lea    0xd6c(%rip),%rdi
call   10c0 <shm_unlink@plt>
movl   $0x2,-0x4(%rbp)
jmp    1482 <main+0x2e2>
mov    -0x18(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
mov    $0x8,%esi
call   1090 <munmap@plt>
cmp    $0x0,%rax
je     12f6 <main+0x156>
lea    0xdb3(%rip),%rdi
call   10a0 <perror@plt>
lea    0xd23(%rip),%rdi
call   10c0 <shm_unlink@plt>
movl   $0x2,-0x4(%rbp)
jmp    1482 <main+0x2e2>
mov    -0x8(%rbp),%edi
call   1070 <close@plt>
cmp    $0x0,%rax
je     132c <main+0x18c>
lea    0xda3(%rip),%rdi
call   10a0 <perror@plt>
lea    0xced(%rip),%rdi
call   10c0 <shm_unlink@plt>
movl   $0x2,-0x4(%rbp)
jmp    1482 <main+0x2e2>
mov    0x2c95(%rip),%rax
mov    (%rax),%esi
mov    0x2c64(%rip),%rax
mov    (%rax),%edx
mov    0x2c7b(%rip),%rax
or     (%rax),%edx
lea    0xcba(%rip),%rdi
call   10b0 <shm_open@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1392 <main+0x1f2>
mov    0x2c49(%rip),%rax
mov    (%rax),%rax
mov    0x2c17(%rip),%rcx
cmp    (%rcx),%rax
jne    1392 <main+0x1f2>
lea    0xd56(%rip),%rdi
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1482 <main+0x2e2>
cmpl   $0xffffffff,-0x8(%rbp)
jne    13c0 <main+0x220>
lea    0xc74(%rip),%rdi
call   10a0 <perror@plt>
lea    0xc59(%rip),%rdi
call   10c0 <shm_unlink@plt>
movl   $0x2,-0x4(%rbp)
jmp    1482 <main+0x2e2>
jmp    13c5 <main+0x225>
mov    0x2c24(%rip),%rax
mov    (%rax),%edx
mov    0x2c0b(%rip),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%edi
mov    $0x8,%esi
xor    %r9d,%r9d
call   1040 <mmap@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0x2b9d(%rip),%rcx
cmp    (%rcx),%rax
jne    1428 <main+0x288>
lea    0xc5d(%rip),%rdi
call   10a0 <perror@plt>
lea    0xbf1(%rip),%rdi
call   10c0 <shm_unlink@plt>
movl   $0x2,-0x4(%rbp)
jmp    1482 <main+0x2e2>
mov    -0x18(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    1463 <main+0x2c3>
lea    0xcc4(%rip),%rdi
call   1050 <printf@plt>
lea    0xbb6(%rip),%rdi
call   10c0 <shm_unlink@plt>
movl   $0x0,-0x4(%rbp)
jmp    1482 <main+0x2e2>
lea    0xcad(%rip),%rdi
call   1050 <printf@plt>
lea    0xb92(%rip),%rdi
call   10c0 <shm_unlink@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movabs $0x797472657771,%rax
mov    %rax,(%rsp)
mov    0x2e10(%rip),%rax
mov    0x2e31(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2dce(%rip),%r14
mov    0x2de7(%rip),%r15
mov    (%r15),%edx
or     (%r14),%edx
lea    0xe1a(%rip),%rdi
call   10b0 <shm_open@plt>
cmp    $0xffffffff,%eax
je     1333 <main+0x193>
mov    %eax,%ebp
mov    %eax,%edi
mov    $0x8,%esi
call   1060 <ftruncate@plt>
test   %rax,%rax
jne    1341 <main+0x1a1>
mov    0x2d96(%rip),%rax
mov    (%rax),%edx
mov    0x2dc5(%rip),%r12
mov    (%r12),%ecx
xor    %edi,%edi
mov    $0x8,%esi
mov    %ebp,%r8d
xor    %r9d,%r9d
call   1050 <mmap@plt>
mov    0x2d60(%rip),%r13
cmp    0x0(%r13),%rax
je     132a <main+0x18a>
mov    %rax,%rbx
mov    %rsp,%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1090 <munmap@plt>
test   %rax,%rax
jne    134a <main+0x1aa>
mov    %ebp,%edi
call   1070 <close@plt>
test   %rax,%rax
jne    1353 <main+0x1b3>
mov    0x2d4b(%rip),%rax
mov    (%rax),%esi
mov    (%r15),%edx
or     (%r14),%edx
lea    0xd74(%rip),%rdi
call   10b0 <shm_open@plt>
cmp    $0xffffffff,%eax
je     12e5 <main+0x145>
mov    0x2d53(%rip),%rcx
mov    (%rcx),%edx
mov    (%r12),%ecx
xor    %edi,%edi
mov    $0x8,%esi
mov    %eax,%r8d
xor    %r9d,%r9d
call   1050 <mmap@plt>
cmp    0x0(%r13),%rax
je     132a <main+0x18a>
mov    %rsp,%rsi
mov    %rax,%rdi
call   1080 <strcmp@plt>
test   %rax,%rax
je     130e <main+0x16e>
lea    0xdfd(%rip),%rdi
call   1040 <puts@plt>
lea    0xd22(%rip),%rdi
call   10c0 <shm_unlink@plt>
jmp    1307 <main+0x167>
mov    0x2cc4(%rip),%rax
mov    (%rax),%rax
mov    0x2c92(%rip),%rcx
cmp    (%rcx),%rax
jne    135c <main+0x1bc>
lea    0xe0e(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%eax
jmp    1379 <main+0x1d9>
lea    0xdef(%rip),%rdi
call   1040 <puts@plt>
lea    0xcdf(%rip),%rdi
call   10c0 <shm_unlink@plt>
xor    %eax,%eax
jmp    1379 <main+0x1d9>
lea    0xd2f(%rip),%rdi
jmp    1363 <main+0x1c3>
lea    0xcd5(%rip),%rdi
call   10a0 <perror@plt>
jmp    1374 <main+0x1d4>
lea    0xcef(%rip),%rdi
jmp    1363 <main+0x1c3>
lea    0xd33(%rip),%rdi
jmp    1363 <main+0x1c3>
lea    0xd50(%rip),%rdi
jmp    1363 <main+0x1c3>
lea    0xcac(%rip),%rdi
call   10a0 <perror@plt>
lea    0xc91(%rip),%rdi
call   10c0 <shm_unlink@plt>
mov    $0x2,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.str = [8 x i8] c"qwerty\00\00"
@.str = [15 x i8] c"posixtest_28-1\00"
@O_RDWR = global i32 0
@O_CREAT = global i32 0
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@.str.1 = [40 x i8] c"An error occurs when calling shm_open()\00"
@.str.2 = [41 x i8] c"An error occurs when calling ftruncate()\00"
@PROT_WRITE = global i32 0
@MAP_SHARED = global i32 0
@MAP_FAILED = global i8* null
@.str.3 = [36 x i8] c"An error occurs when calling mmap()\00"
@.str.4 = [38 x i8] c"An error occurs when calling munmap()\00"
@.str.5 = [37 x i8] c"An error occurs when calling close()\00"
@O_RDONLY = global i32 0
@errno = global i64 0
@ENOENT = global i64 0
@.str.6 = [51 x i8] c"The name of the shared memory object was removed.\0A\00"
@PROT_READ = global i32 0
@.str.7 = [13 x i8] c"Test PASSED\0A\00"
@.str.8 = [54 x i8] c"The content of the shared memory object was removed.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [8 x i8]
%4 = alloca i8*
store i32 0, i32* %1
%5 = bitcast [8 x i8]* %3 to i8*
%6 = load i32, i32* @O_RDWR
%7 = load i32, i32* @O_CREAT
%8 = or i32 %6, %7
%9 = load i32, i32* @S_IRUSR
%10 = load i32, i32* @S_IWUSR
%11 = or i32 %9, %10
%12 = call i32 @shm_open(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %11)
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, -1
br i1 %14, label %15, label %17
15: ; preds = %0
%16 = call i32 @perror(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
store i32 2, i32* %1
br label %95
17: ; preds = %0
%18 = load i32, i32* %2
%19 = call i64 @ftruncate(i32 %18, i32 8)
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %17
%22 = call i32 @perror(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
%23 = call i32 @shm_unlink(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i32 2, i32* %1
br label %95
24: ; preds = %17
%25 = load i32, i32* @PROT_WRITE
%26 = load i32, i32* @MAP_SHARED
%27 = load i32, i32* %2
%28 = call i8* @mmap(i32* null, i32 8, i32 %25, i32 %26, i32 %27, i32 0)
store i8* %28, i8** %4
%29 = load i8*, i8** %4
%30 = load i8*, i8** @MAP_FAILED
%31 = icmp eq i8* %29, %30
br i1 %31, label %32, label %35
32: ; preds = %24
%33 = call i32 @perror(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
%34 = call i32 @shm_unlink(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i32 2, i32* %1
br label %95
35: ; preds = %24
%36 = load i8*, i8** %4
%37 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%38 = call i32 @strcpy(i8* %36, i8* %37)
%39 = load i8*, i8** %4
%40 = call i64 @munmap(i8* %39, i32 8)
%41 = icmp ne i64 %40, 0
br i1 %41, label %42, label %45
42: ; preds = %35
%43 = call i32 @perror(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0))
%44 = call i32 @shm_unlink(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i32 2, i32* %1
br label %95
45: ; preds = %35
%46 = load i32, i32* %2
%47 = call i64 @close(i32 %46)
%48 = icmp ne i64 %47, 0
br i1 %48, label %49, label %52
49: ; preds = %45
%50 = call i32 @perror(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0))
%51 = call i32 @shm_unlink(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i32 2, i32* %1
br label %95
52: ; preds = %45
%53 = load i32, i32* @O_RDONLY
%54 = load i32, i32* @S_IRUSR
%55 = load i32, i32* @S_IWUSR
%56 = or i32 %54, %55
%57 = call i32 @shm_open(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %53, i32 %56)
store i32 %57, i32* %2
%58 = load i32, i32* %2
%59 = icmp eq i32 %58, -1
br i1 %59, label %60, label %66
60: ; preds = %52
%61 = load i64, i64* @errno
%62 = load i64, i64* @ENOENT
%63 = icmp eq i64 %61, %62
br i1 %63, label %64, label %66
64: ; preds = %60
%65 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.6, i64 0, i64 0))
store i32 1, i32* %1
br label %95
66: ; preds = %60, %52
%67 = load i32, i32* %2
%68 = icmp eq i32 %67, -1
br i1 %68, label %69, label %72
69: ; preds = %66
%70 = call i32 @perror(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%71 = call i32 @shm_unlink(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i32 2, i32* %1
br label %95
72: ; preds = %66
br label %73
73: ; preds = %72
%74 = load i32, i32* @PROT_READ
%75 = load i32, i32* @MAP_SHARED
%76 = load i32, i32* %2
%77 = call i8* @mmap(i32* null, i32 8, i32 %74, i32 %75, i32 %76, i32 0)
store i8* %77, i8** %4
%78 = load i8*, i8** %4
%79 = load i8*, i8** @MAP_FAILED
%80 = icmp eq i8* %78, %79
br i1 %80, label %81, label %84
81: ; preds = %73
%82 = call i32 @perror(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
%83 = call i32 @shm_unlink(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i32 2, i32* %1
br label %95
84: ; preds = %73
%85 = load i8*, i8** %4
%86 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%87 = call i64 @strcmp(i8* %85, i8* %86)
%88 = icmp eq i64 %87, 0
br i1 %88, label %89, label %92
89: ; preds = %84
%90 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
%91 = call i32 @shm_unlink(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
br label %95
92: ; preds = %84
%93 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.8, i64 0, i64 0))
%94 = call i32 @shm_unlink(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %1
br label %95
95: ; preds = %92, %89, %81, %69, %64, %49, %42, %32, %21, %15
%96 = load i32, i32* %1
ret i32 %96
}

LLVM IR (-O2):
@.str = [15 x i8] c"posixtest_28-1\00"
@O_RDWR = global i32 0
@O_CREAT = global i32 0
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@.str.1 = [40 x i8] c"An error occurs when calling shm_open()\00"
@.str.2 = [41 x i8] c"An error occurs when calling ftruncate()\00"
@PROT_WRITE = global i32 0
@MAP_SHARED = global i32 0
@MAP_FAILED = global i8* null
@.str.3 = [36 x i8] c"An error occurs when calling mmap()\00"
@.str.4 = [38 x i8] c"An error occurs when calling munmap()\00"
@.str.5 = [37 x i8] c"An error occurs when calling close()\00"
@O_RDONLY = global i32 0
@errno = global i64 0
@ENOENT = global i64 0
@PROT_READ = global i32 0
@str = [53 x i8] c"The content of the shared memory object was removed.\00"
@str.9 = [12 x i8] c"Test PASSED\00"
@str.10 = [50 x i8] c"The name of the shared memory object was removed.\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 133541042419569, i64* %1
%3 = load i32, i32* @O_RDWR
%4 = load i32, i32* @O_CREAT
%5 = or i32 %4, %3
%6 = load i32, i32* @S_IRUSR
%7 = load i32, i32* @S_IWUSR
%8 = or i32 %7, %6
%9 = tail call i32 @shm_open(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %8)
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %13
11: ; preds = %0
%12 = tail call i32 @perror(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
br label %75
13: ; preds = %0
%14 = tail call i64 @ftruncate(i32 %9, i32 8)
%15 = icmp eq i64 %14, 0
br i1 %15, label %19, label %16
16: ; preds = %13
%17 = tail call i32 @perror(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
%18 = tail call i32 @shm_unlink(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %75
19: ; preds = %13
%20 = load i32, i32* @PROT_WRITE
%21 = load i32, i32* @MAP_SHARED
%22 = tail call i8* @mmap(i32* null, i32 8, i32 %20, i32 %21, i32 %9, i32 0)
%23 = load i8*, i8** @MAP_FAILED
%24 = icmp eq i8* %22, %23
br i1 %24, label %25, label %28
25: ; preds = %19
%26 = tail call i32 @perror(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
%27 = tail call i32 @shm_unlink(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %75
28: ; preds = %19
%29 = call i32 @strcpy(i8* %22, i8* %2)
%30 = call i64 @munmap(i8* %22, i32 8)
%31 = icmp eq i64 %30, 0
br i1 %31, label %35, label %32
32: ; preds = %28
%33 = call i32 @perror(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0))
%34 = call i32 @shm_unlink(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %75
35: ; preds = %28
%36 = call i64 @close(i32 %9)
%37 = icmp eq i64 %36, 0
br i1 %37, label %41, label %38
38: ; preds = %35
%39 = call i32 @perror(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0))
%40 = call i32 @shm_unlink(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %75
41: ; preds = %35
%42 = load i32, i32* @O_RDONLY
%43 = load i32, i32* @S_IRUSR
%44 = load i32, i32* @S_IWUSR
%45 = or i32 %44, %43
%46 = call i32 @shm_open(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %42, i32 %45)
%47 = icmp eq i32 %46, -1
br i1 %47, label %48, label %57
48: ; preds = %41
%49 = load i64, i64* @errno
%50 = load i64, i64* @ENOENT
%51 = icmp eq i64 %49, %50
br i1 %51, label %52, label %54
52: ; preds = %48
%53 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.10, i64 0, i64 0))
br label %75
54: ; preds = %48
%55 = call i32 @perror(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%56 = call i32 @shm_unlink(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %75
57: ; preds = %41
%58 = load i32, i32* @PROT_READ
%59 = load i32, i32* @MAP_SHARED
%60 = call i8* @mmap(i32* null, i32 8, i32 %58, i32 %59, i32 %46, i32 0)
%61 = load i8*, i8** @MAP_FAILED
%62 = icmp eq i8* %60, %61
br i1 %62, label %63, label %66
63: ; preds = %57
%64 = call i32 @perror(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
%65 = call i32 @shm_unlink(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %75
66: ; preds = %57
%67 = call i64 @strcmp(i8* %60, i8* %2)
%68 = icmp eq i64 %67, 0
br i1 %68, label %69, label %72
69: ; preds = %66
%70 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.9, i64 0, i64 0))
%71 = call i32 @shm_unlink(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %75
72: ; preds = %66
%73 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
%74 = call i32 @shm_unlink(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %75
75: ; preds = %72, %69, %63, %54, %52, %38, %32, %25, %16, %11
%76 = phi i32 [ 2, %11 ], [ 2, %16 ], [ 2, %25 ], [ 2, %32 ], [ 2, %38 ], [ 1, %52 ], [ 2, %54 ], [ 2, %63 ], [ 0, %69 ], [ 1, %72 ]
ret i32 %76
}