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

/* Variables and functions */
int IPC_CREAT;
int IPC_EXCL;
int /*<<< orphan*/ IPC_RMID;
int /*<<< orphan*/ fork();
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *);
char *shmat(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ shmctl(int, int /*<<< orphan*/, int /*<<< orphan*/ *);
int shmdt(char *);
int shmget(int, int, int);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ wait(int /*<<< orphan*/ *);
int main() {
  pid_t pid;
  int ret;
  int shmid;
  shmid = shmget(1234, 1024, IPC_EXCL);
  if (shmid < 0) {
    shmid = shmget(1234, 1024, IPC_CREAT | 0640);
    if (shmid < 0) {
      perror("shmget");
      return -1;
    }
  }
  if (!(pid = fork())) {
    char *childAddr;
    childAddr = shmat(shmid, 0, 0);
    if (childAddr == NULL) {
      perror("shmat");
      return -1;
    }
    strcpy(childAddr, "hello parent");
    sleep(2);
    char buffer[1024] = {0};
    strcpy(buffer, childAddr);
    printf("child recv a message:%s\n", buffer);
    memset(childAddr, 0, 1024);
    strcpy(childAddr, "sleep");
    sleep(3);
    memset(childAddr, 0, 1024);
    strcpy(buffer, childAddr);
    printf("child recv a message:%s\n", buffer);
    ret = shmdt(childAddr);
    return 0;
  }
  sleep(2);
  char *parentAddr;
  parentAddr = shmat(shmid, 0, 0);
  if (parentAddr == NULL) {
    perror("shmat");
    return -1;
  }
  char buff[1024] = {0};
  strcpy(buff, parentAddr);
  printf("parent recv a message:%s\n", buff);
  memset(parentAddr, 0, 1024);
  strcpy(parentAddr, "hello child");
  sleep(2);
  memset(parentAddr, 0, 1024);
  strcpy(buff, parentAddr);
  printf("parent recv a message:%s\n", buff);
  memset(parentAddr, 0, 1024);
  strcpy(parentAddr, "ok");
  ret = shmdt(parentAddr);
  wait(&pid);
  shmctl(shmid, IPC_RMID, NULL);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x830,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e27(%rip),%rax
mov    (%rax),%edx
mov    $0x4d2,%edi
mov    $0x400,%esi
call   10a0 <shmget@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    122f <main+0x7f>
mov    0x2de2(%rip),%rax
mov    (%rax),%edx
or     $0x1a0,%edx
mov    $0x4d2,%edi
mov    $0x400,%esi
call   10a0 <shmget@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    122a <main+0x7a>
lea    0xde7(%rip),%rdi
call   1080 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1479 <main+0x2c9>
jmp    122f <main+0x7f>
mov    $0x0,%al
call   10d0 <fork@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jne    133a <main+0x18a>
mov    -0x10(%rbp),%edi
xor    %edx,%edx
mov    %edx,%esi
call   1090 <shmat@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1275 <main+0xc5>
lea    0xda3(%rip),%rdi
call   1080 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1479 <main+0x2c9>
mov    -0x18(%rbp),%rdi
lea    0xd8d(%rip),%rsi
call   1030 <strcpy@plt>
mov    $0x2,%edi
call   10b0 <sleep@plt>
lea    -0x420(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1060 <memset@plt>
lea    -0x420(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x420(%rbp),%rsi
lea    0xd5a(%rip),%rdi
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1060 <memset@plt>
mov    -0x18(%rbp),%rdi
lea    0xd53(%rip),%rsi
call   1030 <strcpy@plt>
mov    $0x3,%edi
call   10b0 <sleep@plt>
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1060 <memset@plt>
lea    -0x420(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x420(%rbp),%rsi
lea    0xcfd(%rip),%rdi
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1040 <shmdt@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x4(%rbp)
jmp    1479 <main+0x2c9>
mov    $0x2,%edi
call   10b0 <sleep@plt>
mov    -0x10(%rbp),%edi
xor    %edx,%edx
mov    %edx,%esi
call   1090 <shmat@plt>
mov    %rax,-0x428(%rbp)
cmpq   $0x0,-0x428(%rbp)
jne    137d <main+0x1cd>
lea    0xc9b(%rip),%rdi
call   1080 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1479 <main+0x2c9>
lea    -0x830(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1060 <memset@plt>
lea    -0x830(%rbp),%rdi
mov    -0x428(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x830(%rbp),%rsi
lea    0xc88(%rip),%rdi
call   1050 <printf@plt>
mov    -0x428(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1060 <memset@plt>
mov    -0x428(%rbp),%rdi
lea    0xc7c(%rip),%rsi
call   1030 <strcpy@plt>
mov    $0x2,%edi
call   10b0 <sleep@plt>
mov    -0x428(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1060 <memset@plt>
lea    -0x830(%rbp),%rdi
mov    -0x428(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x830(%rbp),%rsi
lea    0xc1f(%rip),%rdi
call   1050 <printf@plt>
mov    -0x428(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1060 <memset@plt>
mov    -0x428(%rbp),%rdi
lea    0xc1f(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x428(%rbp),%rdi
call   1040 <shmdt@plt>
mov    %eax,-0xc(%rbp)
lea    -0x8(%rbp),%rdi
call   10c0 <wait@plt>
mov    -0x10(%rbp),%edi
mov    0x2b71(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    %eax,%edx
call   1070 <shmctl@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x830,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x410,%rsp
mov    0x2e2a(%rip),%rax
mov    (%rax),%edx
mov    $0x4d2,%edi
mov    $0x400,%esi
call   10a0 <shmget@plt>
mov    %eax,%ebp
test   %eax,%eax
jns    1204 <main+0x54>
mov    0x2dec(%rip),%rax
mov    $0x1a0,%edx
or     (%rax),%edx
mov    $0x4d2,%edi
mov    $0x400,%esi
call   10a0 <shmget@plt>
mov    %eax,%ebp
test   %eax,%eax
js     13d5 <main+0x225>
xor    %eax,%eax
call   10d0 <fork@plt>
mov    %eax,0xc(%rsp)
test   %eax,%eax
je     1300 <main+0x150>
mov    $0x2,%edi
call   10b0 <sleep@plt>
xor    %r14d,%r14d
mov    %ebp,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1090 <shmat@plt>
test   %rax,%rax
je     13cc <main+0x21c>
mov    %rax,%rbx
lea    0x10(%rsp),%r15
mov    $0x400,%edx
mov    %r15,%rdi
xor    %esi,%esi
call   1060 <memset@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
lea    0xdd8(%rip),%r12
mov    %r12,%rdi
mov    %r15,%rsi
call   1050 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1060 <memset@plt>
lea    0xdd1(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    $0x2,%edi
call   10b0 <sleep@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1060 <memset@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %r12,%rdi
mov    %r15,%rsi
call   1050 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1060 <memset@plt>
lea    0xd90(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <shmdt@plt>
lea    0xc(%rsp),%rdi
call   10c0 <wait@plt>
mov    0x2ce8(%rip),%rax
mov    (%rax),%esi
mov    %ebp,%edi
xor    %edx,%edx
call   1070 <shmctl@plt>
jmp    13b9 <main+0x209>
xor    %r14d,%r14d
mov    %ebp,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1090 <shmat@plt>
test   %rax,%rax
je     13cc <main+0x21c>
mov    %rax,%rbx
lea    0xcec(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    $0x2,%edi
call   10b0 <sleep@plt>
lea    0x10(%rsp),%rbp
mov    $0x400,%edx
mov    %rbp,%rdi
xor    %esi,%esi
call   1060 <memset@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
lea    0xcc1(%rip),%r15
mov    %r15,%rdi
mov    %rbp,%rsi
call   1050 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1060 <memset@plt>
lea    0xcb9(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    $0x3,%edi
call   10b0 <sleep@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1060 <memset@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %r15,%rdi
mov    %rbp,%rsi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1040 <shmdt@plt>
mov    %r14d,%eax
add    $0x410,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc34(%rip),%rdi
jmp    13dc <main+0x22c>
lea    0xc24(%rip),%rdi
call   1080 <perror@plt>
mov    $0xffffffff,%r14d
jmp    13b9 <main+0x209>

LLVM IR (-O0):
@IPC_EXCL = global i32 0
@IPC_CREAT = global i32 0
@.str = [7 x i8] c"shmget\00"
@.str.1 = [6 x i8] c"shmat\00"
@.str.2 = [13 x i8] c"hello parent\00"
@.str.3 = [25 x i8] c"child recv a message:%s\0A\00"
@.str.4 = [6 x i8] c"sleep\00"
@.str.5 = [26 x i8] c"parent recv a message:%s\0A\00"
@.str.6 = [12 x i8] c"hello child\00"
@.str.7 = [3 x i8] c"ok\00"
@IPC_RMID = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca [1024 x i8]
%7 = alloca i8*
%8 = alloca [1024 x i8]
store i32 0, i32* %1
%9 = load i32, i32* @IPC_EXCL
%10 = call i32 @shmget(i32 1234, i32 1024, i32 %9)
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %22
13: ; preds = %0
%14 = load i32, i32* @IPC_CREAT
%15 = or i32 %14, 416
%16 = call i32 @shmget(i32 1234, i32 1024, i32 %15)
store i32 %16, i32* %4
%17 = load i32, i32* %4
%18 = icmp slt i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %13
%20 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %1
br label %93
21: ; preds = %13
br label %22
22: ; preds = %21, %0
%23 = call i32 (...) @fork()
store i32 %23, i32* %2
%24 = icmp ne i32 %23, 0
br i1 %24, label %56, label %25
25: ; preds = %22
%26 = load i32, i32* %4
%27 = call i8* @shmat(i32 %26, i32 0, i32 0)
store i8* %27, i8** %5
%28 = load i8*, i8** %5
%29 = icmp eq i8* %28, null
br i1 %29, label %30, label %32
30: ; preds = %25
%31 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %1
br label %93
32: ; preds = %25
%33 = load i8*, i8** %5
%34 = call i32 @strcpy(i8* %33, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%35 = call i32 @sleep(i32 2)
%36 = bitcast [1024 x i8]* %6 to i8*
%37 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%38 = load i8*, i8** %5
%39 = call i32 @strcpy(i8* %37, i8* %38)
%40 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%41 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i8* %40)
%42 = load i8*, i8** %5
%43 = call i32 @memset(i8* %42, i32 0, i32 1024)
%44 = load i8*, i8** %5
%45 = call i32 @strcpy(i8* %44, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%46 = call i32 @sleep(i32 3)
%47 = load i8*, i8** %5
%48 = call i32 @memset(i8* %47, i32 0, i32 1024)
%49 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%50 = load i8*, i8** %5
%51 = call i32 @strcpy(i8* %49, i8* %50)
%52 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%53 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i8* %52)
%54 = load i8*, i8** %5
%55 = call i32 @shmdt(i8* %54)
store i32 %55, i32* %3
store i32 0, i32* %1
br label %93
56: ; preds = %22
%57 = call i32 @sleep(i32 2)
%58 = load i32, i32* %4
%59 = call i8* @shmat(i32 %58, i32 0, i32 0)
store i8* %59, i8** %7
%60 = load i8*, i8** %7
%61 = icmp eq i8* %60, null
br i1 %61, label %62, label %64
62: ; preds = %56
%63 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %1
br label %93
64: ; preds = %56
%65 = bitcast [1024 x i8]* %8 to i8*
%66 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%67 = load i8*, i8** %7
%68 = call i32 @strcpy(i8* %66, i8* %67)
%69 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%70 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i8* %69)
%71 = load i8*, i8** %7
%72 = call i32 @memset(i8* %71, i32 0, i32 1024)
%73 = load i8*, i8** %7
%74 = call i32 @strcpy(i8* %73, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0))
%75 = call i32 @sleep(i32 2)
%76 = load i8*, i8** %7
%77 = call i32 @memset(i8* %76, i32 0, i32 1024)
%78 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%79 = load i8*, i8** %7
%80 = call i32 @strcpy(i8* %78, i8* %79)
%81 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%82 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i8* %81)
%83 = load i8*, i8** %7
%84 = call i32 @memset(i8* %83, i32 0, i32 1024)
%85 = load i8*, i8** %7
%86 = call i32 @strcpy(i8* %85, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%87 = load i8*, i8** %7
%88 = call i32 @shmdt(i8* %87)
store i32 %88, i32* %3
%89 = call i32 @wait(i32* %2)
%90 = load i32, i32* %4
%91 = load i32, i32* @IPC_RMID
%92 = call i32 @shmctl(i32 %90, i32 %91, i32* null)
store i32 0, i32* %1
br label %93
93: ; preds = %64, %62, %32, %30, %19
%94 = load i32, i32* %1
ret i32 %94
}

LLVM IR (-O2):
@IPC_EXCL = global i32 0
@IPC_CREAT = global i32 0
@.str = [7 x i8] c"shmget\00"
@.str.1 = [6 x i8] c"shmat\00"
@.str.2 = [13 x i8] c"hello parent\00"
@.str.3 = [25 x i8] c"child recv a message:%s\0A\00"
@.str.4 = [6 x i8] c"sleep\00"
@.str.5 = [26 x i8] c"parent recv a message:%s\0A\00"
@.str.6 = [12 x i8] c"hello child\00"
@.str.7 = [3 x i8] c"ok\00"
@IPC_RMID = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [1024 x i8]
%3 = alloca [1024 x i8]
%4 = bitcast i32* %1 to i8*
%5 = load i32, i32* @IPC_EXCL
%6 = tail call i32 @shmget(i32 1234, i32 1024, i32 %5)
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %0
%9 = load i32, i32* @IPC_CREAT
%10 = or i32 %9, 416
%11 = tail call i32 @shmget(i32 1234, i32 1024, i32 %10)
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %59
15: ; preds = %8, %0
%16 = phi i32 [ %11, %8 ], [ %6, %0 ]
%17 = tail call i32 (...) @fork()
store i32 %17, i32* %1
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %37
19: ; preds = %15
%20 = tail call i8* @shmat(i32 %16, i32 0, i32 0)
%21 = icmp eq i8* %20, null
br i1 %21, label %22, label %24
22: ; preds = %19
%23 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %59
24: ; preds = %19
%25 = tail call i32 @strcpy(i8* %20, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%26 = tail call i32 @sleep(i32 2)
%27 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%28 = call i32 @strcpy(i8* %27, i8* %20)
%29 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i8* %27)
%30 = call i32 @memset(i8* %20, i32 0, i32 1024)
%31 = call i32 @strcpy(i8* %20, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%32 = call i32 @sleep(i32 3)
%33 = call i32 @memset(i8* %20, i32 0, i32 1024)
%34 = call i32 @strcpy(i8* %27, i8* %20)
%35 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i8* %27)
%36 = call i32 @shmdt(i8* %20)
br label %59
37: ; preds = %15
%38 = tail call i32 @sleep(i32 2)
%39 = tail call i8* @shmat(i32 %16, i32 0, i32 0)
%40 = icmp eq i8* %39, null
br i1 %40, label %41, label %43
41: ; preds = %37
%42 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %59
43: ; preds = %37
%44 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%45 = call i32 @strcpy(i8* %44, i8* %39)
%46 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i8* %44)
%47 = call i32 @memset(i8* %39, i32 0, i32 1024)
%48 = call i32 @strcpy(i8* %39, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0))
%49 = call i32 @sleep(i32 2)
%50 = call i32 @memset(i8* %39, i32 0, i32 1024)
%51 = call i32 @strcpy(i8* %44, i8* %39)
%52 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i8* %44)
%53 = call i32 @memset(i8* %39, i32 0, i32 1024)
%54 = call i32 @strcpy(i8* %39, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%55 = call i32 @shmdt(i8* %39)
%56 = call i32 @wait(i32* %1)
%57 = load i32, i32* @IPC_RMID
%58 = call i32 @shmctl(i32 %16, i32 %57, i32* null)
br label %59
59: ; preds = %41, %43, %22, %24, %13
%60 = phi i32 [ -1, %13 ], [ -1, %22 ], [ 0, %24 ], [ -1, %41 ], [ 0, %43 ]
ret i32 %60
}