#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 */
struct stat {
  int st_size;
};
typedef int /*<<< orphan*/ buffr3;
typedef int /*<<< orphan*/ buffr2;
typedef int /*<<< orphan*/ buffr1;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int fork();
int getpid();
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ pipe(int *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ read(int, ...);
int /*<<< orphan*/ stat(char *, struct stat *);
int /*<<< orphan*/ waitpid(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ write(int, ...);
int main() {
  int pid1, pid2, p1[2], p2[2], p3[2], p4[2], i, j, buffr3[2], buffr4[2], flag,
      n2 = 0;
  char buffr1[2][30], buffr2[2][30];
  struct stat filestat;
  pipe(p1);
  pipe(p2);
  pipe(p3);
  pipe(p4);
  pid1 = fork();
  switch (pid1) {
  case -1:
    perror("main: fork");
    exit(1);
  case 0:
    read(p1[0], buffr1, sizeof(buffr1));
    printf("In child process (ID: %d)\n", getpid());
    stat(buffr1[0], &filestat);
    buffr3[0] = filestat.st_size;
    write(p3[1], buffr3, sizeof(buffr3));
    exit(1);
    break;
  default:
    pid2 = fork();
    switch (pid2) {
    case -1:
      perror("main: fork");
      exit(1);
    case 0:
      read(p2[0], buffr1, sizeof(buffr1));
      printf("In child process (ID: %d)\n", getpid());
      stat(buffr1[0], &filestat);
      buffr3[0] = filestat.st_size;
      write(p4[1], buffr3, sizeof(buffr3));
      exit(1);
      break;
    default:
      printf("In parent process (ID: %d)\n", getpid());
      printf("\nEnter the files \n");
      gets(buffr1[0]);
      gets(buffr2[0]);
      write(p1[1], buffr1, sizeof(buffr1));
      write(p2[1], buffr2, sizeof(buffr2));
      waitpid(pid1, NULL, 0);
      waitpid(pid2, NULL, 0);
      read(p3[0], buffr3, sizeof(buffr3));
      read(p4[0], buffr4, sizeof(buffr3));
      if (buffr3[0] > buffr4[0])
        printf("\n%s is larger than %s\n", buffr1[0], buffr2[0]);
      else
        printf("\n%s is larger than %s\n", buffr2[0], buffr1[0]);
      break;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x4c(%rbp)
lea    -0x14(%rbp),%rdi
call   1060 <pipe@plt>
lea    -0x1c(%rbp),%rdi
call   1060 <pipe@plt>
lea    -0x24(%rbp),%rdi
call   1060 <pipe@plt>
lea    -0x2c(%rbp),%rdi
call   1060 <pipe@plt>
xor    %eax,%eax
call   10d0 <fork@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xdc(%rbp)
sub    $0xffffffff,%eax
je     1221 <main+0x71>
jmp    120e <main+0x5e>
mov    -0xdc(%rbp),%eax
test   %eax,%eax
je     1237 <main+0x87>
jmp    129d <main+0xed>
lea    0xdd8(%rip),%rdi
call   10b0 <perror@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    -0x14(%rbp),%edi
lea    -0x90(%rbp),%rsi
mov    $0x3c,%edx
mov    $0x0,%al
call   1070 <read@plt>
mov    $0x0,%al
call   1040 <getpid@plt>
mov    %eax,%esi
lea    0xdae(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x90(%rbp),%rdi
lea    -0xd8(%rbp),%rsi
call   1080 <stat@plt>
mov    -0xd8(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x20(%rbp),%edi
lea    -0x3c(%rbp),%rsi
mov    $0x8,%edx
mov    $0x0,%al
call   1030 <write@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
xor    %eax,%eax
call   10d0 <fork@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0xe0(%rbp)
sub    $0xffffffff,%eax
je     12d1 <main+0x121>
jmp    12be <main+0x10e>
mov    -0xe0(%rbp),%eax
test   %eax,%eax
je     12e7 <main+0x137>
jmp    134d <main+0x19d>
lea    0xd28(%rip),%rdi
call   10b0 <perror@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    -0x1c(%rbp),%edi
lea    -0x90(%rbp),%rsi
mov    $0x3c,%edx
mov    $0x0,%al
call   1070 <read@plt>
mov    $0x0,%al
call   1040 <getpid@plt>
mov    %eax,%esi
lea    0xcfe(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x90(%rbp),%rdi
lea    -0xd8(%rbp),%rsi
call   1080 <stat@plt>
mov    -0xd8(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x28(%rbp),%edi
lea    -0x3c(%rbp),%rsi
mov    $0x8,%edx
mov    $0x0,%al
call   1030 <write@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    $0x0,%al
call   1040 <getpid@plt>
mov    %eax,%esi
lea    0xcc9(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xcd7(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x90(%rbp),%rdi
call   1090 <gets@plt>
lea    -0xd0(%rbp),%rdi
call   1090 <gets@plt>
mov    -0x10(%rbp),%edi
lea    -0x90(%rbp),%rsi
mov    $0x3c,%edx
mov    $0x0,%al
call   1030 <write@plt>
mov    -0x18(%rbp),%edi
lea    -0xd0(%rbp),%rsi
mov    $0x3c,%edx
mov    $0x0,%al
call   1030 <write@plt>
mov    -0x8(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   10a0 <waitpid@plt>
mov    -0xc(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   10a0 <waitpid@plt>
mov    -0x24(%rbp),%edi
lea    -0x3c(%rbp),%rsi
mov    $0x8,%edx
mov    $0x0,%al
call   1070 <read@plt>
mov    -0x2c(%rbp),%edi
lea    -0x44(%rbp),%rsi
mov    $0x8,%edx
mov    $0x0,%al
call   1070 <read@plt>
mov    -0x3c(%rbp),%eax
cmp    -0x44(%rbp),%eax
jle    1425 <main+0x275>
lea    -0x90(%rbp),%rsi
lea    -0xd0(%rbp),%rdx
lea    0xc3c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1441 <main+0x291>
lea    -0xd0(%rbp),%rsi
lea    -0x90(%rbp),%rdx
lea    0xc1b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1446 <main+0x296>
jmp    144b <main+0x29b>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0xb8,%rsp
lea    0x20(%rsp),%rdi
call   1070 <pipe@plt>
lea    0x18(%rsp),%rdi
call   1070 <pipe@plt>
lea    0x10(%rsp),%rdi
call   1070 <pipe@plt>
lea    0x8(%rsp),%rdi
call   1070 <pipe@plt>
xor    %eax,%eax
call   10e0 <fork@plt>
test   %eax,%eax
je     1324 <main+0x164>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
je     130e <main+0x14e>
xor    %eax,%eax
call   10e0 <fork@plt>
test   %eax,%eax
je     136d <main+0x1ad>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
je     130e <main+0x14e>
xor    %eax,%eax
call   1050 <getpid@plt>
lea    0xdef(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe12(%rip),%rdi
call   1030 <puts@plt>
lea    0x70(%rsp),%r14
mov    %r14,%rdi
call   10a0 <gets@plt>
lea    0x30(%rsp),%r15
mov    %r15,%rdi
call   10a0 <gets@plt>
mov    0x24(%rsp),%edi
mov    $0x3c,%edx
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <write@plt>
mov    0x1c(%rsp),%edi
mov    $0x3c,%edx
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <write@plt>
mov    %ebx,%edi
xor    %esi,%esi
xor    %edx,%edx
call   10b0 <waitpid@plt>
mov    %ebp,%edi
xor    %esi,%esi
xor    %edx,%edx
call   10b0 <waitpid@plt>
mov    0x10(%rsp),%edi
mov    %rsp,%rsi
mov    $0x8,%edx
xor    %eax,%eax
call   1080 <read@plt>
mov    0x8(%rsp),%edi
lea    0x28(%rsp),%rsi
mov    $0x8,%edx
xor    %eax,%eax
call   1080 <read@plt>
mov    (%rsp),%eax
cmp    0x28(%rsp),%eax
jle    12e6 <main+0x126>
lea    0xd68(%rip),%rdi
lea    0x70(%rsp),%rsi
lea    0x30(%rsp),%rdx
jmp    12f7 <main+0x137>
lea    0xd55(%rip),%rdi
lea    0x30(%rsp),%rsi
lea    0x70(%rsp),%rdx
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
add    $0xb8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xceb(%rip),%rdi
call   10c0 <perror@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    0x20(%rsp),%edi
lea    0x70(%rsp),%rbx
mov    $0x3c,%edx
mov    %rbx,%rsi
xor    %eax,%eax
call   1080 <read@plt>
xor    %eax,%eax
call   1050 <getpid@plt>
lea    0xcc1(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0x30(%rsp),%rsi
mov    %rbx,%rdi
call   1090 <stat@plt>
mov    0x30(%rsp),%eax
mov    %eax,(%rsp)
mov    0x14(%rsp),%edi
jmp    13b4 <main+0x1f4>
mov    0x18(%rsp),%edi
lea    0x70(%rsp),%rbx
mov    $0x3c,%edx
mov    %rbx,%rsi
xor    %eax,%eax
call   1080 <read@plt>
xor    %eax,%eax
call   1050 <getpid@plt>
lea    0xc78(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0x30(%rsp),%rsi
mov    %rbx,%rdi
call   1090 <stat@plt>
mov    0x30(%rsp),%eax
mov    %eax,(%rsp)
mov    0xc(%rsp),%edi
mov    %rsp,%rsi
mov    $0x8,%edx
xor    %eax,%eax
call   1040 <write@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [11 x i8] c"main: fork\00"
@.str.1 = [27 x i8] c"In child process (ID: %d)\0A\00"
@.str.2 = [28 x i8] c"In parent process (ID: %d)\0A\00"
@.str.3 = [19 x i8] c"\0AEnter the files \0A\00"
@.str.4 = [23 x i8] c"\0A%s is larger than %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [2 x i32]
%5 = alloca [2 x i32]
%6 = alloca [2 x i32]
%7 = alloca [2 x i32]
%8 = alloca i32
%9 = alloca i32
%10 = alloca [2 x i32]
%11 = alloca [2 x i32]
%12 = alloca i32
%13 = alloca i32
%14 = alloca [2 x [30 x i8]]
%15 = alloca [2 x [30 x i8]]
%16 = alloca %struct.stat
store i32 0, i32* %1
store i32 0, i32* %13
%17 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%18 = call i32 @pipe(i32* %17)
%19 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%20 = call i32 @pipe(i32* %19)
%21 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%22 = call i32 @pipe(i32* %21)
%23 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%24 = call i32 @pipe(i32* %23)
%25 = call i32 (...) @fork()
store i32 %25, i32* %2
%26 = load i32, i32* %2
switch i32 %26, label %48 [
i32 -1, label %27
i32 0, label %30
]
27: ; preds = %0
%28 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%29 = call i32 @exit(i32 1)
unreachable
30: ; preds = %0
%31 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%32 = load i32, i32* %31
%33 = getelementptr inbounds [2 x [30 x i8]], [2 x [30 x i8]]* %14, i64 0, i64 0
%34 = call i32 (i32, ...) @read(i32 %32, [30 x i8]* %33, i64 60)
%35 = call i32 (...) @getpid()
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %35)
%37 = getelementptr inbounds [2 x [30 x i8]], [2 x [30 x i8]]* %14, i64 0, i64 0
%38 = getelementptr inbounds [30 x i8], [30 x i8]* %37, i64 0, i64 0
%39 = call i32 @stat(i8* %38, %struct.stat* %16)
%40 = getelementptr inbounds %struct.stat, %struct.stat* %16, i32 0, i32 0
%41 = load i32, i32* %40
%42 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 0
store i32 %41, i32* %42
%43 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%44 = load i32, i32* %43
%45 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 0
%46 = call i32 (i32, ...) @write(i32 %44, i32* %45, i64 8)
%47 = call i32 @exit(i32 1)
unreachable
48: ; preds = %0
%49 = call i32 (...) @fork()
store i32 %49, i32* %3
%50 = load i32, i32* %3
switch i32 %50, label %72 [
i32 -1, label %51
i32 0, label %54
]
51: ; preds = %48
%52 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%53 = call i32 @exit(i32 1)
unreachable
54: ; preds = %48
%55 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%56 = load i32, i32* %55
%57 = getelementptr inbounds [2 x [30 x i8]], [2 x [30 x i8]]* %14, i64 0, i64 0
%58 = call i32 (i32, ...) @read(i32 %56, [30 x i8]* %57, i64 60)
%59 = call i32 (...) @getpid()
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %59)
%61 = getelementptr inbounds [2 x [30 x i8]], [2 x [30 x i8]]* %14, i64 0, i64 0
%62 = getelementptr inbounds [30 x i8], [30 x i8]* %61, i64 0, i64 0
%63 = call i32 @stat(i8* %62, %struct.stat* %16)
%64 = getelementptr inbounds %struct.stat, %struct.stat* %16, i32 0, i32 0
%65 = load i32, i32* %64
%66 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 0
store i32 %65, i32* %66
%67 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
%68 = load i32, i32* %67
%69 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 0
%70 = call i32 (i32, ...) @write(i32 %68, i32* %69, i64 8)
%71 = call i32 @exit(i32 1)
unreachable
72: ; preds = %48
%73 = call i32 (...) @getpid()
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 %73)
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%76 = getelementptr inbounds [2 x [30 x i8]], [2 x [30 x i8]]* %14, i64 0, i64 0
%77 = getelementptr inbounds [30 x i8], [30 x i8]* %76, i64 0, i64 0
%78 = call i32 @gets(i8* %77)
%79 = getelementptr inbounds [2 x [30 x i8]], [2 x [30 x i8]]* %15, i64 0, i64 0
%80 = getelementptr inbounds [30 x i8], [30 x i8]* %79, i64 0, i64 0
%81 = call i32 @gets(i8* %80)
%82 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%83 = load i32, i32* %82
%84 = getelementptr inbounds [2 x [30 x i8]], [2 x [30 x i8]]* %14, i64 0, i64 0
%85 = call i32 (i32, ...) @write(i32 %83, [30 x i8]* %84, i64 60)
%86 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
%87 = load i32, i32* %86
%88 = getelementptr inbounds [2 x [30 x i8]], [2 x [30 x i8]]* %15, i64 0, i64 0
%89 = call i32 (i32, ...) @write(i32 %87, [30 x i8]* %88, i64 60)
%90 = load i32, i32* %2
%91 = call i32 @waitpid(i32 %90, i32* null, i32 0)
%92 = load i32, i32* %3
%93 = call i32 @waitpid(i32 %92, i32* null, i32 0)
%94 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%95 = load i32, i32* %94
%96 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 0
%97 = call i32 (i32, ...) @read(i32 %95, i32* %96, i64 8)
%98 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%99 = load i32, i32* %98
%100 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 0
%101 = call i32 (i32, ...) @read(i32 %99, i32* %100, i64 8)
%102 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 0
%103 = load i32, i32* %102
%104 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 0
%105 = load i32, i32* %104
%106 = icmp sgt i32 %103, %105
br i1 %106, label %107, label %113
107: ; preds = %72
%108 = getelementptr inbounds [2 x [30 x i8]], [2 x [30 x i8]]* %14, i64 0, i64 0
%109 = getelementptr inbounds [30 x i8], [30 x i8]* %108, i64 0, i64 0
%110 = getelementptr inbounds [2 x [30 x i8]], [2 x [30 x i8]]* %15, i64 0, i64 0
%111 = getelementptr inbounds [30 x i8], [30 x i8]* %110, i64 0, i64 0
%112 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i8* %109, i8* %111)
br label %119
113: ; preds = %72
%114 = getelementptr inbounds [2 x [30 x i8]], [2 x [30 x i8]]* %15, i64 0, i64 0
%115 = getelementptr inbounds [30 x i8], [30 x i8]* %114, i64 0, i64 0
%116 = getelementptr inbounds [2 x [30 x i8]], [2 x [30 x i8]]* %14, i64 0, i64 0
%117 = getelementptr inbounds [30 x i8], [30 x i8]* %116, i64 0, i64 0
%118 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i8* %115, i8* %117)
br label %119
119: ; preds = %113, %107
br label %120
120: ; preds = %119
br label %121
121: ; preds = %120
ret i32 0
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [11 x i8] c"main: fork\00"
@.str.1 = [27 x i8] c"In child process (ID: %d)\0A\00"
@.str.2 = [28 x i8] c"In parent process (ID: %d)\0A\00"
@.str.4 = [23 x i8] c"\0A%s is larger than %s\0A\00"
@str = [18 x i8] c"\0AEnter the files \00"
define i32 @main() {
%1 = alloca [2 x i32]
%2 = alloca [2 x i32]
%3 = alloca [2 x i32]
%4 = alloca [2 x i32]
%5 = alloca [2 x i32]
%6 = alloca [2 x i32]
%7 = alloca [2 x [30 x i8]]
%8 = alloca [2 x [30 x i8]]
%9 = alloca %struct.stat
%10 = bitcast [2 x i32]* %1 to i8*
%11 = bitcast [2 x i32]* %2 to i8*
%12 = bitcast [2 x i32]* %3 to i8*
%13 = bitcast [2 x i32]* %4 to i8*
%14 = bitcast [2 x i32]* %5 to i8*
%15 = bitcast [2 x i32]* %6 to i8*
%16 = getelementptr inbounds [2 x [30 x i8]], [2 x [30 x i8]]* %7, i64 0, i64 0, i64 0
%17 = getelementptr inbounds [2 x [30 x i8]], [2 x [30 x i8]]* %8, i64 0, i64 0, i64 0
%18 = bitcast %struct.stat* %9 to i8*
%19 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%20 = call i32 @pipe(i32* %19)
%21 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%22 = call i32 @pipe(i32* %21)
%23 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%24 = call i32 @pipe(i32* %23)
%25 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%26 = call i32 @pipe(i32* %25)
%27 = call i32 (...) @fork()
switch i32 %27, label %45 [
i32 -1, label %28
i32 0, label %31
]
28: ; preds = %0
%29 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%30 = call i32 @exit(i32 1)
unreachable
31: ; preds = %0
%32 = load i32, i32* %19
%33 = getelementptr inbounds [2 x [30 x i8]], [2 x [30 x i8]]* %7, i64 0, i64 0
%34 = call i32 (i32, ...) @read(i32 %32, [30 x i8]* %33, i64 60)
%35 = call i32 (...) @getpid()
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %35)
%37 = call i32 @stat(i8* %16, %struct.stat* %9)
%38 = getelementptr inbounds %struct.stat, %struct.stat* %9, i64 0, i32 0
%39 = load i32, i32* %38
%40 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
store i32 %39, i32* %40
%41 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
%42 = load i32, i32* %41
%43 = call i32 (i32, ...) @write(i32 %42, i32* %40, i64 8)
%44 = call i32 @exit(i32 1)
unreachable
45: ; preds = %0
%46 = call i32 (...) @fork()
switch i32 %46, label %64 [
i32 -1, label %47
i32 0, label %50
]
47: ; preds = %45
%48 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%49 = call i32 @exit(i32 1)
unreachable
50: ; preds = %45
%51 = load i32, i32* %21
%52 = getelementptr inbounds [2 x [30 x i8]], [2 x [30 x i8]]* %7, i64 0, i64 0
%53 = call i32 (i32, ...) @read(i32 %51, [30 x i8]* %52, i64 60)
%54 = call i32 (...) @getpid()
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %54)
%56 = call i32 @stat(i8* %16, %struct.stat* %9)
%57 = getelementptr inbounds %struct.stat, %struct.stat* %9, i64 0, i32 0
%58 = load i32, i32* %57
%59 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
store i32 %58, i32* %59
%60 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%61 = load i32, i32* %60
%62 = call i32 (i32, ...) @write(i32 %61, i32* %59, i64 8)
%63 = call i32 @exit(i32 1)
unreachable
64: ; preds = %45
%65 = call i32 (...) @getpid()
%66 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 %65)
%67 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%68 = getelementptr inbounds [2 x [30 x i8]], [2 x [30 x i8]]* %7, i64 0, i64 0
%69 = call i32 @gets(i8* %16)
%70 = getelementptr inbounds [2 x [30 x i8]], [2 x [30 x i8]]* %8, i64 0, i64 0
%71 = call i32 @gets(i8* %17)
%72 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 1
%73 = load i32, i32* %72
%74 = call i32 (i32, ...) @write(i32 %73, [30 x i8]* %68, i64 60)
%75 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
%76 = load i32, i32* %75
%77 = call i32 (i32, ...) @write(i32 %76, [30 x i8]* %70, i64 60)
%78 = call i32 @waitpid(i32 %27, i32* null, i32 0)
%79 = call i32 @waitpid(i32 %46, i32* null, i32 0)
%80 = load i32, i32* %23
%81 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%82 = call i32 (i32, ...) @read(i32 %80, i32* %81, i64 8)
%83 = load i32, i32* %25
%84 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%85 = call i32 (i32, ...) @read(i32 %83, i32* %84, i64 8)
%86 = load i32, i32* %81
%87 = load i32, i32* %84
%88 = icmp sgt i32 %86, %87
br i1 %88, label %89, label %91
89: ; preds = %64
%90 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i8* %16, i8* %17)
br label %93
91: ; preds = %64
%92 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i8* %17, i8* %16)
br label %93
93: ; preds = %91, %89
ret i32 0
}