#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 IPC_CREAT;
int /*<<< orphan*/ SETVAL;
int S_IRUSR;
int S_IWUSR;
scalar_t__ fork();
int ftok(char *, int);
int /*<<< orphan*/ func(int, int, int, int *);
int /*<<< orphan*/ myop(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ semctl(int, int /*<<< orphan*/, int /*<<< orphan*/,
                          int /*<<< orphan*/);
int semget(int, int, int);
int *shmat(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
int shmget(int, int, int);
int /*<<< orphan*/ waitpid(scalar_t__, int /*<<< orphan*/ *,
                           int /*<<< orphan*/);
int main() {
  int desk = ftok("jojo", 0);
  int semid_1 = semget(desk, 1, S_IRUSR | S_IWUSR | IPC_CREAT);
  semctl(semid_1, 0, SETVAL, 0);
  desk = ftok("jojo", 1);
  int semid_2 = semget(desk, 1, S_IRUSR | S_IWUSR | IPC_CREAT);
  semctl(semid_2, 0, SETVAL, 0);
  desk = shmget(desk, sizeof(int) * 1, 0666 | IPC_CREAT);
  int *sh = shmat(desk, NULL, 0);
  pid_t pid;
  int length;
  scanf("%d", &length);
  for (int j = 0; j < length; j++) {
    for (int i = 1; i <= 5; i++) {
      pid = fork();
      if (pid == 0) {
        func(i, semid_1, semid_2, sh);
        return 0;
      }
    }
    for (int i = 1; i <= 5; i++) {
      *sh = i;
      myop(semid_1, 5);
      myop(semid_2, -1);
      printf("  #%d#\n", i);
    }
    waitpid(pid, NULL, 0);
    printf("\n");
  }
  printf("\nЗАПУСКАЕМ\n░ГУСЯ░▄▀▀▀▄░РАБОТЯГИ░░\n▄███▀░◐░░░▌░░░░░░░\n░░░░▌░░░░░▐░"
         "░░░░░░\n░░░░▐░░░░░▐░░░░░░░\n░░░░▌░░░░░▐▄▄░░░░░\n░░░░▌░░░░▄▀▒▒▀▀▀▀▄\n░"
         "░░▐░░░░▐▒▒▒▒▒▒▒▒▀▀▄\n░░░▐░░░░▐▄▒▒▒▒▒▒▒▒▒▒▀▄\n░░░░▀▄░░░░▀▄▒▒▒▒▒▒▒▒▒▒▀▄"
         "\n░░░░░░▀▄▄▄▄▄█▄▄▄▄▄▄▄▄▄▄▄▀▄\n░░░░░░░░░░░▌▌░▌▌░░░░░\n░░░░░░░░░░░▌▌░▌▌"
         "░░░░░\n░░░░░░░░░▄▄▌▌▄▌▌░░░░░\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe3a(%rip),%rdi
xor    %esi,%esi
call   10c0 <ftok@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2dfe(%rip),%rax
mov    (%rax),%edx
mov    0x2e05(%rip),%rax
or     (%rax),%edx
mov    0x2de4(%rip),%rax
or     (%rax),%edx
mov    $0x1,%esi
call   1030 <semget@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    0x2dc3(%rip),%rax
mov    (%rax),%edx
xor    %ecx,%ecx
mov    %ecx,%esi
call   1090 <semctl@plt>
lea    0xde9(%rip),%rdi
mov    $0x1,%esi
call   10c0 <ftok@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2daa(%rip),%rax
mov    (%rax),%edx
mov    0x2db1(%rip),%rax
or     (%rax),%edx
mov    0x2d90(%rip),%rax
or     (%rax),%edx
mov    $0x1,%esi
call   1030 <semget@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    0x2d6f(%rip),%rax
mov    (%rax),%edx
xor    %ecx,%ecx
mov    %ecx,%esi
call   1090 <semctl@plt>
mov    -0x8(%rbp),%edi
mov    0x2d62(%rip),%rax
mov    (%rax),%edx
or     $0x1b6,%edx
mov    $0x4,%esi
call   10b0 <shmget@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   10a0 <shmat@plt>
mov    %rax,-0x18(%rbp)
lea    0xd69(%rip),%rdi
lea    -0x24(%rbp),%rsi
call   1060 <scanf@plt>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    138e <main+0x1de>
movl   $0x1,-0x2c(%rbp)
cmpl   $0x5,-0x2c(%rbp)
jg     1310 <main+0x160>
mov    $0x0,%al
call   10d0 <fork@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    12fd <main+0x14d>
mov    -0x2c(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1050 <func@plt>
movl   $0x0,-0x4(%rbp)
jmp    13a3 <main+0x1f3>
jmp    1302 <main+0x152>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    12bf <main+0x10f>
movl   $0x1,-0x30(%rbp)
cmpl   $0x5,-0x30(%rbp)
jg     1363 <main+0x1b3>
mov    -0x30(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%edi
mov    $0x5,%esi
call   1070 <myop@plt>
mov    -0x10(%rbp),%edi
mov    $0xffffffff,%esi
call   1070 <myop@plt>
mov    -0x30(%rbp),%esi
lea    0xcba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1317 <main+0x167>
mov    -0x20(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1080 <waitpid@plt>
lea    0xc95(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    12ac <main+0xfc>
lea    0xc7b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xe1e(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   10e0 <ftok@plt>
mov    0x2de5(%rip),%r13
mov    0x2dee(%rip),%r12
mov    (%r12),%edx
or     0x0(%r13),%edx
mov    0x2dc7(%rip),%rbp
or     0x0(%rbp),%edx
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <semget@plt>
mov    %eax,%r14d
mov    0x2da6(%rip),%r15
mov    (%r15),%edx
mov    %eax,%edi
xor    %esi,%esi
xor    %ecx,%ecx
call   10b0 <semctl@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   10e0 <ftok@plt>
mov    %eax,%ebx
mov    (%r12),%edx
or     0x0(%r13),%edx
or     0x0(%rbp),%edx
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <semget@plt>
mov    %eax,%r13d
mov    (%r15),%edx
mov    %eax,%edi
xor    %esi,%esi
xor    %ecx,%ecx
call   10b0 <semctl@plt>
mov    $0x1b6,%edx
or     0x0(%rbp),%edx
mov    %ebx,%edi
mov    $0x4,%esi
call   10d0 <shmget@plt>
mov    %eax,%edi
xor    %esi,%esi
xor    %edx,%edx
call   10c0 <shmat@plt>
mov    %rax,%rbx
lea    0xd75(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1080 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jle    1413 <main+0x243>
lea    0xd5c(%rip),%r12
xor    %r15d,%r15d
nop
xor    %eax,%eax
call   10f0 <fork@plt>
test   %rax,%rax
je     1421 <main+0x251>
xor    %eax,%eax
call   10f0 <fork@plt>
test   %rax,%rax
je     1428 <main+0x258>
xor    %eax,%eax
call   10f0 <fork@plt>
test   %rax,%rax
je     142f <main+0x25f>
xor    %eax,%eax
call   10f0 <fork@plt>
test   %rax,%rax
je     1436 <main+0x266>
xor    %eax,%eax
call   10f0 <fork@plt>
test   %rax,%rax
je     143d <main+0x26d>
mov    %rax,%rbp
movl   $0x1,(%rbx)
mov    %r14d,%edi
mov    $0x5,%esi
call   1090 <myop@plt>
mov    %r13d,%edi
mov    $0xffffffff,%esi
call   1090 <myop@plt>
mov    %r12,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1060 <printf@plt>
movl   $0x2,(%rbx)
mov    %r14d,%edi
mov    $0x5,%esi
call   1090 <myop@plt>
mov    %r13d,%edi
mov    $0xffffffff,%esi
call   1090 <myop@plt>
mov    %r12,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1060 <printf@plt>
movl   $0x3,(%rbx)
mov    %r14d,%edi
mov    $0x5,%esi
call   1090 <myop@plt>
mov    %r13d,%edi
mov    $0xffffffff,%esi
call   1090 <myop@plt>
mov    %r12,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1060 <printf@plt>
movl   $0x4,(%rbx)
mov    %r14d,%edi
mov    $0x5,%esi
call   1090 <myop@plt>
mov    %r13d,%edi
mov    $0xffffffff,%esi
call   1090 <myop@plt>
mov    %r12,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1060 <printf@plt>
movl   $0x5,(%rbx)
mov    %r14d,%edi
mov    $0x5,%esi
call   1090 <myop@plt>
mov    %r13d,%edi
mov    $0xffffffff,%esi
call   1090 <myop@plt>
mov    %r12,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbp,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   10a0 <waitpid@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
add    $0x1,%r15d
cmp    0x4(%rsp),%r15d
jl     12b0 <main+0xe0>
lea    0xbf6(%rip),%rdi
call   1050 <puts@plt>
jmp    1450 <main+0x280>
mov    $0x1,%edi
jmp    1442 <main+0x272>
mov    $0x2,%edi
jmp    1442 <main+0x272>
mov    $0x3,%edi
jmp    1442 <main+0x272>
mov    $0x4,%edi
jmp    1442 <main+0x272>
mov    $0x5,%edi
mov    %r14d,%esi
mov    %r13d,%edx
mov    %rbx,%rcx
call   1070 <func@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"jojo\00"
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@IPC_CREAT = global i32 0
@SETVAL = global i32 0
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [8 x i8] c" #%d#\0A\00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [823 x i8] c"\0A\D0\97\D0\90\D0\9F\D0\A3\D0\A1\D0\9A\D0\90\D0\95\D0\9C\0A\E2\96\91\D0\93\D0\A3\D0\A1\D0\AF\E2\96\91\E2\96\84\E2\96\80\E2\96\80\E2\96\80\E2\96\84\E2\96\91\D0\A0\D0\90\D0\91\D0\9E\D0\A2\D0\AF\D0\93\D0\98\E2\96\91\E2\96\91\0A\E2\96\84\E2\96\88\E2\96\88\E2\96\88\E2\96\80\E2\96\91\E2\97\90\E2\96\91\E2\96\91\E2\96\91\E2\96\8C\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\0A\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\8C\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\90\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\0A\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\90\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\90\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\0A\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\8C\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\90\E2\96\84\E2\96\84\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\0A\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\8C\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\84\E2\96\80\E2\96\92\E2\96\92\E2\96\80\E2\96\80\E2\96\80\E2\96\80\E2\96\84\0A\E2\96\91\E2\96\91\E2\96\91\E2\96\90\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\90\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\80\E2\96\80\E2\96\84\0A\E2\96\91\E2\96\91\E2\96\91\E2\96\90\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\90\E2\96\84\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\80\E2\96\84\0A\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\80\E2\96\84\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\80\E2\96\84\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\80\E2\96\84\0A\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\80\E2\96\84\E2\96\84\E2\96\84\E2\96\84\E2\96\84\E2\96\88\E2\96\84\E2\96\84\E2\96\84\E2\96\84\E2\96\84\E2\96\84\E2\96\84\E2\96\84\E2\96\84\E2\96\84\E2\96\84\E2\96\80\E2\96\84\0A\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\8C\E2\96\8C\E2\96\91\E2\96\8C\E2\96\8C\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\0A\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\8C\E2\96\8C\E2\96\91\E2\96\8C\E2\96\8C\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\0A\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\84\E2\96\84\E2\96\8C\E2\96\8C\E2\96\84\E2\96\8C\E2\96\8C\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %1
%11 = call i32 @ftok(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 0)
store i32 %11, i32* %2
%12 = load i32, i32* %2
%13 = load i32, i32* @S_IRUSR
%14 = load i32, i32* @S_IWUSR
%15 = or i32 %13, %14
%16 = load i32, i32* @IPC_CREAT
%17 = or i32 %15, %16
%18 = call i32 @semget(i32 %12, i32 1, i32 %17)
store i32 %18, i32* %3
%19 = load i32, i32* %3
%20 = load i32, i32* @SETVAL
%21 = call i32 @semctl(i32 %19, i32 0, i32 %20, i32 0)
%22 = call i32 @ftok(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 1)
store i32 %22, i32* %2
%23 = load i32, i32* %2
%24 = load i32, i32* @S_IRUSR
%25 = load i32, i32* @S_IWUSR
%26 = or i32 %24, %25
%27 = load i32, i32* @IPC_CREAT
%28 = or i32 %26, %27
%29 = call i32 @semget(i32 %23, i32 1, i32 %28)
store i32 %29, i32* %4
%30 = load i32, i32* %4
%31 = load i32, i32* @SETVAL
%32 = call i32 @semctl(i32 %30, i32 0, i32 %31, i32 0)
%33 = load i32, i32* %2
%34 = load i32, i32* @IPC_CREAT
%35 = or i32 438, %34
%36 = call i32 @shmget(i32 %33, i32 4, i32 %35)
store i32 %36, i32* %2
%37 = load i32, i32* %2
%38 = call i32* @shmat(i32 %37, i32* null, i32 0)
store i32* %38, i32** %5
%39 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
store i32 0, i32* %8
br label %40
40: ; preds = %82, %0
%41 = load i32, i32* %8
%42 = load i32, i32* %7
%43 = icmp slt i32 %41, %42
br i1 %43, label %44, label %85
44: ; preds = %40
store i32 1, i32* %9
br label %45
45: ; preds = %59, %44
%46 = load i32, i32* %9
%47 = icmp sle i32 %46, 5
br i1 %47, label %48, label %62
48: ; preds = %45
%49 = call i64 (...) @fork()
store i64 %49, i64* %6
%50 = load i64, i64* %6
%51 = icmp eq i64 %50, 0
br i1 %51, label %52, label %58
52: ; preds = %48
%53 = load i32, i32* %9
%54 = load i32, i32* %3
%55 = load i32, i32* %4
%56 = load i32*, i32** %5
%57 = call i32 @func(i32 %53, i32 %54, i32 %55, i32* %56)
store i32 0, i32* %1
br label %87
58: ; preds = %48
br label %59
59: ; preds = %58
%60 = load i32, i32* %9
%61 = add nsw i32 %60, 1
store i32 %61, i32* %9
br label %45
62: ; preds = %45
store i32 1, i32* %10
br label %63
63: ; preds = %75, %62
%64 = load i32, i32* %10
%65 = icmp sle i32 %64, 5
br i1 %65, label %66, label %78
66: ; preds = %63
%67 = load i32, i32* %10
%68 = load i32*, i32** %5
store i32 %67, i32* %68
%69 = load i32, i32* %3
%70 = call i32 @myop(i32 %69, i32 5)
%71 = load i32, i32* %4
%72 = call i32 @myop(i32 %71, i32 -1)
%73 = load i32, i32* %10
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %73)
br label %75
75: ; preds = %66
%76 = load i32, i32* %10
%77 = add nsw i32 %76, 1
store i32 %77, i32* %10
br label %63
78: ; preds = %63
%79 = load i64, i64* %6
%80 = call i32 @waitpid(i64 %79, i32* null, i32 0)
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %82
82: ; preds = %78
%83 = load i32, i32* %8
%84 = add nsw i32 %83, 1
store i32 %84, i32* %8
br label %40
85: ; preds = %40
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([823 x i8], [823 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %1
br label %87
87: ; preds = %85, %52
%88 = load i32, i32* %1
ret i32 %88
}

LLVM IR (-O2):
@.str = [5 x i8] c"jojo\00"
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@IPC_CREAT = global i32 0
@SETVAL = global i32 0
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [8 x i8] c" #%d#\0A\00"
@str = [822 x i8] c"\0A\D0\97\D0\90\D0\9F\D0\A3\D0\A1\D0\9A\D0\90\D0\95\D0\9C\0A\E2\96\91\D0\93\D0\A3\D0\A1\D0\AF\E2\96\91\E2\96\84\E2\96\80\E2\96\80\E2\96\80\E2\96\84\E2\96\91\D0\A0\D0\90\D0\91\D0\9E\D0\A2\D0\AF\D0\93\D0\98\E2\96\91\E2\96\91\0A\E2\96\84\E2\96\88\E2\96\88\E2\96\88\E2\96\80\E2\96\91\E2\97\90\E2\96\91\E2\96\91\E2\96\91\E2\96\8C\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\0A\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\8C\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\90\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\0A\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\90\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\90\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\0A\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\8C\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\90\E2\96\84\E2\96\84\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\0A\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\8C\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\84\E2\96\80\E2\96\92\E2\96\92\E2\96\80\E2\96\80\E2\96\80\E2\96\80\E2\96\84\0A\E2\96\91\E2\96\91\E2\96\91\E2\96\90\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\90\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\80\E2\96\80\E2\96\84\0A\E2\96\91\E2\96\91\E2\96\91\E2\96\90\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\90\E2\96\84\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\80\E2\96\84\0A\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\80\E2\96\84\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\80\E2\96\84\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\92\E2\96\80\E2\96\84\0A\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\80\E2\96\84\E2\96\84\E2\96\84\E2\96\84\E2\96\84\E2\96\88\E2\96\84\E2\96\84\E2\96\84\E2\96\84\E2\96\84\E2\96\84\E2\96\84\E2\96\84\E2\96\84\E2\96\84\E2\96\84\E2\96\80\E2\96\84\0A\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\8C\E2\96\8C\E2\96\91\E2\96\8C\E2\96\8C\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\0A\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\8C\E2\96\8C\E2\96\91\E2\96\8C\E2\96\8C\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\0A\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\84\E2\96\84\E2\96\8C\E2\96\8C\E2\96\84\E2\96\8C\E2\96\8C\E2\96\91\E2\96\91\E2\96\91\E2\96\91\E2\96\91\00"
define i32 @main() {
%1 = alloca i32
%2 = tail call i32 @ftok(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 0)
%3 = load i32, i32* @S_IRUSR
%4 = load i32, i32* @S_IWUSR
%5 = or i32 %4, %3
%6 = load i32, i32* @IPC_CREAT
%7 = or i32 %5, %6
%8 = tail call i32 @semget(i32 %2, i32 1, i32 %7)
%9 = load i32, i32* @SETVAL
%10 = tail call i32 @semctl(i32 %8, i32 0, i32 %9, i32 0)
%11 = tail call i32 @ftok(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 1)
%12 = load i32, i32* @S_IRUSR
%13 = load i32, i32* @S_IWUSR
%14 = or i32 %13, %12
%15 = load i32, i32* @IPC_CREAT
%16 = or i32 %14, %15
%17 = tail call i32 @semget(i32 %11, i32 1, i32 %16)
%18 = load i32, i32* @SETVAL
%19 = tail call i32 @semctl(i32 %17, i32 0, i32 %18, i32 0)
%20 = load i32, i32* @IPC_CREAT
%21 = or i32 %20, 438
%22 = tail call i32 @shmget(i32 %11, i32 4, i32 %21)
%23 = tail call i32* @shmat(i32 %22, i32* null, i32 0)
%24 = bitcast i32* %1 to i8*
%25 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%26 = load i32, i32* %1
%27 = icmp sgt i32 %26, 0
br i1 %27, label %28, label %68
28: ; preds = %0, %44
%29 = phi i32 [ %62, %44 ], [ 0, %0 ]
%30 = call i64 (...) @fork()
%31 = icmp eq i64 %30, 0
br i1 %31, label %65, label %32
32: ; preds = %28
%33 = call i64 (...) @fork()
%34 = icmp eq i64 %33, 0
br i1 %34, label %65, label %35
35: ; preds = %32
%36 = call i64 (...) @fork()
%37 = icmp eq i64 %36, 0
br i1 %37, label %65, label %38
38: ; preds = %35
%39 = call i64 (...) @fork()
%40 = icmp eq i64 %39, 0
br i1 %40, label %65, label %41
41: ; preds = %38
%42 = call i64 (...) @fork()
%43 = icmp eq i64 %42, 0
br i1 %43, label %65, label %44
44: ; preds = %41
store i32 1, i32* %23
%45 = call i32 @myop(i32 %8, i32 5)
%46 = call i32 @myop(i32 %17, i32 -1)
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 1)
store i32 2, i32* %23
%48 = call i32 @myop(i32 %8, i32 5)
%49 = call i32 @myop(i32 %17, i32 -1)
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 2)
store i32 3, i32* %23
%51 = call i32 @myop(i32 %8, i32 5)
%52 = call i32 @myop(i32 %17, i32 -1)
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 3)
store i32 4, i32* %23
%54 = call i32 @myop(i32 %8, i32 5)
%55 = call i32 @myop(i32 %17, i32 -1)
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 4)
store i32 5, i32* %23
%57 = call i32 @myop(i32 %8, i32 5)
%58 = call i32 @myop(i32 %17, i32 -1)
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 5)
%60 = call i32 @waitpid(i64 %42, i32* null, i32 0)
%61 = call i32 @putchar(i32 10)
%62 = add nuw nsw i32 %29, 1
%63 = load i32, i32* %1
%64 = icmp slt i32 %62, %63
br i1 %64, label %28, label %68
65: ; preds = %41, %38, %35, %32, %28
%66 = phi i32 [ 1, %28 ], [ 2, %32 ], [ 3, %35 ], [ 4, %38 ], [ 5, %41 ]
%67 = call i32 @func(i32 %66, i32 %8, i32 %17, i32* %23)
br label %70
68: ; preds = %44, %0
%69 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([822 x i8], [822 x i8]* @str, i64 0, i64 0))
br label %70
70: ; preds = %65, %68
ret i32 0
}