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

/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int fork();
scalar_t__ pipe(int *);
int /*<<< orphan*/ printf(char *, ...);
int rand();
scalar_t__ read(int, char *, int);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
size_t write(int, char *, int);
int main(int argc, char *argv[], char *env[]) {
  printf("\n Процессы играют в 21'. \n");
  srand(time(NULL));
  int fdp[2], fdc[2], p_id;
  size_t size;
  int i = 0;
  int chat = 1;
  int dice = 0;
  int dice1 = 1;
  char *msg_list[] = {"Брошу ещё", "Последний бросок"};
  char msg[64];
  if (pipe(fdc) < 0) {
    printf("Can\'t Не получилось создать трубу :(\n");
    exit(-1);
  }
  if (pipe(fdp) < 0) {
    printf("Can\'t Не получилось создать трубу :(\n");
    exit(-1);
  }
  printf("%s захотел позвать %s играть в 21 игральными костями \n", "Вася",
         "Петя");
  p_id = fork();
  if (p_id < 0) {
    printf("У %s не получилось позвать %s.\n", "Вася", "Петя");
    exit(-1);
  }
  if (p_id > 0) {
    close(fdc[0]);
    close(fdp[1]);
    int parent_count = 0;
    int extend = 0;
    while (chat > 0) {
      size = write(fdc[1], msg_list[extend], 64);
      if (rand() % 2 == 1) {
        printf("%s : %s \n", "Вася", "Брошу ещё");
        extend = 0;
      } else {
        printf("%s : %s \n", "Вася", "Последний бросок");
        extend = 1;
      }
      while (size = read(fdp[0], msg, 64) < 0)
        ;
      printf("%s мне сказал: %s\n", "Петя", msg);
      printf("%s: Бросаю кость \n", "Вася");
      dice1 = (rand() % 6) + 7;
      parent_count = parent_count + dice1;
      printf("%s: У меня выпало %d !\n", "Вася", dice1);
      if (strcmp(msg, msg_list[1]) == 0) {
        chat = -1;
        printf("%s: Итого у меня %d очков", "Вася", parent_count);
      }
      i++;
    }
    close(fdc[1]);
    close(fdp[0]);
    printf("\n %s закрыл трубы \n", "Вася");
  } else {
    printf("\n %s принял вызов %s \n", "Петя", "Вася");
    close(fdc[1]);
    close(fdp[0]);
    int child_count = 0;
    int extend = 0;
    while (chat > 0) {
      while (size = read(fdc[0], msg, 64) < 0)
        ;
      printf("%s мне сказал: %s\n", "Вася", msg);
      size = write(fdp[1], msg_list[extend], 64);
      if (rand() % 2 == 1) {
        printf("%s : %s \n", "Петя", "Брошу ещё");
        extend = 0;
      } else {
        printf("%s : %s \n", "Петя", "Последний бросок");
        extend = 1;
      }
      printf("%s: Бросаю кость \n", "Петя");
      dice = (rand() % 6) + 1;
      child_count = child_count + dice;
      printf("%s: У меня выпало %d !\n", "Петя", dice);
      if (strcmp(msg, msg_list[1]) == 0) {
        chat = -1;
        printf("%s: Итого у меня %d очков", "Петя", child_count);
      }
      i++;
    }
    close(fdp[1]);
    close(fdc[0]);
    printf("\n %s закрыл трубы \n", "Петя");
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xe2c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10a0 <time@plt>
mov    %eax,%edi
call   1080 <srand@plt>
movl   $0x0,-0x3c(%rbp)
movl   $0x1,-0x40(%rbp)
movl   $0x0,-0x44(%rbp)
movl   $0x1,-0x48(%rbp)
mov    0x2c02(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0x2bff(%rip),%rax
mov    %rax,-0x58(%rbp)
lea    -0x28(%rbp),%rdi
call   1060 <pipe@plt>
cmp    $0x0,%rax
jge    1248 <main+0x98>
lea    0xe25(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   10b0 <exit@plt>
lea    -0x20(%rbp),%rdi
call   1060 <pipe@plt>
cmp    $0x0,%rax
jge    1273 <main+0xc3>
lea    0xdfa(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   10b0 <exit@plt>
lea    0xe20(%rip),%rdi
lea    0xe76(%rip),%rsi
lea    0xe78(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   10c0 <fork@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jge    12c9 <main+0x119>
lea    0xe5f(%rip),%rdi
lea    0xe46(%rip),%rsi
lea    0xe48(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   10b0 <exit@plt>
cmpl   $0x0,-0x2c(%rbp)
jle    14a2 <main+0x2f2>
mov    -0x28(%rbp),%edi
call   1050 <close@plt>
mov    -0x1c(%rbp),%edi
call   1050 <close@plt>
movl   $0x0,-0xa4(%rbp)
movl   $0x0,-0xa8(%rbp)
cmpl   $0x0,-0x40(%rbp)
jle    1478 <main+0x2c8>
mov    -0x24(%rbp),%edi
movslq -0xa8(%rbp),%rax
mov    -0x60(%rbp,%rax,8),%rsi
mov    $0x40,%edx
call   1030 <write@plt>
mov    %rax,-0x38(%rbp)
mov    $0x0,%al
call   10d0 <rand@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    1361 <main+0x1b1>
lea    0xe00(%rip),%rdi
lea    0xdb3(%rip),%rsi
lea    0xcdf(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0xa8(%rbp)
jmp    1387 <main+0x1d7>
lea    0xdd5(%rip),%rdi
lea    0xd88(%rip),%rsi
lea    0xcc6(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0xa8(%rbp)
jmp    138c <main+0x1dc>
mov    -0x20(%rbp),%edi
lea    -0xa0(%rbp),%rsi
mov    $0x40,%edx
call   1070 <read@plt>
cmp    $0x0,%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
cltq
mov    %rax,-0x38(%rbp)
cmp    $0x0,%rax
je     13c1 <main+0x211>
jmp    138c <main+0x1dc>
lea    -0xa0(%rbp),%rdx
lea    0xd78(%rip),%rdi
lea    0xd2a(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd7f(%rip),%rdi
lea    0xd0c(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   10d0 <rand@plt>
mov    $0x6,%ecx
cltd
idiv   %ecx
add    $0x7,%edx
mov    %edx,-0x48(%rbp)
mov    -0xa4(%rbp),%eax
add    -0x48(%rbp),%eax
mov    %eax,-0xa4(%rbp)
mov    -0x48(%rbp),%edx
lea    0xd61(%rip),%rdi
lea    0xcd0(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0xa0(%rbp),%rdi
mov    -0x58(%rbp),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    146a <main+0x2ba>
movl   $0xffffffff,-0x40(%rbp)
mov    -0xa4(%rbp),%edx
lea    0xd48(%rip),%rdi
lea    0xc94(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    12f7 <main+0x147>
mov    -0x24(%rbp),%edi
call   1050 <close@plt>
mov    -0x20(%rbp),%edi
call   1050 <close@plt>
lea    0xd3e(%rip),%rdi
lea    0xc61(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1688 <main+0x4d8>
lea    0xd43(%rip),%rdi
lea    0xc50(%rip),%rsi
lea    0xc40(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x24(%rbp),%edi
call   1050 <close@plt>
mov    -0x20(%rbp),%edi
call   1050 <close@plt>
movl   $0x0,-0xac(%rbp)
movl   $0x0,-0xb0(%rbp)
cmpl   $0x0,-0x40(%rbp)
jle    1663 <main+0x4b3>
jmp    14f1 <main+0x341>
mov    -0x28(%rbp),%edi
lea    -0xa0(%rbp),%rsi
mov    $0x40,%edx
call   1070 <read@plt>
cmp    $0x0,%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
cltq
mov    %rax,-0x38(%rbp)
cmp    $0x0,%rax
je     1526 <main+0x376>
jmp    14f1 <main+0x341>
lea    -0xa0(%rbp),%rdx
lea    0xc13(%rip),%rdi
lea    0xbbc(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%edi
movslq -0xb0(%rbp),%rax
mov    -0x60(%rbp,%rax,8),%rsi
mov    $0x40,%edx
call   1030 <write@plt>
mov    %rax,-0x38(%rbp)
mov    $0x0,%al
call   10d0 <rand@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    15a2 <main+0x3f2>
lea    0xbbf(%rip),%rdi
lea    0xb7b(%rip),%rsi
lea    0xa9e(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0xb0(%rbp)
jmp    15c8 <main+0x418>
lea    0xb94(%rip),%rdi
lea    0xb50(%rip),%rsi
lea    0xa85(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0xb0(%rbp)
lea    0xb94(%rip),%rdi
lea    0xb2a(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   10d0 <rand@plt>
mov    $0x6,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x44(%rbp)
mov    -0xac(%rbp),%eax
add    -0x44(%rbp),%eax
mov    %eax,-0xac(%rbp)
mov    -0x44(%rbp),%edx
lea    0xb76(%rip),%rdi
lea    0xaee(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0xa0(%rbp),%rdi
mov    -0x58(%rbp),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    1655 <main+0x4a5>
movl   $0xffffffff,-0x40(%rbp)
mov    -0xac(%rbp),%edx
lea    0xb5d(%rip),%rdi
lea    0xab2(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    14e2 <main+0x332>
mov    -0x1c(%rbp),%edi
call   1050 <close@plt>
mov    -0x28(%rbp),%edi
call   1050 <close@plt>
lea    0xb53(%rip),%rdi
lea    0xa7f(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %edi,%edi
call   10b0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
lea    0xfd1(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   10b0 <time@plt>
mov    %eax,%edi
call   1090 <srand@plt>
mov    %rsp,%rdi
call   1070 <pipe@plt>
test   %rax,%rax
js     1204 <main+0x44>
lea    0x8(%rsp),%rdi
call   1070 <pipe@plt>
test   %rax,%rax
jns    121a <main+0x5a>
lea    0xfc4(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   10c0 <exit@plt>
lea    0xe11(%rip),%rdi
lea    0xe67(%rip),%rsi
lea    0xe69(%rip),%rdx
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   10d0 <fork@plt>
test   %eax,%eax
jns    1267 <main+0xa7>
lea    0xe59(%rip),%rdi
lea    0xe40(%rip),%rsi
lea    0xe42(%rip),%rdx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xffffffff,%edi
call   10c0 <exit@plt>
jne    13ce <main+0x20e>
lea    0xf10(%rip),%rdi
lea    0xe1d(%rip),%r15
lea    0xe0d(%rip),%rdx
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp),%edi
call   1060 <close@plt>
mov    0x8(%rsp),%edi
call   1060 <close@plt>
lea    0x10(%rsp),%rbx
lea    0xd68(%rip),%rbp
lea    0xe68(%rip),%r14
xor    %r12d,%r12d
xor    %r13d,%r13d
nopw   0x0(%rax,%rax,1)
mov    (%rsp),%edi
mov    %rbx,%rsi
mov    $0x40,%edx
call   1080 <read@plt>
test   %rax,%rax
js     12c0 <main+0x100>
lea    0xe03(%rip),%rdi
lea    0xdac(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rsp),%edi
lea    0x2b18(%rip),%rax
mov    (%rax,%r12,8),%rsi
mov    $0x40,%edx
call   1040 <write@plt>
xor    %eax,%eax
call   10e0 <rand@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
and    $0xfffffffe,%ecx
sub    %ecx,%eax
xor    %r12d,%r12d
cmp    $0x1,%eax
setne  %r12b
mov    %rbp,%rdx
lea    0xcd3(%rip),%rax
cmove  %rax,%rdx
lea    0xd9d(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xdb2(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   10e0 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
mov    %eax,%esi
sub    %ecx,%esi
neg    %ecx
lea    (%rax,%rcx,1),%edx
add    $0x1,%edx
add    %esi,%r13d
add    $0x1,%r13d
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
jne    12c0 <main+0x100>
lea    0xd8c(%rip),%rdi
mov    %r15,%rsi
mov    %r13d,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rsp),%edi
call   1060 <close@plt>
mov    (%rsp),%edi
jmp    1516 <main+0x356>
mov    (%rsp),%edi
call   1060 <close@plt>
mov    0xc(%rsp),%edi
call   1060 <close@plt>
lea    0xc2c(%rip),%r14
lea    0xca2(%rip),%r15
lea    0x10(%rsp),%rbx
lea    0xd20(%rip),%r12
xor    %ebp,%ebp
xor    %r13d,%r13d
xchg   %ax,%ax
mov    0x4(%rsp),%edi
lea    0x2a05(%rip),%rax
mov    (%rax,%rbp,8),%rsi
mov    $0x40,%edx
call   1040 <write@plt>
xor    %eax,%eax
call   10e0 <rand@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
and    $0xfffffffe,%ecx
sub    %ecx,%eax
xor    %ebp,%ebp
cmp    $0x1,%eax
setne  %bpl
mov    %r14,%rdx
lea    0xbc1(%rip),%rax
cmove  %rax,%rdx
lea    0xc8b(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x8(%rsp),%edi
mov    %rbx,%rsi
mov    $0x40,%edx
call   1080 <read@plt>
test   %rax,%rax
js     1460 <main+0x2a0>
lea    0xc62(%rip),%rdi
lea    0xc14(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xc66(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   10e0 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
mov    %eax,%esi
sub    %ecx,%esi
neg    %ecx
lea    (%rax,%rcx,1),%edx
add    $0x7,%edx
add    %esi,%r13d
add    $0x7,%r13d
mov    %r12,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
jne    1400 <main+0x240>
lea    0xc40(%rip),%rdi
mov    %r15,%rsi
mov    %r13d,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp),%edi
call   1060 <close@plt>
mov    0x8(%rsp),%edi
call   1060 <close@plt>
lea    0xc43(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %edi,%edi
call   10c0 <exit@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"\0A \D0\9F\D1\80\D0\BE\D1\86\D0\B5\D1\81\D1\81\D1\8B \D0\B8\D0\B3\D1\80\D0\B0\D1\8E\D1\82 \D0\B2 21'. \0A\00"
@.str.1 = [18 x i8] c"\D0\91\D1\80\D0\BE\D1\88\D1\83 \D0\B5\D1\89\D1\91\00"
@.str.2 = [32 x i8] c"\D0\9F\D0\BE\D1\81\D0\BB\D0\B5\D0\B4\D0\BD\D0\B8\D0\B9 \D0\B1\D1\80\D0\BE\D1\81\D0\BE\D0\BA\00"
@__const.main.msg_list = [2 x i8*] [i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i32 0, i32 0)]
@.str.3 = [62 x i8] c"Can't \D0\9D\D0\B5 \D0\BF\D0\BE\D0\BB\D1\83\D1\87\D0\B8\D0\BB\D0\BE\D1\81\D1\8C \D1\81\D0\BE\D0\B7\D0\B4\D0\B0\D1\82\D1\8C \D1\82\D1\80\D1\83\D0\B1\D1\83 :(\0A\00"
@.str.4 = [93 x i8] c"%s \D0\B7\D0\B0\D1\85\D0\BE\D1\82\D0\B5\D0\BB \D0\BF\D0\BE\D0\B7\D0\B2\D0\B0\D1\82\D1\8C %s \D0\B8\D0\B3\D1\80\D0\B0\D1\82\D1\8C \D0\B2 21 \D0\B8\D0\B3\D1\80\D0\B0\D0\BB\D1\8C\D0\BD\D1\8B\D0\BC\D0\B8 \D0\BA\D0\BE\D1\81\D1\82\D1\8F\D0\BC\D0\B8 \0A\00"
@.str.5 = [9 x i8] c"\D0\92\D0\B0\D1\81\D1\8F\00"
@.str.6 = [9 x i8] c"\D0\9F\D0\B5\D1\82\D1\8F\00"
@.str.7 = [52 x i8] c"\D0\A3 %s \D0\BD\D0\B5 \D0\BF\D0\BE\D0\BB\D1\83\D1\87\D0\B8\D0\BB\D0\BE\D1\81\D1\8C \D0\BF\D0\BE\D0\B7\D0\B2\D0\B0\D1\82\D1\8C %s.\0A\00"
@.str.8 = [10 x i8] c"%s : %s \0A\00"
@.str.9 = [28 x i8] c"%s \D0\BC\D0\BD\D0\B5 \D1\81\D0\BA\D0\B0\D0\B7\D0\B0\D0\BB: %s\0A\00"
@.str.10 = [30 x i8] c"%s: \D0\91\D1\80\D0\BE\D1\81\D0\B0\D1\8E \D0\BA\D0\BE\D1\81\D1\82\D1\8C \0A\00"
@.str.11 = [35 x i8] c"%s: \D0\A3 \D0\BC\D0\B5\D0\BD\D1\8F \D0\B2\D1\8B\D0\BF\D0\B0\D0\BB\D0\BE %d !\0A\00"
@.str.12 = [41 x i8] c"%s: \D0\98\D1\82\D0\BE\D0\B3\D0\BE \D1\83 \D0\BC\D0\B5\D0\BD\D1\8F %d \D0\BE\D1\87\D0\BA\D0\BE\D0\B2\00"
@.str.13 = [31 x i8] c"\0A %s \D0\B7\D0\B0\D0\BA\D1\80\D1\8B\D0\BB \D1\82\D1\80\D1\83\D0\B1\D1\8B \0A\00"
@.str.14 = [34 x i8] c"\0A %s \D0\BF\D1\80\D0\B8\D0\BD\D1\8F\D0\BB \D0\B2\D1\8B\D0\B7\D0\BE\D0\B2 %s \0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca [2 x i32]
%9 = alloca [2 x i32]
%10 = alloca i32
%11 = alloca i64
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca [2 x i8*]
%17 = alloca [64 x i8]
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%23 = call i32 @time(i32* null)
%24 = call i32 @srand(i32 %23)
store i32 0, i32* %12
store i32 1, i32* %13
store i32 0, i32* %14
store i32 1, i32* %15
%25 = bitcast [2 x i8*]* %16 to i8*
%26 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%27 = call i64 @pipe(i32* %26)
%28 = icmp slt i64 %27, 0
br i1 %28, label %29, label %32
29: ; preds = %3
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.3, i64 0, i64 0))
%31 = call i32 @exit(i32 -1)
unreachable
32: ; preds = %3
%33 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%34 = call i64 @pipe(i32* %33)
%35 = icmp slt i64 %34, 0
br i1 %35, label %36, label %39
36: ; preds = %32
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.3, i64 0, i64 0))
%38 = call i32 @exit(i32 -1)
unreachable
39: ; preds = %32
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%41 = call i32 (...) @fork()
store i32 %41, i32* %10
%42 = load i32, i32* %10
%43 = icmp slt i32 %42, 0
br i1 %43, label %44, label %47
44: ; preds = %39
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%46 = call i32 @exit(i32 -1)
unreachable
47: ; preds = %39
%48 = load i32, i32* %10
%49 = icmp sgt i32 %48, 0
br i1 %49, label %50, label %117
50: ; preds = %47
%51 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%52 = load i32, i32* %51
%53 = call i32 @close(i32 %52)
%54 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
%55 = load i32, i32* %54
%56 = call i32 @close(i32 %55)
store i32 0, i32* %18
store i32 0, i32* %19
br label %57
57: ; preds = %106, %50
%58 = load i32, i32* %13
%59 = icmp sgt i32 %58, 0
br i1 %59, label %60, label %109
60: ; preds = %57
%61 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
%62 = load i32, i32* %61
%63 = load i32, i32* %19
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds [2 x i8*], [2 x i8*]* %16, i64 0, i64 %64
%66 = load i8*, i8** %65
%67 = call i64 @write(i32 %62, i8* %66, i32 64)
store i64 %67, i64* %11
%68 = call i32 (...) @rand()
%69 = srem i32 %68, 2
%70 = icmp eq i32 %69, 1
br i1 %70, label %71, label %73
71: ; preds = %60
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %19
br label %75
73: ; preds = %60
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %19
br label %75
75: ; preds = %73, %71
br label %76
76: ; preds = %85, %75
%77 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%78 = load i32, i32* %77
%79 = getelementptr inbounds [64 x i8], [64 x i8]* %17, i64 0, i64 0
%80 = call i64 @read(i32 %78, i8* %79, i32 64)
%81 = icmp slt i64 %80, 0
%82 = zext i1 %81 to i32
%83 = sext i32 %82 to i64
store i64 %83, i64* %11
%84 = icmp ne i64 %83, 0
br i1 %84, label %85, label %86
85: ; preds = %76
br label %76
86: ; preds = %76
%87 = getelementptr inbounds [64 x i8], [64 x i8]* %17, i64 0, i64 0
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i8* %87)
%89 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
%90 = call i32 (...) @rand()
%91 = srem i32 %90, 6
%92 = add nsw i32 %91, 7
store i32 %92, i32* %15
%93 = load i32, i32* %18
%94 = load i32, i32* %15
%95 = add nsw i32 %93, %94
store i32 %95, i32* %18
%96 = load i32, i32* %15
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i32 %96)
%98 = getelementptr inbounds [64 x i8], [64 x i8]* %17, i64 0, i64 0
%99 = getelementptr inbounds [2 x i8*], [2 x i8*]* %16, i64 0, i64 1
%100 = load i8*, i8** %99
%101 = call i64 @strcmp(i8* %98, i8* %100)
%102 = icmp eq i64 %101, 0
br i1 %102, label %103, label %106
103: ; preds = %86
store i32 -1, i32* %13
%104 = load i32, i32* %18
%105 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i32 %104)
br label %106
106: ; preds = %103, %86
%107 = load i32, i32* %12
%108 = add nsw i32 %107, 1
store i32 %108, i32* %12
br label %57
109: ; preds = %57
%110 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
%111 = load i32, i32* %110
%112 = call i32 @close(i32 %111)
%113 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%114 = load i32, i32* %113
%115 = call i32 @close(i32 %114)
%116 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
br label %185
117: ; preds = %47
%118 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
%119 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
%120 = load i32, i32* %119
%121 = call i32 @close(i32 %120)
%122 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%123 = load i32, i32* %122
%124 = call i32 @close(i32 %123)
store i32 0, i32* %20
store i32 0, i32* %21
br label %125
125: ; preds = %174, %117
%126 = load i32, i32* %13
%127 = icmp sgt i32 %126, 0
br i1 %127, label %128, label %177
128: ; preds = %125
br label %129
129: ; preds = %138, %128
%130 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%131 = load i32, i32* %130
%132 = getelementptr inbounds [64 x i8], [64 x i8]* %17, i64 0, i64 0
%133 = call i64 @read(i32 %131, i8* %132, i32 64)
%134 = icmp slt i64 %133, 0
%135 = zext i1 %134 to i32
%136 = sext i32 %135 to i64
store i64 %136, i64* %11
%137 = icmp ne i64 %136, 0
br i1 %137, label %138, label %139
138: ; preds = %129
br label %129
139: ; preds = %129
%140 = getelementptr inbounds [64 x i8], [64 x i8]* %17, i64 0, i64 0
%141 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* %140)
%142 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
%143 = load i32, i32* %142
%144 = load i32, i32* %21
%145 = sext i32 %144 to i64
%146 = getelementptr inbounds [2 x i8*], [2 x i8*]* %16, i64 0, i64 %145
%147 = load i8*, i8** %146
%148 = call i64 @write(i32 %143, i8* %147, i32 64)
store i64 %148, i64* %11
%149 = call i32 (...) @rand()
%150 = srem i32 %149, 2
%151 = icmp eq i32 %150, 1
br i1 %151, label %152, label %154
152: ; preds = %139
%153 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %21
br label %156
154: ; preds = %139
%155 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %21
br label %156
156: ; preds = %154, %152
%157 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%158 = call i32 (...) @rand()
%159 = srem i32 %158, 6
%160 = add nsw i32 %159, 1
store i32 %160, i32* %14
%161 = load i32, i32* %20
%162 = load i32, i32* %14
%163 = add nsw i32 %161, %162
store i32 %163, i32* %20
%164 = load i32, i32* %14
%165 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32 %164)
%166 = getelementptr inbounds [64 x i8], [64 x i8]* %17, i64 0, i64 0
%167 = getelementptr inbounds [2 x i8*], [2 x i8*]* %16, i64 0, i64 1
%168 = load i8*, i8** %167
%169 = call i64 @strcmp(i8* %166, i8* %168)
%170 = icmp eq i64 %169, 0
br i1 %170, label %171, label %174
171: ; preds = %156
store i32 -1, i32* %13
%172 = load i32, i32* %20
%173 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32 %172)
br label %174
174: ; preds = %171, %156
%175 = load i32, i32* %12
%176 = add nsw i32 %175, 1
store i32 %176, i32* %12
br label %125
177: ; preds = %125
%178 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
%179 = load i32, i32* %178
%180 = call i32 @close(i32 %179)
%181 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%182 = load i32, i32* %181
%183 = call i32 @close(i32 %182)
%184 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
br label %185
185: ; preds = %177, %109
%186 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str.1 = [18 x i8] c"\D0\91\D1\80\D0\BE\D1\88\D1\83 \D0\B5\D1\89\D1\91\00"
@.str.2 = [32 x i8] c"\D0\9F\D0\BE\D1\81\D0\BB\D0\B5\D0\B4\D0\BD\D0\B8\D0\B9 \D0\B1\D1\80\D0\BE\D1\81\D0\BE\D0\BA\00"
@__const.main.msg_list = [2 x i8*] [i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i32 0, i32 0)]
@.str.4 = [93 x i8] c"%s \D0\B7\D0\B0\D1\85\D0\BE\D1\82\D0\B5\D0\BB \D0\BF\D0\BE\D0\B7\D0\B2\D0\B0\D1\82\D1\8C %s \D0\B8\D0\B3\D1\80\D0\B0\D1\82\D1\8C \D0\B2 21 \D0\B8\D0\B3\D1\80\D0\B0\D0\BB\D1\8C\D0\BD\D1\8B\D0\BC\D0\B8 \D0\BA\D0\BE\D1\81\D1\82\D1\8F\D0\BC\D0\B8 \0A\00"
@.str.5 = [9 x i8] c"\D0\92\D0\B0\D1\81\D1\8F\00"
@.str.6 = [9 x i8] c"\D0\9F\D0\B5\D1\82\D1\8F\00"
@.str.7 = [52 x i8] c"\D0\A3 %s \D0\BD\D0\B5 \D0\BF\D0\BE\D0\BB\D1\83\D1\87\D0\B8\D0\BB\D0\BE\D1\81\D1\8C \D0\BF\D0\BE\D0\B7\D0\B2\D0\B0\D1\82\D1\8C %s.\0A\00"
@.str.8 = [10 x i8] c"%s : %s \0A\00"
@.str.9 = [28 x i8] c"%s \D0\BC\D0\BD\D0\B5 \D1\81\D0\BA\D0\B0\D0\B7\D0\B0\D0\BB: %s\0A\00"
@.str.10 = [30 x i8] c"%s: \D0\91\D1\80\D0\BE\D1\81\D0\B0\D1\8E \D0\BA\D0\BE\D1\81\D1\82\D1\8C \0A\00"
@.str.11 = [35 x i8] c"%s: \D0\A3 \D0\BC\D0\B5\D0\BD\D1\8F \D0\B2\D1\8B\D0\BF\D0\B0\D0\BB\D0\BE %d !\0A\00"
@.str.12 = [41 x i8] c"%s: \D0\98\D1\82\D0\BE\D0\B3\D0\BE \D1\83 \D0\BC\D0\B5\D0\BD\D1\8F %d \D0\BE\D1\87\D0\BA\D0\BE\D0\B2\00"
@.str.13 = [31 x i8] c"\0A %s \D0\B7\D0\B0\D0\BA\D1\80\D1\8B\D0\BB \D1\82\D1\80\D1\83\D0\B1\D1\8B \0A\00"
@.str.14 = [34 x i8] c"\0A %s \D0\BF\D1\80\D0\B8\D0\BD\D1\8F\D0\BB \D0\B2\D1\8B\D0\B7\D0\BE\D0\B2 %s \0A\00"
@str = [41 x i8] c"\0A \D0\9F\D1\80\D0\BE\D1\86\D0\B5\D1\81\D1\81\D1\8B \D0\B8\D0\B3\D1\80\D0\B0\D1\8E\D1\82 \D0\B2 21'. \00"
@str.16 = [61 x i8] c"Can't \D0\9D\D0\B5 \D0\BF\D0\BE\D0\BB\D1\83\D1\87\D0\B8\D0\BB\D0\BE\D1\81\D1\8C \D1\81\D0\BE\D0\B7\D0\B4\D0\B0\D1\82\D1\8C \D1\82\D1\80\D1\83\D0\B1\D1\83 :(\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = alloca [2 x i32]
%5 = alloca [2 x i32]
%6 = alloca [64 x i8]
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @time(i32* null)
%9 = tail call i32 @srand(i32 %8)
%10 = bitcast [2 x i32]* %4 to i8*
%11 = bitcast [2 x i32]* %5 to i8*
%12 = getelementptr inbounds [64 x i8], [64 x i8]* %6, i64 0, i64 0
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%14 = call i64 @pipe(i32* %13)
%15 = icmp slt i64 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %3
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.16, i64 0, i64 0))
%18 = call i32 @exit(i32 -1)
unreachable
19: ; preds = %3
%20 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%21 = call i64 @pipe(i32* %20)
%22 = icmp slt i64 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %19
%24 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.16, i64 0, i64 0))
%25 = call i32 @exit(i32 -1)
unreachable
26: ; preds = %19
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([93 x i8], [93 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%28 = call i32 (...) @fork()
%29 = icmp slt i32 %28, 0
br i1 %29, label %30, label %33
30: ; preds = %26
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%32 = call i32 @exit(i32 -1)
unreachable
33: ; preds = %26
%34 = icmp eq i32 %28, 0
br i1 %34, label %75, label %35
35: ; preds = %33
%36 = load i32, i32* %13
%37 = call i32 @close(i32 %36)
%38 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%39 = load i32, i32* %38
%40 = call i32 @close(i32 %39)
%41 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
br label %42
42: ; preds = %60, %35
%43 = phi i64 [ 0, %35 ], [ %54, %60 ]
%44 = phi i32 [ 0, %35 ], [ %66, %60 ]
%45 = load i32, i32* %41
%46 = getelementptr inbounds [2 x i8*], [2 x i8*]* @__const.main.msg_list, i64 0, i64 %43
%47 = load i8*, i8** %46
%48 = call i64 @write(i32 %45, i8* %47, i32 64)
%49 = call i32 (...) @rand()
%50 = srem i32 %49, 2
%51 = icmp eq i32 %50, 1
%52 = select i1 %51, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0)
%53 = xor i1 %51, true
%54 = zext i1 %53 to i64
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* %52)
br label %56
56: ; preds = %56, %42
%57 = load i32, i32* %20
%58 = call i64 @read(i32 %57, i8* %12, i32 64)
%59 = icmp slt i64 %58, 0
br i1 %59, label %56, label %60
60: ; preds = %56
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i8* %12)
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
%63 = call i32 (...) @rand()
%64 = srem i32 %63, 6
%65 = add nsw i32 %64, 7
%66 = add nsw i32 %65, %44
%67 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i32 %65)
%68 = call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
%69 = icmp eq i64 %68, 0
br i1 %69, label %70, label %42
70: ; preds = %60
%71 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i32 %66)
%72 = load i32, i32* %41
%73 = call i32 @close(i32 %72)
%74 = load i32, i32* %20
br label %116
75: ; preds = %33
%76 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
%77 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
%78 = load i32, i32* %77
%79 = call i32 @close(i32 %78)
%80 = load i32, i32* %20
%81 = call i32 @close(i32 %80)
%82 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
br label %83
83: ; preds = %90, %75
%84 = phi i64 [ 0, %75 ], [ %101, %90 ]
%85 = phi i32 [ 0, %75 ], [ %107, %90 ]
br label %86
86: ; preds = %83, %86
%87 = load i32, i32* %13
%88 = call i64 @read(i32 %87, i8* %12, i32 64)
%89 = icmp slt i64 %88, 0
br i1 %89, label %86, label %90
90: ; preds = %86
%91 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* %12)
%92 = load i32, i32* %82
%93 = getelementptr inbounds [2 x i8*], [2 x i8*]* @__const.main.msg_list, i64 0, i64 %84
%94 = load i8*, i8** %93
%95 = call i64 @write(i32 %92, i8* %94, i32 64)
%96 = call i32 (...) @rand()
%97 = srem i32 %96, 2
%98 = icmp eq i32 %97, 1
%99 = select i1 %98, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0)
%100 = xor i1 %98, true
%101 = zext i1 %100 to i64
%102 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i8* %99)
%103 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%104 = call i32 (...) @rand()
%105 = srem i32 %104, 6
%106 = add nsw i32 %105, 1
%107 = add nsw i32 %106, %85
%108 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32 %106)
%109 = call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
%110 = icmp eq i64 %109, 0
br i1 %110, label %111, label %83
111: ; preds = %90
%112 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32 %107)
%113 = load i32, i32* %82
%114 = call i32 @close(i32 %113)
%115 = load i32, i32* %13
br label %116
116: ; preds = %111, %70
%117 = phi i32 [ %115, %111 ], [ %74, %70 ]
%118 = phi i8* [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), %111 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), %70 ]
%119 = call i32 @close(i32 %117)
%120 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.13, i64 0, i64 0), i8* %118)
%121 = call i32 @exit(i32 0)
unreachable
}