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

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ NOTIFY(int /*<<< orphan*/);
int /*<<< orphan*/ NOTIFY_INIT();
int O_CREAT;
int O_RDWR;
int O_TRUNC;
int S_IRGRP;
int S_IROTH;
int S_IRUSR;
int S_IWUSR;
int /*<<< orphan*/ WAIT_NOTIFY();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fork();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
scalar_t__ getpid();
int /*<<< orphan*/ getppid();
int open(char *, int, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ read_lock(int);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stderr;
scalar_t__ write_lock(int);
int main(int argc, char *argv[]) {
  if (argc < 2) {
    fprintf(stderr, "Usage: %s filename\n", argv[0]);
    exit(EXIT_FAILURE);
  }
  int fd;
  if ((fd = open(argv[1], O_RDWR | O_CREAT | O_TRUNC,
                 (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH))) < 0) {
    perror("open(2) failed");
    exit(EXIT_FAILURE);
  }
  if (read_lock(fd) < 0) {
    perror("Couldn't lock file for reading");
    exit(EXIT_FAILURE);
  }
  pid_t pid;
  if ((pid = fork()) < 0) {
    perror("fork(2) failed");
    exit(EXIT_FAILURE);
  }
  if (pid == 0) {
    printf("Writer started; attempting to acquire write lock\n");
    if (write_lock(fd) < 0) {
      perror("Error while attempting to acquire write lock");
      exit(EXIT_FAILURE);
    }
    printf("Acquired write lock\n");
    exit(EXIT_SUCCESS);
  }
  NOTIFY_INIT();
  int i;
  for (i = 0; i < 30; i++) {
    if ((pid = fork()) < 0) {
      perror("fork(2) failed");
      exit(EXIT_FAILURE);
    }
    if (pid == 0) {
      if (read_lock(fd) < 0) {
        perror("Couldn't lock file for reading");
        exit(EXIT_FAILURE);
      }
      NOTIFY(getppid());
      printf("Reader %ld acquired read lock\n", (long)getpid());
      sleep(1);
      printf("Reader %ld releasing read lock\n", (long)getpid());
    } else {
      WAIT_NOTIFY();
      exit(EXIT_SUCCESS);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    122a <main+0x4a>
mov    0x2db9(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xde9(%rip),%rsi
call   1070 <fprintf@plt>
mov    0x2d85(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2d9f(%rip),%rax
mov    (%rax),%esi
mov    0x2db6(%rip),%rax
or     (%rax),%esi
mov    0x2da5(%rip),%rax
or     (%rax),%esi
mov    0x2d4c(%rip),%rax
mov    (%rax),%edx
mov    0x2d73(%rip),%rax
or     (%rax),%edx
mov    0x2d52(%rip),%rax
or     (%rax),%edx
mov    0x2d41(%rip),%rax
or     (%rax),%edx
call   1090 <open@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    129c <main+0xbc>
lea    0xd8b(%rip),%rdi
call   10a0 <perror@plt>
mov    0x2d13(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
mov    -0x14(%rbp),%edi
call   1080 <read_lock@plt>
cmp    $0x0,%rax
jge    12c8 <main+0xe8>
lea    0xd6e(%rip),%rdi
call   10a0 <perror@plt>
mov    0x2ce7(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
mov    $0x0,%al
call   10f0 <fork@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jge    12f7 <main+0x117>
lea    0xd5e(%rip),%rdi
call   10a0 <perror@plt>
mov    0x2cb8(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
cmpq   $0x0,-0x20(%rbp)
jne    1358 <main+0x178>
lea    0xd48(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
call   1060 <write_lock@plt>
cmp    $0x0,%rax
jge    133c <main+0x15c>
lea    0xd5a(%rip),%rdi
call   10a0 <perror@plt>
mov    0x2c73(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
lea    0xd6d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2c47(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
mov    $0x0,%al
call   10d0 <NOTIFY_INIT@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0x1e,-0x24(%rbp)
jge    144b <main+0x26b>
mov    $0x0,%al
call   10f0 <fork@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jge    139f <main+0x1bf>
lea    0xcb6(%rip),%rdi
call   10a0 <perror@plt>
mov    0x2c10(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
cmpq   $0x0,-0x20(%rbp)
jne    1423 <main+0x243>
mov    -0x14(%rbp),%edi
call   1080 <read_lock@plt>
cmp    $0x0,%rax
jge    13d6 <main+0x1f6>
lea    0xc60(%rip),%rdi
call   10a0 <perror@plt>
mov    0x2bd9(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
mov    $0x0,%al
call   10b0 <getppid@plt>
mov    %eax,%edi
call   1030 <NOTIFY@plt>
mov    $0x0,%al
call   1040 <getpid@plt>
mov    %rax,%rsi
lea    0xcd0(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x1,%edi
call   10e0 <sleep@plt>
mov    $0x0,%al
call   1040 <getpid@plt>
mov    %rax,%rsi
lea    0xccd(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1438 <main+0x258>
mov    $0x0,%al
call   1100 <WAIT_NOTIFY@plt>
mov    0x2b67(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
jmp    143d <main+0x25d>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1366 <main+0x186>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    $0x1,%edi
jle    1348 <main+0x158>
mov    0x2dd1(%rip),%rcx
mov    0x2dea(%rip),%rax
mov    (%rax),%eax
or     (%rcx),%eax
mov    0x2dd7(%rip),%rcx
or     (%rcx),%eax
mov    0x2d7e(%rip),%rcx
mov    0x2da7(%rip),%rdx
mov    (%rdx),%edx
or     (%rcx),%edx
mov    0x2d84(%rip),%rcx
or     (%rcx),%edx
mov    0x8(%rsi),%rdi
mov    0x2d6f(%rip),%rcx
or     (%rcx),%edx
mov    %eax,%esi
call   10a0 <open@plt>
test   %eax,%eax
js     1362 <main+0x172>
mov    %eax,%ebx
mov    %eax,%edi
call   1090 <read_lock@plt>
test   %rax,%rax
js     1319 <main+0x129>
xor    %eax,%eax
call   1100 <fork@plt>
test   %rax,%rax
js     1310 <main+0x120>
je     136b <main+0x17b>
xor    %eax,%eax
call   10e0 <NOTIFY_INIT@plt>
mov    $0x1e,%ebp
lea    0xdf1(%rip),%r14
lea    0xe09(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1100 <fork@plt>
test   %rax,%rax
js     1310 <main+0x120>
jne    1333 <main+0x143>
mov    %ebx,%edi
call   1090 <read_lock@plt>
test   %rax,%rax
js     1319 <main+0x129>
xor    %eax,%eax
call   10c0 <getppid@plt>
mov    %eax,%edi
call   1030 <NOTIFY@plt>
xor    %eax,%eax
call   1050 <getpid@plt>
mov    %r14,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x1,%edi
call   10f0 <sleep@plt>
xor    %eax,%eax
call   1050 <getpid@plt>
mov    %r15,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
add    $0xffffffff,%ebp
jne    12a0 <main+0xb0>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xd2b(%rip),%rdi
jmp    1320 <main+0x130>
lea    0xd03(%rip),%rdi
call   10b0 <perror@plt>
mov    0x2c7c(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
xor    %eax,%eax
call   1110 <WAIT_NOTIFY@plt>
mov    0x2c57(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
mov    0x2c71(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xca5(%rip),%rsi
call   1080 <fprintf@plt>
jmp    1325 <main+0x135>
lea    0xcab(%rip),%rdi
jmp    1320 <main+0x130>
lea    0xd4b(%rip),%rdi
call   1040 <puts@plt>
mov    %ebx,%edi
call   1070 <write_lock@plt>
test   %rax,%rax
jns    138c <main+0x19c>
lea    0xcc7(%rip),%rdi
jmp    1320 <main+0x130>
lea    0xd5b(%rip),%rdi
call   1040 <puts@plt>
jmp    133a <main+0x14a>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"Usage: %s filename\0A\00"
@EXIT_FAILURE = global i32 0
@O_RDWR = global i32 0
@O_CREAT = global i32 0
@O_TRUNC = global i32 0
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@S_IRGRP = global i32 0
@S_IROTH = global i32 0
@.str.1 = [15 x i8] c"open(2) failed\00"
@.str.2 = [31 x i8] c"Couldn't lock file for reading\00"
@.str.3 = [15 x i8] c"fork(2) failed\00"
@.str.4 = [50 x i8] c"Writer started; attempting to acquire write lock\0A\00"
@.str.5 = [45 x i8] c"Error while attempting to acquire write lock\00"
@.str.6 = [21 x i8] c"Acquired write lock\0A\00"
@EXIT_SUCCESS = global i32 0
@.str.7 = [31 x i8] c"Reader %ld acquired read lock\0A\00"
@.str.8 = [32 x i8] c"Reader %ld releasing read lock\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i64
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 2
br i1 %10, label %11, label %19
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 0
%15 = load i8*, i8** %14
%16 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = load i32, i32* @EXIT_FAILURE
%18 = call i32 @exit(i32 %17)
unreachable
19: ; preds = %2
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = load i32, i32* @O_RDWR
%24 = load i32, i32* @O_CREAT
%25 = or i32 %23, %24
%26 = load i32, i32* @O_TRUNC
%27 = or i32 %25, %26
%28 = load i32, i32* @S_IRUSR
%29 = load i32, i32* @S_IWUSR
%30 = or i32 %28, %29
%31 = load i32, i32* @S_IRGRP
%32 = or i32 %30, %31
%33 = load i32, i32* @S_IROTH
%34 = or i32 %32, %33
%35 = call i32 @open(i8* %22, i32 %27, i32 %34)
store i32 %35, i32* %6
%36 = icmp slt i32 %35, 0
br i1 %36, label %37, label %41
37: ; preds = %19
%38 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%39 = load i32, i32* @EXIT_FAILURE
%40 = call i32 @exit(i32 %39)
unreachable
41: ; preds = %19
%42 = load i32, i32* %6
%43 = call i64 @read_lock(i32 %42)
%44 = icmp slt i64 %43, 0
br i1 %44, label %45, label %49
45: ; preds = %41
%46 = call i32 @perror(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%47 = load i32, i32* @EXIT_FAILURE
%48 = call i32 @exit(i32 %47)
unreachable
49: ; preds = %41
%50 = call i64 (...) @fork()
store i64 %50, i64* %7
%51 = icmp slt i64 %50, 0
br i1 %51, label %52, label %56
52: ; preds = %49
%53 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%54 = load i32, i32* @EXIT_FAILURE
%55 = call i32 @exit(i32 %54)
unreachable
56: ; preds = %49
%57 = load i64, i64* %7
%58 = icmp eq i64 %57, 0
br i1 %58, label %59, label %72
59: ; preds = %56
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.4, i64 0, i64 0))
%61 = load i32, i32* %6
%62 = call i64 @write_lock(i32 %61)
%63 = icmp slt i64 %62, 0
br i1 %63, label %64, label %68
64: ; preds = %59
%65 = call i32 @perror(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.5, i64 0, i64 0))
%66 = load i32, i32* @EXIT_FAILURE
%67 = call i32 @exit(i32 %66)
unreachable
68: ; preds = %59
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0))
%70 = load i32, i32* @EXIT_SUCCESS
%71 = call i32 @exit(i32 %70)
unreachable
72: ; preds = %56
%73 = call i32 (...) @NOTIFY_INIT()
store i32 0, i32* %8
br label %74
74: ; preds = %108, %72
%75 = load i32, i32* %8
%76 = icmp slt i32 %75, 30
br i1 %76, label %77, label %111
77: ; preds = %74
%78 = call i64 (...) @fork()
store i64 %78, i64* %7
%79 = icmp slt i64 %78, 0
br i1 %79, label %80, label %84
80: ; preds = %77
%81 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%82 = load i32, i32* @EXIT_FAILURE
%83 = call i32 @exit(i32 %82)
unreachable
84: ; preds = %77
%85 = load i64, i64* %7
%86 = icmp eq i64 %85, 0
br i1 %86, label %87, label %103
87: ; preds = %84
%88 = load i32, i32* %6
%89 = call i64 @read_lock(i32 %88)
%90 = icmp slt i64 %89, 0
br i1 %90, label %91, label %95
91: ; preds = %87
%92 = call i32 @perror(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%93 = load i32, i32* @EXIT_FAILURE
%94 = call i32 @exit(i32 %93)
unreachable
95: ; preds = %87
%96 = call i32 (...) @getppid()
%97 = call i32 @NOTIFY(i32 %96)
%98 = call i64 (...) @getpid()
%99 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0), i64 %98)
%100 = call i32 @sleep(i32 1)
%101 = call i64 (...) @getpid()
%102 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i64 0, i64 0), i64 %101)
br label %107
103: ; preds = %84
%104 = call i32 (...) @WAIT_NOTIFY()
%105 = load i32, i32* @EXIT_SUCCESS
%106 = call i32 @exit(i32 %105)
unreachable
107: ; preds = %95
br label %108
108: ; preds = %107
%109 = load i32, i32* %8
%110 = add nsw i32 %109, 1
store i32 %110, i32* %8
br label %74
111: ; preds = %74
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"Usage: %s filename\0A\00"
@EXIT_FAILURE = global i32 0
@O_RDWR = global i32 0
@O_CREAT = global i32 0
@O_TRUNC = global i32 0
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@S_IRGRP = global i32 0
@S_IROTH = global i32 0
@.str.1 = [15 x i8] c"open(2) failed\00"
@.str.2 = [31 x i8] c"Couldn't lock file for reading\00"
@.str.3 = [15 x i8] c"fork(2) failed\00"
@.str.5 = [45 x i8] c"Error while attempting to acquire write lock\00"
@EXIT_SUCCESS = global i32 0
@.str.7 = [31 x i8] c"Reader %ld acquired read lock\0A\00"
@.str.8 = [32 x i8] c"Reader %ld releasing read lock\0A\00"
@str = [49 x i8] c"Writer started; attempting to acquire write lock\00"
@str.9 = [20 x i8] c"Acquired write lock\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %1
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = load i32, i32* @O_RDWR
%14 = load i32, i32* @O_CREAT
%15 = or i32 %14, %13
%16 = load i32, i32* @O_TRUNC
%17 = or i32 %15, %16
%18 = load i32, i32* @S_IRUSR
%19 = load i32, i32* @S_IWUSR
%20 = or i32 %19, %18
%21 = load i32, i32* @S_IRGRP
%22 = or i32 %20, %21
%23 = load i32, i32* @S_IROTH
%24 = or i32 %22, %23
%25 = tail call i32 @open(i8* %12, i32 %17, i32 %24)
%26 = icmp slt i32 %25, 0
br i1 %26, label %27, label %31
27: ; preds = %10
%28 = tail call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%29 = load i32, i32* @EXIT_FAILURE
%30 = tail call i32 @exit(i32 %29)
unreachable
31: ; preds = %10
%32 = tail call i64 @read_lock(i32 %25)
%33 = icmp slt i64 %32, 0
br i1 %33, label %34, label %38
34: ; preds = %31
%35 = tail call i32 @perror(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%36 = load i32, i32* @EXIT_FAILURE
%37 = tail call i32 @exit(i32 %36)
unreachable
38: ; preds = %31
%39 = tail call i64 (...) @fork()
%40 = icmp slt i64 %39, 0
br i1 %40, label %41, label %45
41: ; preds = %38
%42 = tail call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%43 = load i32, i32* @EXIT_FAILURE
%44 = tail call i32 @exit(i32 %43)
unreachable
45: ; preds = %38
%46 = icmp eq i64 %39, 0
br i1 %46, label %47, label %59
47: ; preds = %45
%48 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str, i64 0, i64 0))
%49 = tail call i64 @write_lock(i32 %25)
%50 = icmp slt i64 %49, 0
br i1 %50, label %51, label %55
51: ; preds = %47
%52 = tail call i32 @perror(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.5, i64 0, i64 0))
%53 = load i32, i32* @EXIT_FAILURE
%54 = tail call i32 @exit(i32 %53)
unreachable
55: ; preds = %47
%56 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.9, i64 0, i64 0))
%57 = load i32, i32* @EXIT_SUCCESS
%58 = tail call i32 @exit(i32 %57)
unreachable
59: ; preds = %45
%60 = tail call i32 (...) @NOTIFY_INIT()
br label %61
61: ; preds = %59, %78
%62 = phi i32 [ 0, %59 ], [ %86, %78 ]
%63 = tail call i64 (...) @fork()
%64 = icmp slt i64 %63, 0
br i1 %64, label %65, label %69
65: ; preds = %61
%66 = tail call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%67 = load i32, i32* @EXIT_FAILURE
%68 = tail call i32 @exit(i32 %67)
unreachable
69: ; preds = %61
%70 = icmp eq i64 %63, 0
br i1 %70, label %71, label %88
71: ; preds = %69
%72 = tail call i64 @read_lock(i32 %25)
%73 = icmp slt i64 %72, 0
br i1 %73, label %74, label %78
74: ; preds = %71
%75 = tail call i32 @perror(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%76 = load i32, i32* @EXIT_FAILURE
%77 = tail call i32 @exit(i32 %76)
unreachable
78: ; preds = %71
%79 = tail call i32 (...) @getppid()
%80 = tail call i32 @NOTIFY(i32 %79)
%81 = tail call i64 (...) @getpid()
%82 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0), i64 %81)
%83 = tail call i32 @sleep(i32 1)
%84 = tail call i64 (...) @getpid()
%85 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i64 0, i64 0), i64 %84)
%86 = add nuw nsw i32 %62, 1
%87 = icmp eq i32 %86, 30
br i1 %87, label %92, label %61
88: ; preds = %69
%89 = tail call i32 (...) @WAIT_NOTIFY()
%90 = load i32, i32* @EXIT_SUCCESS
%91 = tail call i32 @exit(i32 %90)
unreachable
92: ; preds = %78
ret i32 0
}