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

/* Variables and functions */
int /*<<< orphan*/ MAP_SHARED;
int O_CREAT;
int O_RDONLY;
int O_RDWR;
int /*<<< orphan*/ PROT_READ;
int /*<<< orphan*/ PROT_WRITE;
int atoi(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fork();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ ftruncate(int, int const);
void *mmap(int /*<<< orphan*/, int const, int /*<<< orphan*/,
           int /*<<< orphan*/, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int shm_open(char const *, int, int);
int /*<<< orphan*/ shm_unlink(char const *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ wait(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  pid_t pid;
  int n;
  const int SIZE = 4096;
  const char *name = "OS";
  if (argc != 2) {
    printf("This program expects exactly 1 parameter not: %d\n", argc);
    return 0;
  }
  n = atoi(argv[1]);
  if (n < 1) {
    printf("The collatz conjecture only works for numbers > 0.\n");
    return 0;
  }
  pid = fork();
  if (pid < 0) {
    fprintf(stderr, "Fork Failed");
    return 1;
  } else if (pid == 0) {
    int shm_fd, count;
    void *ptr;
    int *ptr_start;
    shm_fd = shm_open(name, O_CREAT | O_RDWR, 0666);
    ftruncate(shm_fd, SIZE);
    count = 0;
    ptr = mmap(0, SIZE, PROT_WRITE, MAP_SHARED, shm_fd, 0);
    ptr_start = (int *)(ptr + sizeof(n));
    while (n != 1) {
      if (n & 1)
        n = 3 * n + 1;
      else
        n >>= 1;
      *ptr_start = n;
      ptr_start++;
      count++;
    }
    int *int_ptr = (int *)ptr;
    *int_ptr = count;
    exit(0);
  } else {
    wait(NULL);
    int shm_fd;
    void *ptr;
    shm_fd = shm_open(name, O_RDONLY, 0666);
    ptr = mmap(0, SIZE, PROT_READ, MAP_SHARED, shm_fd, 0);
    int *count_ptr = (int *)ptr;
    int count = *count_ptr;
    if (count) {
      count_ptr++;
      for (int i = 0; i < count; i++) {
        printf("%d\n", *count_ptr);
        count_ptr++;
      }
    } else {
      printf("%d\n", 0);
    }
    shm_unlink(name);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1000,-0x20(%rbp)
lea    0xe3c(%rip),%rax
mov    %rax,-0x28(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     11ef <main+0x4f>
mov    -0x8(%rbp),%esi
lea    0xe27(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    141d <main+0x27d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x1,-0x1c(%rbp)
jge    1223 <main+0x83>
lea    0xe25(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    141d <main+0x27d>
mov    $0x0,%al
call   10c0 <fork@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jge    125a <main+0xba>
mov    0x2d78(%rip),%rax
mov    (%rax),%edi
lea    0xe20(%rip),%rsi
call   1060 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    141d <main+0x27d>
cmpq   $0x0,-0x18(%rbp)
jne    133e <main+0x19e>
mov    -0x28(%rbp),%rdi
mov    0x2d88(%rip),%rax
mov    (%rax),%esi
mov    0x2d57(%rip),%rax
or     (%rax),%esi
mov    $0x1b6,%edx
call   1090 <shm_open@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%edi
mov    $0x1000,%esi
call   1050 <ftruncate@plt>
movl   $0x0,-0x30(%rbp)
mov    0x2d0d(%rip),%rax
mov    (%rax),%edx
mov    0x2d34(%rip),%rax
mov    (%rax),%ecx
mov    -0x2c(%rbp),%r8d
xor    %r9d,%r9d
mov    $0x1000,%esi
mov    %r9d,%edi
call   1030 <mmap@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x40(%rbp)
cmpl   $0x1,-0x1c(%rbp)
je     1326 <main+0x186>
mov    -0x1c(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     12fa <main+0x15a>
imul   $0x3,-0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1303 <main+0x163>
mov    -0x1c(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%ecx
mov    -0x40(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x40(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x40(%rbp)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    12d2 <main+0x132>
mov    -0x38(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x30(%rbp),%ecx
mov    -0x48(%rbp),%rax
mov    %ecx,(%rax)
xor    %edi,%edi
call   1080 <exit@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10b0 <wait@plt>
mov    -0x28(%rbp),%rdi
mov    0x2c76(%rip),%rax
mov    (%rax),%esi
mov    $0x1b6,%edx
call   1090 <shm_open@plt>
mov    %eax,-0x4c(%rbp)
mov    0x2c88(%rip),%rax
mov    (%rax),%edx
mov    0x2c6f(%rip),%rax
mov    (%rax),%ecx
mov    -0x4c(%rbp),%r8d
xor    %r9d,%r9d
mov    $0x1000,%esi
mov    %r9d,%edi
call   1030 <mmap@plt>
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x64(%rbp)
cmpl   $0x0,-0x64(%rbp)
je     13f8 <main+0x258>
mov    -0x60(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x60(%rbp)
movl   $0x0,-0x68(%rbp)
mov    -0x68(%rbp),%eax
cmp    -0x64(%rbp),%eax
jge    13f3 <main+0x253>
mov    -0x60(%rbp),%rax
mov    (%rax),%esi
lea    0xc5f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x60(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x60(%rbp)
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    13b9 <main+0x219>
jmp    1408 <main+0x268>
lea    0xc32(%rip),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x28(%rbp),%rdi
call   10a0 <shm_unlink@plt>
jmp    1416 <main+0x276>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    $0x2,%edi
jne    1269 <main+0xb9>
mov    0x8(%rsi),%rdi
call   1080 <atoi@plt>
test   %eax,%eax
jle    127f <main+0xcf>
mov    %eax,%ebx
xor    %eax,%eax
call   10d0 <fork@plt>
test   %rax,%rax
js     128d <main+0xdd>
je     12d4 <main+0x124>
xor    %edi,%edi
call   10c0 <wait@plt>
mov    0x2dd1(%rip),%rax
mov    (%rax),%esi
lea    0xe00(%rip),%rdi
mov    $0x1b6,%edx
call   10a0 <shm_open@plt>
mov    0x2ddf(%rip),%rcx
mov    (%rcx),%edx
mov    0x2dc6(%rip),%rcx
mov    (%rcx),%ecx
xor    %edi,%edi
mov    $0x1000,%esi
mov    %eax,%r8d
xor    %r9d,%r9d
call   1040 <mmap@plt>
mov    (%rax),%ebp
test   %rbp,%rbp
je     12a9 <main+0xf9>
test   %ebp,%ebp
jle    12b9 <main+0x109>
mov    %rax,%r15
lea    0xdea(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    0x4(%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
cmp    %ebx,%ebp
jne    1250 <main+0xa0>
jmp    12b9 <main+0x109>
mov    %edi,%eax
lea    0xd91(%rip),%rdi
xor    %ebx,%ebx
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    12c7 <main+0x117>
lea    0xdbb(%rip),%rdi
call   1030 <puts@plt>
jmp    12c5 <main+0x115>
mov    0x2d24(%rip),%rax
mov    (%rax),%edi
lea    0xd98(%rip),%rsi
call   1070 <fprintf@plt>
mov    $0x1,%ebx
jmp    12c7 <main+0x117>
lea    0xd81(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xd40(%rip),%rdi
call   10b0 <shm_unlink@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2d1d(%rip),%rax
mov    0x2cee(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
lea    0xd13(%rip),%rdi
mov    $0x1b6,%edx
call   10a0 <shm_open@plt>
mov    %eax,%r14d
mov    %eax,%edi
mov    $0x1000,%esi
call   1060 <ftruncate@plt>
mov    0x2ca3(%rip),%rax
mov    (%rax),%edx
mov    0x2cca(%rip),%rax
mov    (%rax),%ecx
xor    %ebp,%ebp
xor    %edi,%edi
mov    $0x1000,%esi
mov    %r14d,%r8d
xor    %r9d,%r9d
call   1040 <mmap@plt>
cmp    $0x1,%ebx
je     134e <main+0x19e>
xor    %ebp,%ebp
mov    %ebx,%ecx
sar    %ecx
test   $0x1,%bl
lea    0x1(%rbx,%rbx,2),%ebx
cmove  %ecx,%ebx
mov    %ebx,0x4(%rax,%rbp,4)
add    $0x1,%rbp
cmp    $0x1,%ebx
jne    1333 <main+0x183>
mov    %ebp,(%rax)
xor    %edi,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"OS\00"
@.str.1 = [50 x i8] c"This program expects exactly 1 parameter not: %d\0A\00"
@.str.2 = [52 x i8] c"The collatz conjecture only works for numbers > 0.\0A\00"
@stderr = global i32 0
@.str.3 = [12 x i8] c"Fork Failed\00"
@O_CREAT = global i32 0
@O_RDWR = global i32 0
@PROT_WRITE = global i32 0
@MAP_SHARED = global i32 0
@O_RDONLY = global i32 0
@PROT_READ = global i32 0
@.str.4 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i32*
%14 = alloca i32*
%15 = alloca i32
%16 = alloca i8*
%17 = alloca i32*
%18 = alloca i32
%19 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 4096, i32* %8
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %9
%20 = load i32, i32* %4
%21 = icmp ne i32 %20, 2
br i1 %21, label %22, label %25
22: ; preds = %2
%23 = load i32, i32* %4
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), i32 %23)
store i32 0, i32* %3
br label %125
25: ; preds = %2
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i8*, i8** %27
%29 = call i32 @atoi(i8* %28)
store i32 %29, i32* %7
%30 = load i32, i32* %7
%31 = icmp slt i32 %30, 1
br i1 %31, label %32, label %34
32: ; preds = %25
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %3
br label %125
34: ; preds = %25
%35 = call i64 (...) @fork()
store i64 %35, i64* %6
%36 = load i64, i64* %6
%37 = icmp slt i64 %36, 0
br i1 %37, label %38, label %41
38: ; preds = %34
%39 = load i32, i32* @stderr
%40 = call i32 @fprintf(i32 %39, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %3
br label %125
41: ; preds = %34
%42 = load i64, i64* %6
%43 = icmp eq i64 %42, 0
br i1 %43, label %44, label %86
44: ; preds = %41
%45 = load i8*, i8** %9
%46 = load i32, i32* @O_CREAT
%47 = load i32, i32* @O_RDWR
%48 = or i32 %46, %47
%49 = call i32 @shm_open(i8* %45, i32 %48, i32 438)
store i32 %49, i32* %10
%50 = load i32, i32* %10
%51 = call i32 @ftruncate(i32 %50, i32 4096)
store i32 0, i32* %11
%52 = load i32, i32* @PROT_WRITE
%53 = load i32, i32* @MAP_SHARED
%54 = load i32, i32* %10
%55 = call i8* @mmap(i32 0, i32 4096, i32 %52, i32 %53, i32 %54, i32 0)
store i8* %55, i8** %12
%56 = load i8*, i8** %12
%57 = getelementptr i8, i8* %56, i64 4
%58 = bitcast i8* %57 to i32*
store i32* %58, i32** %13
br label %59
59: ; preds = %73, %44
%60 = load i32, i32* %7
%61 = icmp ne i32 %60, 1
br i1 %61, label %62, label %80
62: ; preds = %59
%63 = load i32, i32* %7
%64 = and i32 %63, 1
%65 = icmp ne i32 %64, 0
br i1 %65, label %66, label %70
66: ; preds = %62
%67 = load i32, i32* %7
%68 = mul nsw i32 3, %67
%69 = add nsw i32 %68, 1
store i32 %69, i32* %7
br label %73
70: ; preds = %62
%71 = load i32, i32* %7
%72 = ashr i32 %71, 1
store i32 %72, i32* %7
br label %73
73: ; preds = %70, %66
%74 = load i32, i32* %7
%75 = load i32*, i32** %13
store i32 %74, i32* %75
%76 = load i32*, i32** %13
%77 = getelementptr inbounds i32, i32* %76, i32 1
store i32* %77, i32** %13
%78 = load i32, i32* %11
%79 = add nsw i32 %78, 1
store i32 %79, i32* %11
br label %59
80: ; preds = %59
%81 = load i8*, i8** %12
%82 = bitcast i8* %81 to i32*
store i32* %82, i32** %14
%83 = load i32, i32* %11
%84 = load i32*, i32** %14
store i32 %83, i32* %84
%85 = call i32 @exit(i32 0)
unreachable
86: ; preds = %41
%87 = call i32 @wait(i32* null)
%88 = load i8*, i8** %9
%89 = load i32, i32* @O_RDONLY
%90 = call i32 @shm_open(i8* %88, i32 %89, i32 438)
store i32 %90, i32* %15
%91 = load i32, i32* @PROT_READ
%92 = load i32, i32* @MAP_SHARED
%93 = load i32, i32* %15
%94 = call i8* @mmap(i32 0, i32 4096, i32 %91, i32 %92, i32 %93, i32 0)
store i8* %94, i8** %16
%95 = load i8*, i8** %16
%96 = bitcast i8* %95 to i32*
store i32* %96, i32** %17
%97 = load i32*, i32** %17
%98 = load i32, i32* %97
store i32 %98, i32* %18
%99 = load i32, i32* %18
%100 = icmp ne i32 %99, 0
br i1 %100, label %101, label %118
101: ; preds = %86
%102 = load i32*, i32** %17
%103 = getelementptr inbounds i32, i32* %102, i32 1
store i32* %103, i32** %17
store i32 0, i32* %19
br label %104
104: ; preds = %114, %101
%105 = load i32, i32* %19
%106 = load i32, i32* %18
%107 = icmp slt i32 %105, %106
br i1 %107, label %108, label %117
108: ; preds = %104
%109 = load i32*, i32** %17
%110 = load i32, i32* %109
%111 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %110)
%112 = load i32*, i32** %17
%113 = getelementptr inbounds i32, i32* %112, i32 1
store i32* %113, i32** %17
br label %114
114: ; preds = %108
%115 = load i32, i32* %19
%116 = add nsw i32 %115, 1
store i32 %116, i32* %19
br label %104
117: ; preds = %104
br label %120
118: ; preds = %86
%119 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 0)
br label %120
120: ; preds = %118, %117
%121 = load i8*, i8** %9
%122 = call i32 @shm_unlink(i8* %121)
br label %123
123: ; preds = %120
br label %124
124: ; preds = %123
store i32 0, i32* %3
br label %125
125: ; preds = %124, %38, %32, %22
%126 = load i32, i32* %3
ret i32 %126
}

LLVM IR (-O2):
@.str = [3 x i8] c"OS\00"
@.str.1 = [50 x i8] c"This program expects exactly 1 parameter not: %d\0A\00"
@stderr = global i32 0
@.str.3 = [12 x i8] c"Fork Failed\00"
@O_CREAT = global i32 0
@O_RDWR = global i32 0
@PROT_WRITE = global i32 0
@MAP_SHARED = global i32 0
@O_RDONLY = global i32 0
@PROT_READ = global i32 0
@.str.4 = [4 x i8] c"%d\0A\00"
@str = [51 x i8] c"The collatz conjecture only works for numbers > 0.\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), i32 %0)
br label %78
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @atoi(i8* %8)
%10 = icmp slt i32 %9, 1
br i1 %10, label %11, label %13
11: ; preds = %6
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
br label %78
13: ; preds = %6
%14 = tail call i64 (...) @fork()
%15 = icmp slt i64 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %13
%17 = load i32, i32* @stderr
%18 = tail call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %78
19: ; preds = %13
%20 = icmp eq i64 %14, 0
br i1 %20, label %21, label %51
21: ; preds = %19
%22 = load i32, i32* @O_CREAT
%23 = load i32, i32* @O_RDWR
%24 = or i32 %23, %22
%25 = tail call i32 @shm_open(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %24, i32 438)
%26 = tail call i32 @ftruncate(i32 %25, i32 4096)
%27 = load i32, i32* @PROT_WRITE
%28 = load i32, i32* @MAP_SHARED
%29 = tail call i8* @mmap(i32 0, i32 4096, i32 %27, i32 %28, i32 %25, i32 0)
%30 = icmp eq i32 %9, 1
br i1 %30, label %47, label %31
31: ; preds = %21
%32 = getelementptr i8, i8* %29, i64 4
%33 = bitcast i8* %32 to i32*
br label %34
34: ; preds = %31, %34
%35 = phi i32 [ %43, %34 ], [ %9, %31 ]
%36 = phi i32 [ %45, %34 ], [ 0, %31 ]
%37 = phi i32* [ %44, %34 ], [ %33, %31 ]
%38 = and i32 %35, 1
%39 = icmp eq i32 %38, 0
%40 = mul nsw i32 %35, 3
%41 = add nsw i32 %40, 1
%42 = ashr i32 %35, 1
%43 = select i1 %39, i32 %42, i32 %41
store i32 %43, i32* %37
%44 = getelementptr inbounds i32, i32* %37, i64 1
%45 = add nuw nsw i32 %36, 1
%46 = icmp eq i32 %43, 1
br i1 %46, label %47, label %34
47: ; preds = %34, %21
%48 = phi i32 [ 0, %21 ], [ %45, %34 ]
%49 = bitcast i8* %29 to i32*
store i32 %48, i32* %49
%50 = tail call i32 @exit(i32 0)
unreachable
51: ; preds = %19
%52 = tail call i32 @wait(i32* null)
%53 = load i32, i32* @O_RDONLY
%54 = tail call i32 @shm_open(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %53, i32 438)
%55 = load i32, i32* @PROT_READ
%56 = load i32, i32* @MAP_SHARED
%57 = tail call i8* @mmap(i32 0, i32 4096, i32 %55, i32 %56, i32 %54, i32 0)
%58 = bitcast i8* %57 to i32*
%59 = load i32, i32* %58
%60 = icmp eq i32 %59, 0
br i1 %60, label %74, label %61
61: ; preds = %51
%62 = icmp sgt i32 %59, 0
br i1 %62, label %63, label %76
63: ; preds = %61
%64 = getelementptr inbounds i8, i8* %57, i64 4
%65 = bitcast i8* %64 to i32*
br label %66
66: ; preds = %63, %66
%67 = phi i32 [ %72, %66 ], [ 0, %63 ]
%68 = phi i32* [ %71, %66 ], [ %65, %63 ]
%69 = load i32, i32* %68
%70 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %69)
%71 = getelementptr inbounds i32, i32* %68, i64 1
%72 = add nuw nsw i32 %67, 1
%73 = icmp eq i32 %72, %59
br i1 %73, label %76, label %66
74: ; preds = %51
%75 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 0)
br label %76
76: ; preds = %66, %61, %74
%77 = tail call i32 @shm_unlink(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %78
78: ; preds = %76, %16, %11, %4
%79 = phi i32 [ 0, %4 ], [ 0, %11 ], [ 1, %16 ], [ 0, %76 ]
ret i32 %79
}