#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 *, ...);
scalar_t__ read(int, char *, int);
scalar_t__ strcmp(char *, char *);
size_t write(int, ...);
int main(int argc, char *argv[], char *env[]) {
  int fd_p[2], fd_c[2], pid_dan;
  size_t size;
  char *str[] = {"Luck!", "I am your father!", "Nooo!", "You lie!"};
  int i;
  int flag = 0;
  char resstr[64];
  if (pipe(fd_p) < 0) {
    printf("Can't create pipe\n");
    exit(-1);
  }
  if (pipe(fd_c) < 0) {
    printf("Can't create pipe\n");
    exit(-1);
  }
  pid_dan = fork();
  if (pid_dan < 0) {
    printf("Can't create fork\n");
    exit(-1);
  }
  if (pid_dan > 0) {
    i = 0;
    close(fd_c[0]);
    close(fd_p[1]);
    while (flag == 0) {
      size = write(fd_c[1], str, 64);
      while (size = read(fd_p[0], resstr, 64) < 0)
        ;
      printf("Father says son: %s\n", resstr);
      if (strcmp(resstr, str[1]) == 0)
        flag = 1;
      i = i + 1;
    }
    close(fd_c[1]);
    close(fd_p[0]);
    printf(
        "-----------------------------------------------------------------\n");
  }
  if (pid_dan == 0) {
    i = 2;
    close(fd_c[1]);
    close(fd_p[0]);
    while (flag == 0) {
      while (size = read(fd_c[0], resstr, 64) < 0)
        ;
      printf("Son says father: %s\n", resstr);
      size = write(fd_p[1], str[i], 64);
      if (strcmp(resstr, str[3]) == 0)
        flag = 1;
      i = i + 1;
    }
    close(fd_p[1]);
    close(fd_c[0]);
    printf("------------------------------------------------------\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)
mov    0x2c5c(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0x2c59(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0x2c56(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0x2c53(%rip),%rax
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x68(%rbp)
lea    -0x20(%rbp),%rdi
call   1060 <pipe@plt>
cmp    $0x0,%rax
jge    11fb <main+0x7b>
lea    0xe3d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1090 <exit@plt>
lea    -0x28(%rbp),%rdi
call   1060 <pipe@plt>
cmp    $0x0,%rax
jge    1226 <main+0xa6>
lea    0xe12(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1090 <exit@plt>
mov    $0x0,%al
call   10a0 <fork@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jge    1252 <main+0xd2>
lea    0xdf9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1090 <exit@plt>
cmpl   $0x0,-0x2c(%rbp)
jle    132b <main+0x1ab>
movl   $0x0,-0x64(%rbp)
mov    -0x28(%rbp),%edi
call   1050 <close@plt>
mov    -0x1c(%rbp),%edi
call   1050 <close@plt>
cmpl   $0x0,-0x68(%rbp)
jne    130d <main+0x18d>
mov    -0x24(%rbp),%edi
lea    -0x60(%rbp),%rsi
mov    $0x40,%edx
mov    $0x0,%al
call   1030 <write@plt>
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%edi
lea    -0xb0(%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     12c9 <main+0x149>
jmp    1294 <main+0x114>
lea    -0xb0(%rbp),%rsi
lea    0xd76(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0xb0(%rbp),%rdi
mov    -0x58(%rbp),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    12ff <main+0x17f>
movl   $0x1,-0x68(%rbp)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1273 <main+0xf3>
mov    -0x24(%rbp),%edi
call   1050 <close@plt>
mov    -0x20(%rbp),%edi
call   1050 <close@plt>
lea    0xd3e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x0,-0x2c(%rbp)
jne    140e <main+0x28e>
movl   $0x2,-0x64(%rbp)
mov    -0x24(%rbp),%edi
call   1050 <close@plt>
mov    -0x20(%rbp),%edi
call   1050 <close@plt>
cmpl   $0x0,-0x68(%rbp)
jne    13f0 <main+0x270>
jmp    135b <main+0x1db>
mov    -0x28(%rbp),%edi
lea    -0xb0(%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     1390 <main+0x210>
jmp    135b <main+0x1db>
lea    -0xb0(%rbp),%rsi
lea    0xd07(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%edi
movslq -0x64(%rbp),%rax
mov    -0x60(%rbp,%rax,8),%rsi
mov    $0x40,%edx
mov    $0x0,%al
call   1030 <write@plt>
mov    %rax,-0x38(%rbp)
lea    -0xb0(%rbp),%rdi
mov    -0x48(%rbp),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    13e2 <main+0x262>
movl   $0x1,-0x68(%rbp)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    134c <main+0x1cc>
mov    -0x1c(%rbp),%edi
call   1050 <close@plt>
mov    -0x28(%rbp),%edi
call   1050 <close@plt>
lea    0xc66(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %edi,%edi
call   1090 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x70,%rsp
movaps 0x2c70(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0x2c54(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x8(%rsp),%rdi
call   1070 <pipe@plt>
test   %rax,%rax
js     11cd <main+0x3d>
mov    %rsp,%rdi
call   1070 <pipe@plt>
test   %rax,%rax
jns    11e3 <main+0x53>
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   10a0 <exit@plt>
xor    %eax,%eax
call   10b0 <fork@plt>
test   %eax,%eax
jns    11f7 <main+0x67>
lea    0xe9e(%rip),%rdi
jmp    11d4 <main+0x44>
jne    1295 <main+0x105>
mov    0x4(%rsp),%edi
call   1060 <close@plt>
mov    0x8(%rsp),%edi
call   1060 <close@plt>
mov    $0x2,%r15d
lea    0x30(%rsp),%rbx
lea    0xe1b(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%rsp),%edi
mov    %rbx,%rsi
mov    $0x40,%edx
call   1080 <read@plt>
test   %rax,%rax
js     1230 <main+0xa0>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rsp),%edi
mov    0x10(%rsp,%r15,8),%rsi
mov    $0x40,%edx
xor    %eax,%eax
call   1040 <write@plt>
mov    0x28(%rsp),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
add    $0x1,%r15
test   %rax,%rax
jne    1230 <main+0xa0>
mov    0xc(%rsp),%edi
call   1060 <close@plt>
lea    0xdcf(%rip),%rbx
mov    (%rsp),%edi
jmp    1329 <main+0x199>
mov    (%rsp),%edi
call   1060 <close@plt>
mov    0xc(%rsp),%edi
call   1060 <close@plt>
lea    0x10(%rsp),%r14
lea    0x30(%rsp),%rbx
lea    0xd70(%rip),%r15
nopw   0x0(%rax,%rax,1)
mov    0x4(%rsp),%edi
mov    %r14,%rsi
mov    $0x40,%edx
xor    %eax,%eax
call   1040 <write@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x8(%rsp),%edi
mov    %rbx,%rsi
mov    $0x40,%edx
call   1080 <read@plt>
test   %rax,%rax
js     12e0 <main+0x150>
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
jne    12c0 <main+0x130>
mov    0x4(%rsp),%edi
call   1060 <close@plt>
lea    0xd2c(%rip),%rbx
mov    0x8(%rsp),%edi
call   1060 <close@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   10a0 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"Luck!\00"
@.str.1 = [18 x i8] c"I am your father!\00"
@.str.2 = [6 x i8] c"Nooo!\00"
@.str.3 = [9 x i8] c"You lie!\00"
@__const.main.str = [4 x i8*] [i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i32 0, i32 0)]
@.str.4 = [19 x i8] c"Can't create pipe\0A\00"
@.str.5 = [19 x i8] c"Can't create fork\0A\00"
@.str.6 = [21 x i8] c"Father says son: %s\0A\00"
@.str.7 = [67 x i8] c"-----------------------------------------------------------------\0A\00"
@.str.8 = [21 x i8] c"Son says father: %s\0A\00"
@.str.9 = [56 x i8] c"------------------------------------------------------\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 [4 x i8*]
%13 = alloca i32
%14 = alloca i32
%15 = alloca [64 x i8]
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%16 = bitcast [4 x i8*]* %12 to i8*
store i32 0, i32* %14
%17 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%18 = call i64 @pipe(i32* %17)
%19 = icmp slt i64 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %3
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%22 = call i32 @exit(i32 -1)
unreachable
23: ; preds = %3
%24 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%25 = call i64 @pipe(i32* %24)
%26 = icmp slt i64 %25, 0
br i1 %26, label %27, label %30
27: ; preds = %23
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%29 = call i32 @exit(i32 -1)
unreachable
30: ; preds = %23
%31 = call i32 (...) @fork()
store i32 %31, i32* %10
%32 = load i32, i32* %10
%33 = icmp slt i32 %32, 0
br i1 %33, label %34, label %37
34: ; preds = %30
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%36 = call i32 @exit(i32 -1)
unreachable
37: ; preds = %30
%38 = load i32, i32* %10
%39 = icmp sgt i32 %38, 0
br i1 %39, label %40, label %85
40: ; preds = %37
store i32 0, i32* %13
%41 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%42 = load i32, i32* %41
%43 = call i32 @close(i32 %42)
%44 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
%45 = load i32, i32* %44
%46 = call i32 @close(i32 %45)
br label %47
47: ; preds = %74, %40
%48 = load i32, i32* %14
%49 = icmp eq i32 %48, 0
br i1 %49, label %50, label %77
50: ; preds = %47
%51 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
%52 = load i32, i32* %51
%53 = getelementptr inbounds [4 x i8*], [4 x i8*]* %12, i64 0, i64 0
%54 = call i64 (i32, ...) @write(i32 %52, i8** %53, i32 64)
store i64 %54, i64* %11
br label %55
55: ; preds = %64, %50
%56 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%57 = load i32, i32* %56
%58 = getelementptr inbounds [64 x i8], [64 x i8]* %15, i64 0, i64 0
%59 = call i64 @read(i32 %57, i8* %58, i32 64)
%60 = icmp slt i64 %59, 0
%61 = zext i1 %60 to i32
%62 = sext i32 %61 to i64
store i64 %62, i64* %11
%63 = icmp ne i64 %62, 0
br i1 %63, label %64, label %65
64: ; preds = %55
br label %55
65: ; preds = %55
%66 = getelementptr inbounds [64 x i8], [64 x i8]* %15, i64 0, i64 0
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i8* %66)
%68 = getelementptr inbounds [64 x i8], [64 x i8]* %15, i64 0, i64 0
%69 = getelementptr inbounds [4 x i8*], [4 x i8*]* %12, i64 0, i64 1
%70 = load i8*, i8** %69
%71 = call i64 @strcmp(i8* %68, i8* %70)
%72 = icmp eq i64 %71, 0
br i1 %72, label %73, label %74
73: ; preds = %65
store i32 1, i32* %14
br label %74
74: ; preds = %73, %65
%75 = load i32, i32* %13
%76 = add nsw i32 %75, 1
store i32 %76, i32* %13
br label %47
77: ; preds = %47
%78 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
%79 = load i32, i32* %78
%80 = call i32 @close(i32 %79)
%81 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%82 = load i32, i32* %81
%83 = call i32 @close(i32 %82)
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.7, i64 0, i64 0))
br label %85
85: ; preds = %77, %37
%86 = load i32, i32* %10
%87 = icmp eq i32 %86, 0
br i1 %87, label %88, label %136
88: ; preds = %85
store i32 2, i32* %13
%89 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
%90 = load i32, i32* %89
%91 = call i32 @close(i32 %90)
%92 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%93 = load i32, i32* %92
%94 = call i32 @close(i32 %93)
br label %95
95: ; preds = %125, %88
%96 = load i32, i32* %14
%97 = icmp eq i32 %96, 0
br i1 %97, label %98, label %128
98: ; preds = %95
br label %99
99: ; preds = %108, %98
%100 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%101 = load i32, i32* %100
%102 = getelementptr inbounds [64 x i8], [64 x i8]* %15, i64 0, i64 0
%103 = call i64 @read(i32 %101, i8* %102, i32 64)
%104 = icmp slt i64 %103, 0
%105 = zext i1 %104 to i32
%106 = sext i32 %105 to i64
store i64 %106, i64* %11
%107 = icmp ne i64 %106, 0
br i1 %107, label %108, label %109
108: ; preds = %99
br label %99
109: ; preds = %99
%110 = getelementptr inbounds [64 x i8], [64 x i8]* %15, i64 0, i64 0
%111 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0), i8* %110)
%112 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
%113 = load i32, i32* %112
%114 = load i32, i32* %13
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds [4 x i8*], [4 x i8*]* %12, i64 0, i64 %115
%117 = load i8*, i8** %116
%118 = call i64 (i32, ...) @write(i32 %113, i8* %117, i32 64)
store i64 %118, i64* %11
%119 = getelementptr inbounds [64 x i8], [64 x i8]* %15, i64 0, i64 0
%120 = getelementptr inbounds [4 x i8*], [4 x i8*]* %12, i64 0, i64 3
%121 = load i8*, i8** %120
%122 = call i64 @strcmp(i8* %119, i8* %121)
%123 = icmp eq i64 %122, 0
br i1 %123, label %124, label %125
124: ; preds = %109
store i32 1, i32* %14
br label %125
125: ; preds = %124, %109
%126 = load i32, i32* %13
%127 = add nsw i32 %126, 1
store i32 %127, i32* %13
br label %95
128: ; preds = %95
%129 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
%130 = load i32, i32* %129
%131 = call i32 @close(i32 %130)
%132 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%133 = load i32, i32* %132
%134 = call i32 @close(i32 %133)
%135 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.9, i64 0, i64 0))
br label %136
136: ; preds = %128, %85
%137 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [6 x i8] c"Luck!\00"
@.str.1 = [18 x i8] c"I am your father!\00"
@.str.2 = [6 x i8] c"Nooo!\00"
@.str.3 = [9 x i8] c"You lie!\00"
@__const.main.str = [4 x i8*] [i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i32 0, i32 0)]
@.str.6 = [21 x i8] c"Father says son: %s\0A\00"
@.str.8 = [21 x i8] c"Son says father: %s\0A\00"
@str = [55 x i8] c"------------------------------------------------------\00"
@str.10 = [66 x i8] c"-----------------------------------------------------------------\00"
@str.11 = [18 x i8] c"Can't create fork\00"
@str.13 = [18 x i8] c"Can't create pipe\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 [4 x i8*]
%7 = alloca [64 x i8]
%8 = bitcast [2 x i32]* %4 to i8*
%9 = bitcast [2 x i32]* %5 to i8*
%10 = bitcast [4 x i8*]* %6 to i8*
%11 = getelementptr inbounds [64 x i8], [64 x i8]* %7, i64 0, i64 0
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%13 = call i64 @pipe(i32* %12)
%14 = icmp slt i64 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %3
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.13, i64 0, i64 0))
%17 = call i32 @exit(i32 -1)
unreachable
18: ; preds = %3
%19 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%20 = call i64 @pipe(i32* %19)
%21 = icmp slt i64 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %18
%23 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.13, i64 0, i64 0))
%24 = call i32 @exit(i32 -1)
unreachable
25: ; preds = %18
%26 = call i32 (...) @fork()
%27 = icmp slt i32 %26, 0
br i1 %27, label %28, label %31
28: ; preds = %25
%29 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.11, i64 0, i64 0))
%30 = call i32 @exit(i32 -1)
unreachable
31: ; preds = %25
%32 = icmp eq i32 %26, 0
br i1 %32, label %58, label %33
33: ; preds = %31
%34 = load i32, i32* %19
%35 = call i32 @close(i32 %34)
%36 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%37 = load i32, i32* %36
%38 = call i32 @close(i32 %37)
%39 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
%40 = getelementptr inbounds [4 x i8*], [4 x i8*]* %6, i64 0, i64 0
%41 = getelementptr inbounds [4 x i8*], [4 x i8*]* %6, i64 0, i64 1
br label %42
42: ; preds = %33, %49
%43 = load i32, i32* %39
%44 = call i64 (i32, ...) @write(i32 %43, i8** %40, i32 64)
br label %45
45: ; preds = %45, %42
%46 = load i32, i32* %12
%47 = call i64 @read(i32 %46, i8* %11, i32 64)
%48 = icmp slt i64 %47, 0
br i1 %48, label %45, label %49
49: ; preds = %45
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i8* %11)
%51 = load i8*, i8** %41
%52 = call i64 @strcmp(i8* %11, i8* %51)
%53 = icmp eq i64 %52, 0
br i1 %53, label %54, label %42
54: ; preds = %49
%55 = load i32, i32* %39
%56 = call i32 @close(i32 %55)
%57 = load i32, i32* %12
br label %87
58: ; preds = %31
%59 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
%60 = load i32, i32* %59
%61 = call i32 @close(i32 %60)
%62 = load i32, i32* %12
%63 = call i32 @close(i32 %62)
%64 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%65 = getelementptr inbounds [4 x i8*], [4 x i8*]* %6, i64 0, i64 3
br label %66
66: ; preds = %58, %72
%67 = phi i64 [ 2, %58 ], [ %81, %72 ]
br label %68
68: ; preds = %66, %68
%69 = load i32, i32* %19
%70 = call i64 @read(i32 %69, i8* %11, i32 64)
%71 = icmp slt i64 %70, 0
br i1 %71, label %68, label %72
72: ; preds = %68
%73 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0), i8* %11)
%74 = load i32, i32* %64
%75 = getelementptr inbounds [4 x i8*], [4 x i8*]* %6, i64 0, i64 %67
%76 = load i8*, i8** %75
%77 = call i64 (i32, ...) @write(i32 %74, i8* %76, i32 64)
%78 = load i8*, i8** %65
%79 = call i64 @strcmp(i8* %11, i8* %78)
%80 = icmp eq i64 %79, 0
%81 = add nuw i64 %67, 1
br i1 %80, label %82, label %66
82: ; preds = %72
%83 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%84 = load i32, i32* %83
%85 = call i32 @close(i32 %84)
%86 = load i32, i32* %19
br label %87
87: ; preds = %54, %82
%88 = phi i32 [ %57, %54 ], [ %86, %82 ]
%89 = phi i8* [ getelementptr inbounds ([66 x i8], [66 x i8]* @str.10, i64 0, i64 0), %54 ], [ getelementptr inbounds ([55 x i8], [55 x i8]* @str, i64 0, i64 0), %82 ]
%90 = call i32 @close(i32 %88)
%91 = call i32 @puts(i8* dereferenceable(1) %89)
%92 = call i32 @exit(i32 0)
unreachable
}