#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 EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
scalar_t__ fork();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int pipe(int *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ read(int, char *, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdin;
scalar_t__ strlen(char *);
char *toggleString(char *);
int /*<<< orphan*/ wait(int /*<<< orphan*/ *);
int /*<<< orphan*/ write(int, char *, scalar_t__);
int main(int argc, char const *argv[]) {
  pid_t pid;
  fprintf(stderr, "Enter A string to be reversed\n");
  char string[512];
  fgets(string, sizeof string, stdin);
  int fd1[2];
  int fd2[2];
  if (pipe(fd1) == -1) {
    fprintf(stderr, "Failed to Make Pipe 1\n");
    exit(EXIT_FAILURE);
  }
  if (pipe(fd2) == -1) {
    fprintf(stderr, "Failed to Make Pipe 2\n");
    exit(EXIT_FAILURE);
  }
  pid = fork();
  if (pid < 0) {
    fprintf(stderr, "Error while forking\n");
    exit(EXIT_FAILURE);
  }
  if (pid == 0) {
    char *child = (char *)malloc(sizeof(char *));
    close(fd1[1]);
    read(fd1[0], child, 512);
    printf("Recieved from parent: %s\n", child);
    char *child2 = (char *)malloc(sizeof(char *));
    child2 = toggleString(child);
    printf("Now sending to parent: %s\n", child2);
    write(fd2[1], child2, strlen(child2) + 1);
    close(fd2[1]);
    close(fd1[0]);
    close(fd2[0]);
    close(fd1[1]);
    free(child);
    exit(EXIT_SUCCESS);
  }
  printf("\nNow sending to child: %s\n", string);
  char *parent = (char *)malloc(sizeof(char *));
  write(fd1[1], string, strlen(string));
  wait(NULL);
  read(fd2[0], parent, 512);
  printf("Recieved from child: %s\n", parent);
  close(fd1[0]);
  close(fd1[1]);
  close(fd2[1]);
  close(fd2[0]);
  free(parent);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x270,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2dd8(%rip),%rax
mov    (%rax),%edi
lea    0xdf7(%rip),%rsi
call   10c0 <fprintf@plt>
lea    -0x220(%rbp),%rdi
mov    0x2dcc(%rip),%rax
mov    (%rax),%edx
mov    $0x200,%esi
call   10b0 <fgets@plt>
lea    -0x228(%rbp),%rdi
call   1090 <pipe@plt>
cmp    $0xffffffff,%eax
jne    1260 <main+0x80>
mov    0x2d94(%rip),%rax
mov    (%rax),%edi
lea    0xdd2(%rip),%rsi
call   10c0 <fprintf@plt>
mov    0x2d77(%rip),%rax
mov    (%rax),%edi
call   10e0 <exit@plt>
lea    -0x230(%rbp),%rdi
call   1090 <pipe@plt>
cmp    $0xffffffff,%eax
jne    1298 <main+0xb8>
mov    0x2d5c(%rip),%rax
mov    (%rax),%edi
lea    0xdb1(%rip),%rsi
call   10c0 <fprintf@plt>
mov    0x2d3f(%rip),%rax
mov    (%rax),%edi
call   10e0 <exit@plt>
mov    $0x0,%al
call   1100 <fork@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jge    12d1 <main+0xf1>
mov    0x2d23(%rip),%rax
mov    (%rax),%edi
lea    0xd8f(%rip),%rsi
call   10c0 <fprintf@plt>
mov    0x2d06(%rip),%rax
mov    (%rax),%edi
call   10e0 <exit@plt>
cmpq   $0x0,-0x18(%rbp)
jne    13de <main+0x1fe>
mov    $0x8,%edi
call   10d0 <malloc@plt>
mov    %rax,-0x238(%rbp)
mov    -0x224(%rbp),%edi
call   1080 <close@plt>
mov    -0x228(%rbp),%edi
mov    -0x238(%rbp),%rsi
mov    $0x200,%edx
call   10a0 <read@plt>
mov    -0x238(%rbp),%rsi
lea    0xd45(%rip),%rdi
call   1070 <printf@plt>
mov    $0x8,%edi
call   10d0 <malloc@plt>
mov    %rax,-0x240(%rbp)
mov    -0x238(%rbp),%rdi
call   1050 <toggleString@plt>
mov    %rax,-0x240(%rbp)
mov    -0x240(%rbp),%rsi
lea    0xd28(%rip),%rdi
call   1070 <printf@plt>
mov    -0x22c(%rbp),%eax
mov    %eax,-0x254(%rbp)
mov    -0x240(%rbp),%rax
mov    %rax,-0x250(%rbp)
mov    -0x240(%rbp),%rdi
call   1060 <strlen@plt>
mov    -0x254(%rbp),%edi
mov    -0x250(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1040 <write@plt>
mov    -0x22c(%rbp),%edi
call   1080 <close@plt>
mov    -0x228(%rbp),%edi
call   1080 <close@plt>
mov    -0x230(%rbp),%edi
call   1080 <close@plt>
mov    -0x224(%rbp),%edi
call   1080 <close@plt>
mov    -0x238(%rbp),%rdi
call   1030 <free@plt>
mov    0x2bf1(%rip),%rax
mov    (%rax),%edi
call   10e0 <exit@plt>
lea    -0x220(%rbp),%rsi
lea    0xcab(%rip),%rdi
call   1070 <printf@plt>
mov    $0x8,%edi
call   10d0 <malloc@plt>
mov    %rax,-0x248(%rbp)
mov    -0x224(%rbp),%eax
mov    %eax,-0x264(%rbp)
lea    -0x220(%rbp),%rax
mov    %rax,-0x260(%rbp)
lea    -0x220(%rbp),%rdi
call   1060 <strlen@plt>
mov    -0x264(%rbp),%edi
mov    -0x260(%rbp),%rsi
mov    %rax,%rdx
call   1040 <write@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10f0 <wait@plt>
mov    -0x230(%rbp),%edi
mov    -0x248(%rbp),%rsi
mov    $0x200,%edx
call   10a0 <read@plt>
mov    -0x248(%rbp),%rsi
lea    0xc47(%rip),%rdi
call   1070 <printf@plt>
mov    -0x228(%rbp),%edi
call   1080 <close@plt>
mov    -0x224(%rbp),%edi
call   1080 <close@plt>
mov    -0x22c(%rbp),%edi
call   1080 <close@plt>
mov    -0x230(%rbp),%edi
call   1080 <close@plt>
mov    -0x248(%rbp),%rdi
call   1030 <free@plt>
mov    0x2b19(%rip),%rax
mov    (%rax),%eax
add    $0x270,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x210,%rsp
mov    0x2de6(%rip),%rbx
mov    (%rbx),%edi
lea    0xe05(%rip),%rsi
call   10c0 <fprintf@plt>
mov    0x2de1(%rip),%rax
mov    (%rax),%edx
lea    0x10(%rsp),%rdi
mov    $0x200,%esi
call   10b0 <fgets@plt>
mov    %rsp,%rdi
call   1090 <pipe@plt>
cmp    $0xffffffff,%eax
je     12f3 <main+0x113>
lea    0x8(%rsp),%rdi
call   1090 <pipe@plt>
cmp    $0xffffffff,%eax
je     12fe <main+0x11e>
xor    %eax,%eax
call   1100 <fork@plt>
test   %rax,%rax
js     1309 <main+0x129>
je     1325 <main+0x145>
lea    0xe3e(%rip),%rdi
lea    0x10(%rsp),%r14
mov    %r14,%rsi
call   1070 <printf@plt>
mov    $0x8,%edi
call   10d0 <malloc@plt>
mov    %rax,%rbx
mov    0x4(%rsp),%ebp
mov    %r14,%rdi
call   1060 <strlen@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    %rax,%rdx
call   1040 <write@plt>
xor    %edi,%edi
call   10f0 <wait@plt>
mov    0x8(%rsp),%edi
mov    %rbx,%rsi
mov    $0x200,%edx
call   10a0 <read@plt>
lea    0xe07(%rip),%rdi
mov    %rbx,%rsi
call   1070 <printf@plt>
mov    (%rsp),%edi
call   1080 <close@plt>
mov    0x4(%rsp),%edi
call   1080 <close@plt>
mov    0xc(%rsp),%edi
call   1080 <close@plt>
mov    0x8(%rsp),%edi
call   1080 <close@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    0x2ce3(%rip),%rax
mov    (%rax),%eax
add    $0x210,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    (%rbx),%edi
lea    0xd23(%rip),%rsi
jmp    1312 <main+0x132>
mov    (%rbx),%edi
lea    0xd2f(%rip),%rsi
jmp    1312 <main+0x132>
mov    (%rbx),%edi
lea    0xd3b(%rip),%rsi
call   10c0 <fprintf@plt>
mov    0x2cb2(%rip),%rax
mov    (%rax),%edi
call   10e0 <exit@plt>
mov    $0x8,%edi
call   10d0 <malloc@plt>
mov    %rax,%r14
mov    0x4(%rsp),%edi
call   1080 <close@plt>
mov    (%rsp),%edi
mov    %r14,%rsi
mov    $0x200,%edx
call   10a0 <read@plt>
lea    0xd10(%rip),%rdi
mov    %r14,%rsi
call   1070 <printf@plt>
mov    $0x8,%edi
call   10d0 <malloc@plt>
mov    %r14,%rdi
call   1050 <toggleString@plt>
mov    %rax,%rbx
lea    0xd06(%rip),%rdi
mov    %rax,%rsi
call   1070 <printf@plt>
mov    0xc(%rsp),%ebp
mov    %rbx,%rdi
call   1060 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <write@plt>
mov    0xc(%rsp),%edi
call   1080 <close@plt>
mov    (%rsp),%edi
call   1080 <close@plt>
mov    0x8(%rsp),%edi
call   1080 <close@plt>
mov    0x4(%rsp),%edi
call   1080 <close@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    0x2bfe(%rip),%rax
mov    (%rax),%edi
call   10e0 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"Enter A string to be reversed\0A\00"
@stdin = global i32 0
@.str.1 = [23 x i8] c"Failed to Make Pipe 1\0A\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [23 x i8] c"Failed to Make Pipe 2\0A\00"
@.str.3 = [21 x i8] c"Error while forking\0A\00"
@.str.4 = [26 x i8] c"Recieved from parent: %s\0A\00"
@.str.5 = [27 x i8] c"Now sending to parent: %s\0A\00"
@EXIT_SUCCESS = global i32 0
@.str.6 = [27 x i8] c"\0ANow sending to child: %s\0A\00"
@.str.7 = [25 x i8] c"Recieved from child: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca [512 x i8]
%8 = alloca [2 x i32]
%9 = alloca [2 x i32]
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = load i32, i32* @stderr
%14 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%15 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%16 = load i32, i32* @stdin
%17 = call i32 @fgets(i8* %15, i32 512, i32 %16)
%18 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%19 = call i32 @pipe(i32* %18)
%20 = icmp eq i32 %19, -1
br i1 %20, label %21, label %26
21: ; preds = %2
%22 = load i32, i32* @stderr
%23 = call i32 @fprintf(i32 %22, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%24 = load i32, i32* @EXIT_FAILURE
%25 = call i32 @exit(i32 %24)
unreachable
26: ; preds = %2
%27 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%28 = call i32 @pipe(i32* %27)
%29 = icmp eq i32 %28, -1
br i1 %29, label %30, label %35
30: ; preds = %26
%31 = load i32, i32* @stderr
%32 = call i32 @fprintf(i32 %31, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%33 = load i32, i32* @EXIT_FAILURE
%34 = call i32 @exit(i32 %33)
unreachable
35: ; preds = %26
%36 = call i64 (...) @fork()
store i64 %36, i64* %6
%37 = load i64, i64* %6
%38 = icmp slt i64 %37, 0
br i1 %38, label %39, label %44
39: ; preds = %35
%40 = load i32, i32* @stderr
%41 = call i32 @fprintf(i32 %40, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%42 = load i32, i32* @EXIT_FAILURE
%43 = call i32 @exit(i32 %42)
unreachable
44: ; preds = %35
%45 = load i64, i64* %6
%46 = icmp eq i64 %45, 0
br i1 %46, label %47, label %88
47: ; preds = %44
%48 = call i64 @malloc(i32 8)
%49 = inttoptr i64 %48 to i8*
store i8* %49, i8** %10
%50 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
%51 = load i32, i32* %50
%52 = call i32 @close(i32 %51)
%53 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%54 = load i32, i32* %53
%55 = load i8*, i8** %10
%56 = call i32 @read(i32 %54, i8* %55, i32 512)
%57 = load i8*, i8** %10
%58 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i8* %57)
%59 = call i64 @malloc(i32 8)
%60 = inttoptr i64 %59 to i8*
store i8* %60, i8** %11
%61 = load i8*, i8** %10
%62 = call i8* @toggleString(i8* %61)
store i8* %62, i8** %11
%63 = load i8*, i8** %11
%64 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i8* %63)
%65 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
%66 = load i32, i32* %65
%67 = load i8*, i8** %11
%68 = load i8*, i8** %11
%69 = call i64 @strlen(i8* %68)
%70 = add nsw i64 %69, 1
%71 = call i32 @write(i32 %66, i8* %67, i64 %70)
%72 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
%73 = load i32, i32* %72
%74 = call i32 @close(i32 %73)
%75 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%76 = load i32, i32* %75
%77 = call i32 @close(i32 %76)
%78 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%79 = load i32, i32* %78
%80 = call i32 @close(i32 %79)
%81 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
%82 = load i32, i32* %81
%83 = call i32 @close(i32 %82)
%84 = load i8*, i8** %10
%85 = call i32 @free(i8* %84)
%86 = load i32, i32* @EXIT_SUCCESS
%87 = call i32 @exit(i32 %86)
unreachable
88: ; preds = %44
%89 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%90 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0), i8* %89)
%91 = call i64 @malloc(i32 8)
%92 = inttoptr i64 %91 to i8*
store i8* %92, i8** %12
%93 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
%94 = load i32, i32* %93
%95 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%96 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%97 = call i64 @strlen(i8* %96)
%98 = call i32 @write(i32 %94, i8* %95, i64 %97)
%99 = call i32 @wait(i32* null)
%100 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%101 = load i32, i32* %100
%102 = load i8*, i8** %12
%103 = call i32 @read(i32 %101, i8* %102, i32 512)
%104 = load i8*, i8** %12
%105 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0), i8* %104)
%106 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%107 = load i32, i32* %106
%108 = call i32 @close(i32 %107)
%109 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
%110 = load i32, i32* %109
%111 = call i32 @close(i32 %110)
%112 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
%113 = load i32, i32* %112
%114 = call i32 @close(i32 %113)
%115 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%116 = load i32, i32* %115
%117 = call i32 @close(i32 %116)
%118 = load i8*, i8** %12
%119 = call i32 @free(i8* %118)
%120 = load i32, i32* @EXIT_SUCCESS
ret i32 %120
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"Enter A string to be reversed\0A\00"
@stdin = global i32 0
@.str.1 = [23 x i8] c"Failed to Make Pipe 1\0A\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [23 x i8] c"Failed to Make Pipe 2\0A\00"
@.str.3 = [21 x i8] c"Error while forking\0A\00"
@.str.4 = [26 x i8] c"Recieved from parent: %s\0A\00"
@.str.5 = [27 x i8] c"Now sending to parent: %s\0A\00"
@EXIT_SUCCESS = global i32 0
@.str.6 = [27 x i8] c"\0ANow sending to child: %s\0A\00"
@.str.7 = [25 x i8] c"Recieved from child: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [512 x i8]
%4 = alloca [2 x i32]
%5 = alloca [2 x i32]
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%9 = load i32, i32* @stdin
%10 = call i32 @fgets(i8* %8, i32 512, i32 %9)
%11 = bitcast [2 x i32]* %4 to i8*
%12 = bitcast [2 x i32]* %5 to i8*
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%14 = call i32 @pipe(i32* %13)
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %21
16: ; preds = %2
%17 = load i32, i32* @stderr
%18 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%19 = load i32, i32* @EXIT_FAILURE
%20 = call i32 @exit(i32 %19)
unreachable
21: ; preds = %2
%22 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%23 = call i32 @pipe(i32* %22)
%24 = icmp eq i32 %23, -1
br i1 %24, label %25, label %30
25: ; preds = %21
%26 = load i32, i32* @stderr
%27 = call i32 @fprintf(i32 %26, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%28 = load i32, i32* @EXIT_FAILURE
%29 = call i32 @exit(i32 %28)
unreachable
30: ; preds = %21
%31 = call i64 (...) @fork()
%32 = icmp slt i64 %31, 0
br i1 %32, label %33, label %38
33: ; preds = %30
%34 = load i32, i32* @stderr
%35 = call i32 @fprintf(i32 %34, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%36 = load i32, i32* @EXIT_FAILURE
%37 = call i32 @exit(i32 %36)
unreachable
38: ; preds = %30
%39 = icmp eq i64 %31, 0
br i1 %39, label %40, label %68
40: ; preds = %38
%41 = call i64 @malloc(i32 8)
%42 = inttoptr i64 %41 to i8*
%43 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%44 = load i32, i32* %43
%45 = call i32 @close(i32 %44)
%46 = load i32, i32* %13
%47 = call i32 @read(i32 %46, i8* %42, i32 512)
%48 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i8* %42)
%49 = call i64 @malloc(i32 8)
%50 = call i8* @toggleString(i8* %42)
%51 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i8* %50)
%52 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
%53 = load i32, i32* %52
%54 = call i64 @strlen(i8* dereferenceable(1) %50)
%55 = add nsw i64 %54, 1
%56 = call i32 @write(i32 %53, i8* %50, i64 %55)
%57 = load i32, i32* %52
%58 = call i32 @close(i32 %57)
%59 = load i32, i32* %13
%60 = call i32 @close(i32 %59)
%61 = load i32, i32* %22
%62 = call i32 @close(i32 %61)
%63 = load i32, i32* %43
%64 = call i32 @close(i32 %63)
%65 = call i32 @free(i8* %42)
%66 = load i32, i32* @EXIT_SUCCESS
%67 = call i32 @exit(i32 %66)
unreachable
68: ; preds = %38
%69 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0), i8* %8)
%70 = call i64 @malloc(i32 8)
%71 = inttoptr i64 %70 to i8*
%72 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%73 = load i32, i32* %72
%74 = call i64 @strlen(i8* %8)
%75 = call i32 @write(i32 %73, i8* %8, i64 %74)
%76 = call i32 @wait(i32* null)
%77 = load i32, i32* %22
%78 = call i32 @read(i32 %77, i8* %71, i32 512)
%79 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0), i8* %71)
%80 = load i32, i32* %13
%81 = call i32 @close(i32 %80)
%82 = load i32, i32* %72
%83 = call i32 @close(i32 %82)
%84 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
%85 = load i32, i32* %84
%86 = call i32 @close(i32 %85)
%87 = load i32, i32* %22
%88 = call i32 @close(i32 %87)
%89 = call i32 @free(i8* %71)
%90 = load i32, i32* @EXIT_SUCCESS
ret i32 %90
}