#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 fiveBytesBox {
  int dummy;
};
typedef int /*<<< orphan*/ pid_t;
typedef int /*<<< orphan*/ key_t;
typedef int /*<<< orphan*/ fiveBytesBox;

/* Variables and functions */
int INT_MAX;
int IPC_CREAT;
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ addToFBB(struct fiveBytesBox *, int);
int /*<<< orphan*/ fork();
int /*<<< orphan*/ getppid();
int /*<<< orphan*/ initFBB(struct fiveBytesBox *);
scalar_t__ isFiveIdenticalBytes(struct fiveBytesBox *);
scalar_t__ isRunning(int /*<<< orphan*/);
struct fiveBytesBox *malloc(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ rand();
scalar_t__ shmat(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
int shmget(int /*<<< orphan*/ const, int, int);
int /*<<< orphan*/ showFBB(struct fiveBytesBox *);
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
int main() {
  srand((unsigned int)time(NULL));
  const key_t MAIN_SHM_ID = (key_t)rand(), CHILD_MODE_SHM_ID = (key_t)rand();
  pid_t pid = fork();
  if (!pid) {
    pid_t ppid = getppid();
    int mainShmId = shmget(MAIN_SHM_ID, sizeof(int) * 1, IPC_CREAT | 0644),
        childStatusShmId =
            shmget(CHILD_MODE_SHM_ID, sizeof(bool), IPC_CREAT | 0644);
    if (mainShmId == -1 || childStatusShmId == -1) {
      printf("Child process shmid error\n");
      _exit(1);
    }
    int *mainBuff = (int *)shmat(mainShmId, NULL, 0);
    bool *childModeBuff = (bool *)shmat(childStatusShmId, NULL, 0);
    childModeBuff[0] = 1;
    if (mainBuff == NULL || childModeBuff == NULL) {
      printf("Child process NULL BUF ERROR\n");
      _exit(1);
    }
    *mainBuff = 1;
    for (int i = 0; *childModeBuff && isRunning(ppid); i++) {
      if (i == INT_MAX)
        i = i % 5;
      mainBuff[i % 1] *= 2;
    }
    _exit(0);
  }
  int parentMainShmId = shmget(MAIN_SHM_ID, sizeof(int) * 1, IPC_CREAT | 0644),
      parentChildStatusShmId =
          shmget(CHILD_MODE_SHM_ID, sizeof(bool), IPC_CREAT | 0644);
  if (parentMainShmId == -1 || parentChildStatusShmId == -1)
    printf("Parent shmget ERROR\n");
  int *parentMainBuff = (int *)shmat(parentMainShmId, NULL, 0);
  bool *parentChildModeBuff = (bool *)shmat(parentChildStatusShmId, NULL, 0);
  if (parentMainBuff == NULL || parentChildModeBuff == NULL)
    printf("Parent shmat ERROR\n");
  *parentChildModeBuff = 1;
  struct fiveBytesBox *fiveBytesBox = malloc(sizeof(fiveBytesBox));
  initFBB(fiveBytesBox);
  for (int i = 0; true; i++) {
    addToFBB(fiveBytesBox, parentMainBuff[i % 1]);
    if (isFiveIdenticalBytes(fiveBytesBox)) {
      printf("\n\nBINGO!!!\n");
      showFBB(fiveBytesBox);
      parentChildModeBuff[0] = 0;
      break;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1090 <time@plt>
mov    %eax,%edi
call   1070 <srand@plt>
mov    $0x0,%al
call   1110 <rand@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1110 <rand@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1100 <fork@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    13a0 <main+0x1b0>
mov    $0x0,%al
call   10f0 <getppid@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2d8d(%rip),%rax
mov    (%rax),%edx
or     $0x1a4,%edx
mov    $0x4,%esi
call   10d0 <shmget@plt>
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    0x2d6e(%rip),%rax
mov    (%rax),%edx
or     $0x1a4,%edx
mov    $0x4,%esi
call   10d0 <shmget@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
je     1293 <main+0xa3>
cmpl   $0xffffffff,-0x1c(%rbp)
jne    12a9 <main+0xb9>
lea    0xd66(%rip),%rdi
call   1060 <printf@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>
mov    -0x18(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   10c0 <shmat@plt>
mov    %rax,-0x28(%rbp)
mov    -0x1c(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   10c0 <shmat@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
movl   $0x1,(%rax)
cmpq   $0x0,-0x28(%rbp)
je     12ed <main+0xfd>
cmpq   $0x0,-0x30(%rbp)
jne    1303 <main+0x113>
lea    0xd27(%rip),%rdi
call   1060 <printf@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>
mov    -0x28(%rbp),%rax
movl   $0x1,(%rax)
movl   $0x0,-0x34(%rbp)
mov    -0x30(%rbp),%rcx
xor    %eax,%eax
cmpl   $0x0,(%rcx)
mov    %al,-0x5d(%rbp)
je     1338 <main+0x148>
mov    -0x14(%rbp),%edi
call   10e0 <isRunning@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5d(%rbp)
mov    -0x5d(%rbp),%al
test   $0x1,%al
jne    1348 <main+0x158>
jmp    1399 <main+0x1a9>
mov    -0x34(%rbp),%eax
mov    0x2c96(%rip),%rcx
cmp    (%rcx),%eax
jne    1368 <main+0x178>
mov    -0x34(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %edx,-0x34(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x34(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    -0x68(%rbp),%rax
movslq %edx,%rcx
mov    (%rax,%rcx,4),%edx
shl    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1314 <main+0x124>
xor    %edi,%edi
call   1030 <_exit@plt>
mov    -0x8(%rbp),%edi
mov    0x2c2e(%rip),%rax
mov    (%rax),%edx
or     $0x1a4,%edx
mov    $0x4,%esi
call   10d0 <shmget@plt>
mov    %eax,-0x38(%rbp)
mov    -0xc(%rbp),%edi
mov    0x2c0f(%rip),%rax
mov    (%rax),%edx
or     $0x1a4,%edx
mov    $0x4,%esi
call   10d0 <shmget@plt>
mov    %eax,-0x3c(%rbp)
cmpl   $0xffffffff,-0x38(%rbp)
je     13f2 <main+0x202>
cmpl   $0xffffffff,-0x3c(%rbp)
jne    13fe <main+0x20e>
lea    0xc40(%rip),%rdi
call   1060 <printf@plt>
mov    -0x38(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   10c0 <shmat@plt>
mov    %rax,-0x48(%rbp)
mov    -0x3c(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   10c0 <shmat@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x48(%rbp)
je     1438 <main+0x248>
cmpq   $0x0,-0x50(%rbp)
jne    1444 <main+0x254>
lea    0xc0f(%rip),%rdi
call   1060 <printf@plt>
mov    -0x50(%rbp),%rax
movl   $0x1,(%rax)
mov    $0x8,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rdi
call   1050 <initFBB@plt>
movl   $0x0,-0x5c(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    147b <main+0x28b>
jmp    14eb <main+0x2fb>
mov    -0x58(%rbp),%rdi
mov    -0x48(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x5c(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    -0x70(%rbp),%rax
movslq %edx,%rcx
mov    (%rax,%rcx,4),%esi
call   10b0 <addToFBB@plt>
mov    -0x58(%rbp),%rdi
call   1080 <isFiveIdenticalBytes@plt>
cmp    $0x0,%rax
je     14d8 <main+0x2e8>
lea    0xba7(%rip),%rdi
call   1060 <printf@plt>
mov    -0x58(%rbp),%rdi
call   1040 <showFBB@plt>
mov    -0x50(%rbp),%rax
movl   $0x0,(%rax)
jmp    14eb <main+0x2fb>
jmp    14dd <main+0x2ed>
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    146c <main+0x27c>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
xor    %edi,%edi
call   1090 <time@plt>
mov    %eax,%edi
call   1070 <srand@plt>
xor    %eax,%eax
call   1110 <rand@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1110 <rand@plt>
mov    %eax,%r12d
xor    %eax,%eax
call   1100 <fork@plt>
test   %eax,%eax
je     130e <main+0x11e>
mov    0x2db1(%rip),%r14
mov    $0x1a4,%ebp
mov    (%r14),%edx
or     %ebp,%edx
mov    %ebx,%edi
mov    $0x4,%esi
call   10d0 <shmget@plt>
mov    %eax,%ebx
or     (%r14),%ebp
mov    %r12d,%edi
mov    $0x4,%esi
mov    %ebp,%edx
call   10d0 <shmget@plt>
mov    %eax,%r14d
cmp    $0xffffffff,%ebx
je     1267 <main+0x77>
cmp    $0xffffffff,%r14d
jne    1273 <main+0x83>
lea    0xde7(%rip),%rdi
call   1040 <puts@plt>
mov    %ebx,%edi
xor    %esi,%esi
xor    %edx,%edx
call   10c0 <shmat@plt>
mov    %rax,%rbp
mov    %r14d,%edi
xor    %esi,%esi
xor    %edx,%edx
call   10c0 <shmat@plt>
mov    %rax,%r14
test   %rbp,%rbp
je     129a <main+0xaa>
test   %r14,%r14
jne    12a6 <main+0xb6>
lea    0xda1(%rip),%rdi
call   1040 <puts@plt>
movl   $0x1,(%r14)
mov    $0x8,%edi
call   10a0 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1060 <initFBB@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x0(%rbp),%esi
mov    %rbx,%rdi
call   10b0 <addToFBB@plt>
mov    %rbx,%rdi
call   1080 <isFiveIdenticalBytes@plt>
test   %rax,%rax
je     12d0 <main+0xe0>
lea    0xd48(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1050 <showFBB@plt>
movl   $0x0,(%r14)
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %eax,%eax
call   10f0 <getppid@plt>
mov    %eax,%r14d
mov    0x2cc1(%rip),%rbp
mov    $0x1a4,%r15d
mov    0x0(%rbp),%edx
or     %r15d,%edx
mov    %ebx,%edi
mov    $0x4,%esi
call   10d0 <shmget@plt>
mov    %eax,%ebx
or     0x0(%rbp),%r15d
mov    %r12d,%edi
mov    $0x4,%esi
mov    %r15d,%edx
call   10d0 <shmget@plt>
cmp    $0xffffffff,%ebx
je     1386 <main+0x196>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
je     1386 <main+0x196>
mov    %ebx,%edi
xor    %esi,%esi
xor    %edx,%edx
call   10c0 <shmat@plt>
mov    %rax,%rbx
mov    %ebp,%edi
xor    %esi,%esi
xor    %edx,%edx
call   10c0 <shmat@plt>
movl   $0x1,(%rax)
test   %rbx,%rbx
jne    139c <main+0x1ac>
lea    0xc7c(%rip),%rdi
jmp    138d <main+0x19d>
lea    0xc90(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>
mov    %rax,%rbp
movl   $0x1,(%rbx)
cmpl   $0x0,0x0(%rbp)
je     13c0 <main+0x1d0>
mov    %r14d,%edi
call   10e0 <isRunning@plt>
test   %rax,%rax
je     13c0 <main+0x1d0>
shll   (%rbx)
cmpl   $0x0,0x0(%rbp)
jne    13ab <main+0x1bb>
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
%struct.fiveBytesBox = type { i32 }
@IPC_CREAT = global i32 0
@.str = [27 x i8] c"Child process shmid error\0A\00"
@.str.1 = [30 x i8] c"Child process NULL BUF ERROR\0A\00"
@INT_MAX = global i32 0
@.str.2 = [21 x i8] c"Parent shmget ERROR\0A\00"
@.str.3 = [20 x i8] c"Parent shmat ERROR\0A\00"
@.str.4 = [12 x i8] c"\0A\0ABINGO!!!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32*
%14 = alloca i32*
%15 = alloca %struct.fiveBytesBox*
%16 = alloca i32
store i32 0, i32* %1
%17 = call i64 @time(i32* null)
%18 = trunc i64 %17 to i32
%19 = call i32 @srand(i32 %18)
%20 = call i32 (...) @rand()
store i32 %20, i32* %2
%21 = call i32 (...) @rand()
store i32 %21, i32* %3
%22 = call i32 (...) @fork()
store i32 %22, i32* %4
%23 = load i32, i32* %4
%24 = icmp ne i32 %23, 0
br i1 %24, label %92, label %25
25: ; preds = %0
%26 = call i32 (...) @getppid()
store i32 %26, i32* %5
%27 = load i32, i32* %2
%28 = load i32, i32* @IPC_CREAT
%29 = or i32 %28, 420
%30 = call i32 @shmget(i32 %27, i32 4, i32 %29)
store i32 %30, i32* %6
%31 = load i32, i32* %3
%32 = load i32, i32* @IPC_CREAT
%33 = or i32 %32, 420
%34 = call i32 @shmget(i32 %31, i32 4, i32 %33)
store i32 %34, i32* %7
%35 = load i32, i32* %6
%36 = icmp eq i32 %35, -1
br i1 %36, label %40, label %37
37: ; preds = %25
%38 = load i32, i32* %7
%39 = icmp eq i32 %38, -1
br i1 %39, label %40, label %43
40: ; preds = %37, %25
%41 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%42 = call i32 @_exit(i32 1)
unreachable
43: ; preds = %37
%44 = load i32, i32* %6
%45 = call i64 @shmat(i32 %44, i32* null, i32 0)
%46 = inttoptr i64 %45 to i32*
store i32* %46, i32** %8
%47 = load i32, i32* %7
%48 = call i64 @shmat(i32 %47, i32* null, i32 0)
%49 = inttoptr i64 %48 to i32*
store i32* %49, i32** %9
%50 = load i32*, i32** %9
%51 = getelementptr inbounds i32, i32* %50, i64 0
store i32 1, i32* %51
%52 = load i32*, i32** %8
%53 = icmp eq i32* %52, null
br i1 %53, label %57, label %54
54: ; preds = %43
%55 = load i32*, i32** %9
%56 = icmp eq i32* %55, null
br i1 %56, label %57, label %60
57: ; preds = %54, %43
%58 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%59 = call i32 @_exit(i32 1)
unreachable
60: ; preds = %54
%61 = load i32*, i32** %8
store i32 1, i32* %61
store i32 0, i32* %10
br label %62
62: ; preds = %87, %60
%63 = load i32*, i32** %9
%64 = load i32, i32* %63
%65 = icmp ne i32 %64, 0
br i1 %65, label %66, label %70
66: ; preds = %62
%67 = load i32, i32* %5
%68 = call i64 @isRunning(i32 %67)
%69 = icmp ne i64 %68, 0
br label %70
70: ; preds = %66, %62
%71 = phi i1 [ false, %62 ], [ %69, %66 ]
br i1 %71, label %72, label %90
72: ; preds = %70
%73 = load i32, i32* %10
%74 = load i32, i32* @INT_MAX
%75 = icmp eq i32 %73, %74
br i1 %75, label %76, label %79
76: ; preds = %72
%77 = load i32, i32* %10
%78 = srem i32 %77, 5
store i32 %78, i32* %10
br label %79
79: ; preds = %76, %72
%80 = load i32*, i32** %8
%81 = load i32, i32* %10
%82 = srem i32 %81, 1
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds i32, i32* %80, i64 %83
%85 = load i32, i32* %84
%86 = mul nsw i32 %85, 2
store i32 %86, i32* %84
br label %87
87: ; preds = %79
%88 = load i32, i32* %10
%89 = add nsw i32 %88, 1
store i32 %89, i32* %10
br label %62
90: ; preds = %70
%91 = call i32 @_exit(i32 0)
unreachable
92: ; preds = %0
%93 = load i32, i32* %2
%94 = load i32, i32* @IPC_CREAT
%95 = or i32 %94, 420
%96 = call i32 @shmget(i32 %93, i32 4, i32 %95)
store i32 %96, i32* %11
%97 = load i32, i32* %3
%98 = load i32, i32* @IPC_CREAT
%99 = or i32 %98, 420
%100 = call i32 @shmget(i32 %97, i32 4, i32 %99)
store i32 %100, i32* %12
%101 = load i32, i32* %11
%102 = icmp eq i32 %101, -1
br i1 %102, label %106, label %103
103: ; preds = %92
%104 = load i32, i32* %12
%105 = icmp eq i32 %104, -1
br i1 %105, label %106, label %108
106: ; preds = %103, %92
%107 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
br label %108
108: ; preds = %106, %103
%109 = load i32, i32* %11
%110 = call i64 @shmat(i32 %109, i32* null, i32 0)
%111 = inttoptr i64 %110 to i32*
store i32* %111, i32** %13
%112 = load i32, i32* %12
%113 = call i64 @shmat(i32 %112, i32* null, i32 0)
%114 = inttoptr i64 %113 to i32*
store i32* %114, i32** %14
%115 = load i32*, i32** %13
%116 = icmp eq i32* %115, null
br i1 %116, label %120, label %117
117: ; preds = %108
%118 = load i32*, i32** %14
%119 = icmp eq i32* %118, null
br i1 %119, label %120, label %122
120: ; preds = %117, %108
%121 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
br label %122
122: ; preds = %120, %117
%123 = load i32*, i32** %14
store i32 1, i32* %123
%124 = call %struct.fiveBytesBox* @malloc(i32 8)
store %struct.fiveBytesBox* %124, %struct.fiveBytesBox** %15
%125 = load %struct.fiveBytesBox*, %struct.fiveBytesBox** %15
%126 = call i32 @initFBB(%struct.fiveBytesBox* %125)
store i32 0, i32* %16
br label %127
127: ; preds = %147, %122
br i1 true, label %128, label %150
128: ; preds = %127
%129 = load %struct.fiveBytesBox*, %struct.fiveBytesBox** %15
%130 = load i32*, i32** %13
%131 = load i32, i32* %16
%132 = srem i32 %131, 1
%133 = sext i32 %132 to i64
%134 = getelementptr inbounds i32, i32* %130, i64 %133
%135 = load i32, i32* %134
%136 = call i32 @addToFBB(%struct.fiveBytesBox* %129, i32 %135)
%137 = load %struct.fiveBytesBox*, %struct.fiveBytesBox** %15
%138 = call i64 @isFiveIdenticalBytes(%struct.fiveBytesBox* %137)
%139 = icmp ne i64 %138, 0
br i1 %139, label %140, label %146
140: ; preds = %128
%141 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
%142 = load %struct.fiveBytesBox*, %struct.fiveBytesBox** %15
%143 = call i32 @showFBB(%struct.fiveBytesBox* %142)
%144 = load i32*, i32** %14
%145 = getelementptr inbounds i32, i32* %144, i64 0
store i32 0, i32* %145
br label %150
146: ; preds = %128
br label %147
147: ; preds = %146
%148 = load i32, i32* %16
%149 = add nsw i32 %148, 1
store i32 %149, i32* %16
br label %127
150: ; preds = %140, %127
ret i32 0
}

LLVM IR (-O2):
%struct.fiveBytesBox = type { i32 }
@IPC_CREAT = global i32 0
@INT_MAX = global i32 0
@str = [29 x i8] c"Child process NULL BUF ERROR\00"
@str.5 = [26 x i8] c"Child process shmid error\00"
@str.6 = [11 x i8] c"\0A\0ABINGO!!!\00"
@str.7 = [19 x i8] c"Parent shmat ERROR\00"
@str.8 = [20 x i8] c"Parent shmget ERROR\00"
define i32 @main() {
%1 = tail call i64 @time(i32* null)
%2 = trunc i64 %1 to i32
%3 = tail call i32 @srand(i32 %2)
%4 = tail call i32 (...) @rand()
%5 = tail call i32 (...) @rand()
%6 = tail call i32 (...) @fork()
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %44
8: ; preds = %0
%9 = tail call i32 (...) @getppid()
%10 = load i32, i32* @IPC_CREAT
%11 = or i32 %10, 420
%12 = tail call i32 @shmget(i32 %4, i32 4, i32 %11)
%13 = load i32, i32* @IPC_CREAT
%14 = or i32 %13, 420
%15 = tail call i32 @shmget(i32 %5, i32 4, i32 %14)
%16 = icmp eq i32 %12, -1
%17 = icmp eq i32 %15, -1
%18 = select i1 %16, i1 true, i1 %17
br i1 %18, label %19, label %22
19: ; preds = %8
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.5, i64 0, i64 0))
%21 = tail call i32 @_exit(i32 1)
unreachable
22: ; preds = %8
%23 = tail call i64 @shmat(i32 %12, i32* null, i32 0)
%24 = inttoptr i64 %23 to i32*
%25 = tail call i64 @shmat(i32 %15, i32* null, i32 0)
%26 = inttoptr i64 %25 to i32*
store i32 1, i32* %26
%27 = icmp eq i64 %23, 0
br i1 %27, label %28, label %31
28: ; preds = %22
%29 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%30 = tail call i32 @_exit(i32 1)
unreachable
31: ; preds = %22
store i32 1, i32* %24
%32 = load i32, i32* %26
%33 = icmp eq i32 %32, 0
br i1 %33, label %37, label %34
34: ; preds = %31, %39
%35 = tail call i64 @isRunning(i32 %9)
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %39
37: ; preds = %34, %39, %31
%38 = tail call i32 @_exit(i32 0)
unreachable
39: ; preds = %34
%40 = load i32, i32* %24
%41 = shl nsw i32 %40, 1
store i32 %41, i32* %24
%42 = load i32, i32* %26
%43 = icmp eq i32 %42, 0
br i1 %43, label %37, label %34
44: ; preds = %0
%45 = load i32, i32* @IPC_CREAT
%46 = or i32 %45, 420
%47 = tail call i32 @shmget(i32 %4, i32 4, i32 %46)
%48 = load i32, i32* @IPC_CREAT
%49 = or i32 %48, 420
%50 = tail call i32 @shmget(i32 %5, i32 4, i32 %49)
%51 = icmp eq i32 %47, -1
%52 = icmp eq i32 %50, -1
%53 = select i1 %51, i1 true, i1 %52
br i1 %53, label %54, label %56
54: ; preds = %44
%55 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.8, i64 0, i64 0))
br label %56
56: ; preds = %44, %54
%57 = tail call i64 @shmat(i32 %47, i32* null, i32 0)
%58 = inttoptr i64 %57 to i32*
%59 = tail call i64 @shmat(i32 %50, i32* null, i32 0)
%60 = inttoptr i64 %59 to i32*
%61 = icmp eq i64 %57, 0
%62 = icmp eq i64 %59, 0
%63 = select i1 %61, i1 true, i1 %62
br i1 %63, label %64, label %66
64: ; preds = %56
%65 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.7, i64 0, i64 0))
br label %66
66: ; preds = %56, %64
store i32 1, i32* %60
%67 = tail call %struct.fiveBytesBox* @malloc(i32 8)
%68 = tail call i32 @initFBB(%struct.fiveBytesBox* %67)
br label %69
69: ; preds = %69, %66
%70 = load i32, i32* %58
%71 = tail call i32 @addToFBB(%struct.fiveBytesBox* %67, i32 %70)
%72 = tail call i64 @isFiveIdenticalBytes(%struct.fiveBytesBox* %67)
%73 = icmp eq i64 %72, 0
br i1 %73, label %69, label %74
74: ; preds = %69
%75 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.6, i64 0, i64 0))
%76 = tail call i32 @showFBB(%struct.fiveBytesBox* %67)
store i32 0, i32* %60
ret i32 0
}