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

/* Variables and functions */
int /*<<< orphan*/ SIGKILL;
int WIFEXITED(int);
int /*<<< orphan*/ execl(char *, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int fork();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ kill(int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ waitpid(int, int *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int i, pid[6], z, status;
  printf("Установите количество золота в руднике\n");
  scanf("%d", &z);
  printf("Установленное количество золота в руднике %d\n", z);
  FILE *batrak;
  batrak = fopen("/home/arthur/labs/Eltexlabs/CLabs/gold.txt", "w");
  fprintf(batrak, "%d", z);
  fclose(batrak);
  for (i = 0; i < 6; i++) {
    pid[i] = fork();
    if (pid[i] == 0) {
      execl("/home/arthur/labs/Eltexlabs/CLabs/doch", "", NULL);
    }
    sleep(3);
  }
  sleep(3);
  for (i = 0; i < 6; i++) {
    waitpid(pid[i], &status, 0);
    printf("Раб под номером: %d завершил работу,  Результат=%d\n", pid[i],
           WIFEXITED(status));
    if (WIFEXITED(status) == 1) {
      for (i = 0; i < 6; i++) {
        kill(pid[i], SIGKILL);
        printf("Процесс %d пренудительно завершен\n", pid[i]);
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe33(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe6f(%rip),%rdi
lea    -0x34(%rbp),%rsi
call   1070 <scanf@plt>
mov    -0x34(%rbp),%esi
lea    0xe5f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xea4(%rip),%rdi
lea    0xec8(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x34(%rbp),%edx
lea    0xe30(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x40(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x6,-0x14(%rbp)
jge    1288 <main+0xd8>
mov    $0x0,%al
call   10d0 <fork@plt>
mov    %eax,%ecx
movslq -0x14(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
movslq -0x14(%rbp),%rax
cmpl   $0x0,-0x30(%rbp,%rax,4)
jne    1270 <main+0xc0>
lea    0xe6d(%rip),%rdi
lea    0xe38(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   10b0 <execl@plt>
mov    $0x3,%edi
call   10c0 <sleep@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    122f <main+0x7f>
mov    $0x3,%edi
call   10c0 <sleep@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x6,-0x14(%rbp)
jge    1350 <main+0x1a0>
movslq -0x14(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%edi
lea    -0x38(%rbp),%rsi
xor    %edx,%edx
call   1080 <waitpid@plt>
movslq -0x14(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
mov    %eax,-0x44(%rbp)
mov    -0x38(%rbp),%edi
call   10a0 <WIFEXITED@plt>
mov    -0x44(%rbp),%esi
mov    %eax,%edx
lea    0xe1f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x38(%rbp),%edi
call   10a0 <WIFEXITED@plt>
cmp    $0x1,%eax
jne    133d <main+0x18d>
movl   $0x0,-0x14(%rbp)
cmpl   $0x6,-0x14(%rbp)
jge    1338 <main+0x188>
movslq -0x14(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%edi
mov    0x2cd3(%rip),%rax
mov    (%rax),%esi
call   1060 <kill@plt>
movslq -0x14(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
lea    0xe29(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    12f4 <main+0x144>
jmp    133d <main+0x18d>
jmp    1342 <main+0x192>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1299 <main+0xe9>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0xf6c(%rip),%rdi
call   1030 <puts@plt>
lea    0xe1f(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1080 <scanf@plt>
mov    0x8(%rsp),%esi
lea    0xe0a(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe4f(%rip),%rdi
lea    0xe73(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,%rbp
mov    0x8(%rsp),%edx
mov    %rax,%rdi
mov    %rbx,%rsi
call   1060 <fprintf@plt>
mov    %rbp,%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
call   10e0 <fork@plt>
mov    %eax,%ebx
mov    %eax,0x10(%rsp)
test   %eax,%eax
jne    1253 <main+0x93>
lea    0xe3e(%rip),%rdi
lea    0xe09(%rip),%rsi
xor    %edx,%edx
call   10c0 <execl@plt>
mov    $0x3,%edi
call   10d0 <sleep@plt>
xor    %eax,%eax
call   10e0 <fork@plt>
mov    %eax,%r14d
mov    %eax,0x14(%rsp)
test   %eax,%eax
jne    1284 <main+0xc4>
lea    0xe0d(%rip),%rdi
lea    0xdd8(%rip),%rsi
xor    %edx,%edx
call   10c0 <execl@plt>
mov    $0x3,%edi
call   10d0 <sleep@plt>
xor    %eax,%eax
call   10e0 <fork@plt>
mov    %eax,%r12d
mov    %eax,0x18(%rsp)
test   %eax,%eax
jne    12b5 <main+0xf5>
lea    0xddc(%rip),%rdi
lea    0xda7(%rip),%rsi
xor    %edx,%edx
call   10c0 <execl@plt>
mov    $0x3,%edi
call   10d0 <sleep@plt>
xor    %eax,%eax
call   10e0 <fork@plt>
mov    %eax,%r13d
mov    %eax,0x1c(%rsp)
test   %eax,%eax
jne    12e6 <main+0x126>
lea    0xdab(%rip),%rdi
lea    0xd76(%rip),%rsi
xor    %edx,%edx
call   10c0 <execl@plt>
mov    $0x3,%edi
call   10d0 <sleep@plt>
xor    %eax,%eax
call   10e0 <fork@plt>
mov    %eax,%r15d
mov    %eax,0x20(%rsp)
test   %eax,%eax
jne    1317 <main+0x157>
lea    0xd7a(%rip),%rdi
lea    0xd45(%rip),%rsi
xor    %edx,%edx
call   10c0 <execl@plt>
mov    $0x3,%edi
call   10d0 <sleep@plt>
xor    %eax,%eax
call   10e0 <fork@plt>
mov    %eax,0x24(%rsp)
mov    %eax,0xc(%rsp)
test   %eax,%eax
jne    1349 <main+0x189>
lea    0xd48(%rip),%rdi
lea    0xd13(%rip),%rsi
xor    %edx,%edx
call   10c0 <execl@plt>
mov    $0x3,%edi
call   10d0 <sleep@plt>
mov    $0x3,%edi
call   10d0 <sleep@plt>
lea    0x4(%rsp),%rsi
mov    %ebx,%edi
xor    %edx,%edx
call   1090 <waitpid@plt>
mov    0x4(%rsp),%edi
call   10b0 <WIFEXITED@plt>
lea    0xd2f(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp),%edi
call   10b0 <WIFEXITED@plt>
cmp    $0x1,%eax
je     14cb <main+0x30b>
mov    0x14(%rsp),%ebp
lea    0x4(%rsp),%rsi
mov    %ebp,%edi
xor    %edx,%edx
call   1090 <waitpid@plt>
mov    0x4(%rsp),%edi
call   10b0 <WIFEXITED@plt>
lea    0xcf0(%rip),%rdi
mov    %ebp,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp),%edi
call   10b0 <WIFEXITED@plt>
cmp    $0x1,%eax
je     14cb <main+0x30b>
mov    0x18(%rsp),%ebp
lea    0x4(%rsp),%rsi
mov    %ebp,%edi
xor    %edx,%edx
call   1090 <waitpid@plt>
mov    0x4(%rsp),%edi
call   10b0 <WIFEXITED@plt>
lea    0xcb1(%rip),%rdi
mov    %ebp,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp),%edi
call   10b0 <WIFEXITED@plt>
cmp    $0x1,%eax
je     14cb <main+0x30b>
mov    0x1c(%rsp),%ebp
lea    0x4(%rsp),%rsi
mov    %ebp,%edi
xor    %edx,%edx
call   1090 <waitpid@plt>
mov    0x4(%rsp),%edi
call   10b0 <WIFEXITED@plt>
lea    0xc72(%rip),%rdi
mov    %ebp,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp),%edi
call   10b0 <WIFEXITED@plt>
cmp    $0x1,%eax
je     14cb <main+0x30b>
mov    0x20(%rsp),%ebp
lea    0x4(%rsp),%rsi
mov    %ebp,%edi
xor    %edx,%edx
call   1090 <waitpid@plt>
mov    0x4(%rsp),%edi
call   10b0 <WIFEXITED@plt>
lea    0xc37(%rip),%rdi
mov    %ebp,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp),%edi
call   10b0 <WIFEXITED@plt>
cmp    $0x1,%eax
je     14cb <main+0x30b>
mov    0x24(%rsp),%ebp
lea    0x4(%rsp),%rsi
mov    %ebp,%edi
xor    %edx,%edx
call   1090 <waitpid@plt>
mov    0x4(%rsp),%edi
call   10b0 <WIFEXITED@plt>
lea    0xbfc(%rip),%rdi
mov    %ebp,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp),%edi
call   10b0 <WIFEXITED@plt>
cmp    $0x1,%eax
jne    156a <main+0x3aa>
mov    0x2b0e(%rip),%rbp
mov    0x0(%rbp),%esi
mov    %ebx,%edi
call   1070 <kill@plt>
mov    %ebx,%esi
mov    %r15d,%ebx
lea    0xc1a(%rip),%r15
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x0(%rbp),%esi
mov    %r14d,%edi
call   1070 <kill@plt>
mov    %r15,%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x0(%rbp),%esi
mov    %r12d,%edi
call   1070 <kill@plt>
mov    %r15,%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x0(%rbp),%esi
mov    %r13d,%edi
call   1070 <kill@plt>
mov    %r15,%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x0(%rbp),%esi
mov    %ebx,%edi
call   1070 <kill@plt>
mov    %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x0(%rbp),%esi
mov    0xc(%rsp),%ebx
mov    %ebx,%edi
call   1070 <kill@plt>
mov    %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [74 x i8] c"\D0\A3\D1\81\D1\82\D0\B0\D0\BD\D0\BE\D0\B2\D0\B8\D1\82\D0\B5 \D0\BA\D0\BE\D0\BB\D0\B8\D1\87\D0\B5\D1\81\D1\82\D0\B2\D0\BE \D0\B7\D0\BE\D0\BB\D0\BE\D1\82\D0\B0 \D0\B2 \D1\80\D1\83\D0\B4\D0\BD\D0\B8\D0\BA\D0\B5\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [83 x i8] c"\D0\A3\D1\81\D1\82\D0\B0\D0\BD\D0\BE\D0\B2\D0\BB\D0\B5\D0\BD\D0\BD\D0\BE\D0\B5 \D0\BA\D0\BE\D0\BB\D0\B8\D1\87\D0\B5\D1\81\D1\82\D0\B2\D0\BE \D0\B7\D0\BE\D0\BB\D0\BE\D1\82\D0\B0 \D0\B2 \D1\80\D1\83\D0\B4\D0\BD\D0\B8\D0\BA\D0\B5 %d\0A\00"
@.str.3 = [43 x i8] c"/home/arthur/labs/Eltexlabs/CLabs/gold.txt\00"
@.str.4 = [2 x i8] c"w\00"
@.str.5 = [39 x i8] c"/home/arthur/labs/Eltexlabs/CLabs/doch\00"
@.str.6 = [1 x i8] zeroinitializer
@.str.7 = [88 x i8] c"\D0\A0\D0\B0\D0\B1 \D0\BF\D0\BE\D0\B4 \D0\BD\D0\BE\D0\BC\D0\B5\D1\80\D0\BE\D0\BC: %d \D0\B7\D0\B0\D0\B2\D0\B5\D1\80\D1\88\D0\B8\D0\BB \D1\80\D0\B0\D0\B1\D0\BE\D1\82\D1\83, \D0\A0\D0\B5\D0\B7\D1\83\D0\BB\D1\8C\D1\82\D0\B0\D1\82=%d\0A\00"
@SIGKILL = global i32 0
@.str.8 = [63 x i8] c"\D0\9F\D1\80\D0\BE\D1\86\D0\B5\D1\81\D1\81 %d \D0\BF\D1\80\D0\B5\D0\BD\D1\83\D0\B4\D0\B8\D1\82\D0\B5\D0\BB\D1\8C\D0\BD\D0\BE \D0\B7\D0\B0\D0\B2\D0\B5\D1\80\D1\88\D0\B5\D0\BD\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [6 x i32]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %8)
%13 = load i32, i32* %8
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.2, i64 0, i64 0), i32 %13)
%15 = call i32* @fopen(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %15, i32** %10
%16 = load i32*, i32** %10
%17 = load i32, i32* %8
%18 = call i32 @fprintf(i32* %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %17)
%19 = load i32*, i32** %10
%20 = call i32 @fclose(i32* %19)
store i32 0, i32* %6
br label %21
21: ; preds = %38, %2
%22 = load i32, i32* %6
%23 = icmp slt i32 %22, 6
br i1 %23, label %24, label %41
24: ; preds = %21
%25 = call i32 (...) @fork()
%26 = load i32, i32* %6
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [6 x i32], [6 x i32]* %7, i64 0, i64 %27
store i32 %25, i32* %28
%29 = load i32, i32* %6
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [6 x i32], [6 x i32]* %7, i64 0, i64 %30
%32 = load i32, i32* %31
%33 = icmp eq i32 %32, 0
br i1 %33, label %34, label %36
34: ; preds = %24
%35 = call i32 @execl(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.6, i64 0, i64 0), i32* null)
br label %36
36: ; preds = %34, %24
%37 = call i32 @sleep(i32 3)
br label %38
38: ; preds = %36
%39 = load i32, i32* %6
%40 = add nsw i32 %39, 1
store i32 %40, i32* %6
br label %21
41: ; preds = %21
%42 = call i32 @sleep(i32 3)
store i32 0, i32* %6
br label %43
43: ; preds = %83, %41
%44 = load i32, i32* %6
%45 = icmp slt i32 %44, 6
br i1 %45, label %46, label %86
46: ; preds = %43
%47 = load i32, i32* %6
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [6 x i32], [6 x i32]* %7, i64 0, i64 %48
%50 = load i32, i32* %49
%51 = call i32 @waitpid(i32 %50, i32* %9, i32 0)
%52 = load i32, i32* %6
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds [6 x i32], [6 x i32]* %7, i64 0, i64 %53
%55 = load i32, i32* %54
%56 = load i32, i32* %9
%57 = call i32 @WIFEXITED(i32 %56)
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str.7, i64 0, i64 0), i32 %55, i32 %57)
%59 = load i32, i32* %9
%60 = call i32 @WIFEXITED(i32 %59)
%61 = icmp eq i32 %60, 1
br i1 %61, label %62, label %82
62: ; preds = %46
store i32 0, i32* %6
br label %63
63: ; preds = %78, %62
%64 = load i32, i32* %6
%65 = icmp slt i32 %64, 6
br i1 %65, label %66, label %81
66: ; preds = %63
%67 = load i32, i32* %6
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds [6 x i32], [6 x i32]* %7, i64 0, i64 %68
%70 = load i32, i32* %69
%71 = load i32, i32* @SIGKILL
%72 = call i32 @kill(i32 %70, i32 %71)
%73 = load i32, i32* %6
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds [6 x i32], [6 x i32]* %7, i64 0, i64 %74
%76 = load i32, i32* %75
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.8, i64 0, i64 0), i32 %76)
br label %78
78: ; preds = %66
%79 = load i32, i32* %6
%80 = add nsw i32 %79, 1
store i32 %80, i32* %6
br label %63
81: ; preds = %63
br label %82
82: ; preds = %81, %46
br label %83
83: ; preds = %82
%84 = load i32, i32* %6
%85 = add nsw i32 %84, 1
store i32 %85, i32* %6
br label %43
86: ; preds = %43
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [83 x i8] c"\D0\A3\D1\81\D1\82\D0\B0\D0\BD\D0\BE\D0\B2\D0\BB\D0\B5\D0\BD\D0\BD\D0\BE\D0\B5 \D0\BA\D0\BE\D0\BB\D0\B8\D1\87\D0\B5\D1\81\D1\82\D0\B2\D0\BE \D0\B7\D0\BE\D0\BB\D0\BE\D1\82\D0\B0 \D0\B2 \D1\80\D1\83\D0\B4\D0\BD\D0\B8\D0\BA\D0\B5 %d\0A\00"
@.str.3 = [43 x i8] c"/home/arthur/labs/Eltexlabs/CLabs/gold.txt\00"
@.str.4 = [2 x i8] c"w\00"
@.str.5 = [39 x i8] c"/home/arthur/labs/Eltexlabs/CLabs/doch\00"
@.str.6 = [1 x i8] zeroinitializer
@.str.7 = [88 x i8] c"\D0\A0\D0\B0\D0\B1 \D0\BF\D0\BE\D0\B4 \D0\BD\D0\BE\D0\BC\D0\B5\D1\80\D0\BE\D0\BC: %d \D0\B7\D0\B0\D0\B2\D0\B5\D1\80\D1\88\D0\B8\D0\BB \D1\80\D0\B0\D0\B1\D0\BE\D1\82\D1\83, \D0\A0\D0\B5\D0\B7\D1\83\D0\BB\D1\8C\D1\82\D0\B0\D1\82=%d\0A\00"
@SIGKILL = global i32 0
@.str.8 = [63 x i8] c"\D0\9F\D1\80\D0\BE\D1\86\D0\B5\D1\81\D1\81 %d \D0\BF\D1\80\D0\B5\D0\BD\D1\83\D0\B4\D0\B8\D1\82\D0\B5\D0\BB\D1\8C\D0\BD\D0\BE \D0\B7\D0\B0\D0\B2\D0\B5\D1\80\D1\88\D0\B5\D0\BD\0A\00"
@str = [73 x i8] c"\D0\A3\D1\81\D1\82\D0\B0\D0\BD\D0\BE\D0\B2\D0\B8\D1\82\D0\B5 \D0\BA\D0\BE\D0\BB\D0\B8\D1\87\D0\B5\D1\81\D1\82\D0\B2\D0\BE \D0\B7\D0\BE\D0\BB\D0\BE\D1\82\D0\B0 \D0\B2 \D1\80\D1\83\D0\B4\D0\BD\D0\B8\D0\BA\D0\B5\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [6 x i32]
%4 = alloca i32
%5 = alloca i32
%6 = bitcast [6 x i32]* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = bitcast i32* %5 to i8*
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%11 = load i32, i32* %4
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([83 x i8], [83 x i8]* @.str.2, i64 0, i64 0), i32 %11)
%13 = call i32* @fopen(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%14 = load i32, i32* %4
%15 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = call i32 @fclose(i32* %13)
%17 = call i32 (...) @fork()
%18 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 0
store i32 %17, i32* %18
%19 = icmp eq i32 %17, 0
br i1 %19, label %20, label %22
20: ; preds = %2
%21 = call i32 @execl(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.6, i64 0, i64 0), i32* null)
br label %22
22: ; preds = %20, %2
%23 = call i32 @sleep(i32 3)
%24 = call i32 (...) @fork()
%25 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 1
store i32 %24, i32* %25
%26 = icmp eq i32 %24, 0
br i1 %26, label %27, label %29
27: ; preds = %22
%28 = call i32 @execl(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.6, i64 0, i64 0), i32* null)
br label %29
29: ; preds = %27, %22
%30 = call i32 @sleep(i32 3)
%31 = call i32 (...) @fork()
%32 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 2
store i32 %31, i32* %32
%33 = icmp eq i32 %31, 0
br i1 %33, label %34, label %36
34: ; preds = %29
%35 = call i32 @execl(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.6, i64 0, i64 0), i32* null)
br label %36
36: ; preds = %34, %29
%37 = call i32 @sleep(i32 3)
%38 = call i32 (...) @fork()
%39 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 3
store i32 %38, i32* %39
%40 = icmp eq i32 %38, 0
br i1 %40, label %41, label %43
41: ; preds = %36
%42 = call i32 @execl(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.6, i64 0, i64 0), i32* null)
br label %43
43: ; preds = %41, %36
%44 = call i32 @sleep(i32 3)
%45 = call i32 (...) @fork()
%46 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 4
store i32 %45, i32* %46
%47 = icmp eq i32 %45, 0
br i1 %47, label %48, label %50
48: ; preds = %43
%49 = call i32 @execl(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.6, i64 0, i64 0), i32* null)
br label %50
50: ; preds = %48, %43
%51 = call i32 @sleep(i32 3)
%52 = call i32 (...) @fork()
%53 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 5
store i32 %52, i32* %53
%54 = icmp eq i32 %52, 0
br i1 %54, label %55, label %57
55: ; preds = %50
%56 = call i32 @execl(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.6, i64 0, i64 0), i32* null)
br label %57
57: ; preds = %55, %50
%58 = call i32 @sleep(i32 3)
%59 = call i32 @sleep(i32 3)
%60 = call i32 @waitpid(i32 %17, i32* %5, i32 0)
%61 = load i32, i32* %5
%62 = call i32 @WIFEXITED(i32 %61)
%63 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([88 x i8], [88 x i8]* @.str.7, i64 0, i64 0), i32 %17, i32 %62)
%64 = load i32, i32* %5
%65 = call i32 @WIFEXITED(i32 %64)
%66 = icmp eq i32 %65, 1
br i1 %66, label %67, label %86
67: ; preds = %86, %96, %106, %116, %126, %57
%68 = load i32, i32* @SIGKILL
%69 = call i32 @kill(i32 %17, i32 %68)
%70 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @.str.8, i64 0, i64 0), i32 %17)
%71 = load i32, i32* @SIGKILL
%72 = call i32 @kill(i32 %24, i32 %71)
%73 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @.str.8, i64 0, i64 0), i32 %24)
%74 = load i32, i32* @SIGKILL
%75 = call i32 @kill(i32 %31, i32 %74)
%76 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @.str.8, i64 0, i64 0), i32 %31)
%77 = load i32, i32* @SIGKILL
%78 = call i32 @kill(i32 %38, i32 %77)
%79 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @.str.8, i64 0, i64 0), i32 %38)
%80 = load i32, i32* @SIGKILL
%81 = call i32 @kill(i32 %45, i32 %80)
%82 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @.str.8, i64 0, i64 0), i32 %45)
%83 = load i32, i32* @SIGKILL
%84 = call i32 @kill(i32 %52, i32 %83)
%85 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @.str.8, i64 0, i64 0), i32 %52)
br label %136
86: ; preds = %57
%87 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 1
%88 = load i32, i32* %87
%89 = call i32 @waitpid(i32 %88, i32* %5, i32 0)
%90 = load i32, i32* %5
%91 = call i32 @WIFEXITED(i32 %90)
%92 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([88 x i8], [88 x i8]* @.str.7, i64 0, i64 0), i32 %88, i32 %91)
%93 = load i32, i32* %5
%94 = call i32 @WIFEXITED(i32 %93)
%95 = icmp eq i32 %94, 1
br i1 %95, label %67, label %96
96: ; preds = %86
%97 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 2
%98 = load i32, i32* %97
%99 = call i32 @waitpid(i32 %98, i32* %5, i32 0)
%100 = load i32, i32* %5
%101 = call i32 @WIFEXITED(i32 %100)
%102 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([88 x i8], [88 x i8]* @.str.7, i64 0, i64 0), i32 %98, i32 %101)
%103 = load i32, i32* %5
%104 = call i32 @WIFEXITED(i32 %103)
%105 = icmp eq i32 %104, 1
br i1 %105, label %67, label %106
106: ; preds = %96
%107 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 3
%108 = load i32, i32* %107
%109 = call i32 @waitpid(i32 %108, i32* %5, i32 0)
%110 = load i32, i32* %5
%111 = call i32 @WIFEXITED(i32 %110)
%112 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([88 x i8], [88 x i8]* @.str.7, i64 0, i64 0), i32 %108, i32 %111)
%113 = load i32, i32* %5
%114 = call i32 @WIFEXITED(i32 %113)
%115 = icmp eq i32 %114, 1
br i1 %115, label %67, label %116
116: ; preds = %106
%117 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 4
%118 = load i32, i32* %117
%119 = call i32 @waitpid(i32 %118, i32* %5, i32 0)
%120 = load i32, i32* %5
%121 = call i32 @WIFEXITED(i32 %120)
%122 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([88 x i8], [88 x i8]* @.str.7, i64 0, i64 0), i32 %118, i32 %121)
%123 = load i32, i32* %5
%124 = call i32 @WIFEXITED(i32 %123)
%125 = icmp eq i32 %124, 1
br i1 %125, label %67, label %126
126: ; preds = %116
%127 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 5
%128 = load i32, i32* %127
%129 = call i32 @waitpid(i32 %128, i32* %5, i32 0)
%130 = load i32, i32* %5
%131 = call i32 @WIFEXITED(i32 %130)
%132 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([88 x i8], [88 x i8]* @.str.7, i64 0, i64 0), i32 %128, i32 %131)
%133 = load i32, i32* %5
%134 = call i32 @WIFEXITED(i32 %133)
%135 = icmp eq i32 %134, 1
br i1 %135, label %67, label %136
136: ; preds = %126, %67
ret i32 0
}