#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 EXIT_SUCCESS;
int atoi(char *);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int fork();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ pipe(int *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ read(int, char **, int);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int pid, tunel[2], tunel2[2], numero;
  char buffer[10];
  if (argc <= 1) {
    fprintf(stderr, "Numero invalido de argumentos. (%d)\n", argc);
    exit(-1);
  }
  pipe(tunel);
  pipe(tunel2);
  printf("Argumentos: ");
  for (int i = 0; i < argc; i++) {
    printf("%s ", argv[i]);
    printf("%c", (i == argc - 1) ? '\n' : ',');
  }
  numero = atoi(argv[1]);
  printf("Numero fornecido: %d\n\n", numero);
  pid = fork();
  if (!pid) {
    close(tunel[1]);
    while (read(tunel[0], &buffer, 10) > 0) {
    }
    close(tunel[0]);
    numero = atoi(buffer);
    printf("Valor recebido pelo filho: %d\n", numero);
    numero++;
    sprintf(buffer, "%d", numero);
    printf("Filho vai enviar: %d - char %s\n\n", numero, buffer);
    close(tunel2[0]);
    write(tunel2[1], buffer, strlen(buffer));
    close(tunel2[1]);
    exit(EXIT_SUCCESS);
  } else {
    numero = atoi(argv[1]);
    printf("Pai recebeu: %d\n", numero);
    numero++;
    sprintf(buffer, "%d", numero);
    printf("Pai vai enviar: %d - char %s\n\n", numero, buffer);
    close(tunel[0]);
    write(tunel[1], buffer, strlen(buffer));
    close(tunel[1]);
    close(tunel2[1]);
    while (read(tunel2[0], &buffer, 10) > 0) {
    }
    close(tunel2[0]);
    numero = atoi(buffer);
    printf("Pai imprime a saida final: %d\n", numero);
    exit(EXIT_SUCCESS);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     11f2 <main+0x42>
mov    0x2e09(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%edx
lea    0xe1d(%rip),%rsi
call   1090 <fprintf@plt>
mov    $0xffffffff,%edi
call   10c0 <exit@plt>
lea    -0x1c(%rbp),%rdi
call   1070 <pipe@plt>
lea    -0x24(%rbp),%rdi
call   1070 <pipe@plt>
lea    0xe1a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1273 <main+0xc3>
mov    -0x10(%rbp),%rax
movslq -0x38(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xdfa(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x38(%rbp),%ecx
mov    -0x8(%rbp),%edx
sub    $0x1,%edx
mov    $0x2c,%esi
mov    $0xa,%eax
cmp    %edx,%ecx
cmove  %eax,%esi
lea    0xdd8(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1219 <main+0x69>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10a0 <atoi@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%esi
lea    0xdac(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   10d0 <fork@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1369 <main+0x1b9>
mov    -0x18(%rbp),%edi
call   1060 <close@plt>
mov    -0x1c(%rbp),%edi
lea    -0x32(%rbp),%rsi
mov    $0xa,%edx
call   1080 <read@plt>
cmp    $0x0,%rax
jle    12d0 <main+0x120>
jmp    12b0 <main+0x100>
mov    -0x1c(%rbp),%edi
call   1060 <close@plt>
lea    -0x32(%rbp),%rdi
call   10a0 <atoi@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%esi
lea    0xd62(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
lea    -0x32(%rbp),%rdi
mov    -0x28(%rbp),%edx
lea    0xd63(%rip),%rsi
call   10b0 <sprintf@plt>
mov    -0x28(%rbp),%esi
lea    -0x32(%rbp),%rdx
lea    0xd53(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x24(%rbp),%edi
call   1060 <close@plt>
mov    -0x20(%rbp),%eax
mov    %eax,-0x44(%rbp)
lea    -0x32(%rbp),%rax
mov    %rax,-0x40(%rbp)
lea    -0x32(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x44(%rbp),%edi
mov    -0x40(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    -0x20(%rbp),%edi
call   1060 <close@plt>
mov    0x2c76(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10a0 <atoi@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%esi
lea    0xd10(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
lea    -0x32(%rbp),%rdi
mov    -0x28(%rbp),%edx
lea    0xcce(%rip),%rsi
call   10b0 <sprintf@plt>
mov    -0x28(%rbp),%esi
lea    -0x32(%rbp),%rdx
lea    0xcf0(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x1c(%rbp),%edi
call   1060 <close@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x54(%rbp)
lea    -0x32(%rbp),%rax
mov    %rax,-0x50(%rbp)
lea    -0x32(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x54(%rbp),%edi
mov    -0x50(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    -0x18(%rbp),%edi
call   1060 <close@plt>
mov    -0x20(%rbp),%edi
call   1060 <close@plt>
mov    -0x24(%rbp),%edi
lea    -0x32(%rbp),%rsi
mov    $0xa,%edx
call   1080 <read@plt>
cmp    $0x0,%rax
jle    1418 <main+0x268>
jmp    13f8 <main+0x248>
mov    -0x24(%rbp),%edi
call   1060 <close@plt>
lea    -0x32(%rbp),%rdi
call   10a0 <atoi@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%esi
lea    0xc8d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2b94(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %edi,%r14d
cmp    $0x1,%edi
jg     11f8 <main+0x38>
mov    0x2e03(%rip),%rax
mov    (%rax),%edi
lea    0xe1a(%rip),%rsi
mov    %r14d,%edx
call   10a0 <fprintf@plt>
mov    $0xffffffff,%edi
call   10d0 <exit@plt>
mov    %rsi,%r15
lea    0x14(%rsp),%rdi
call   1080 <pipe@plt>
lea    0xc(%rsp),%rdi
call   1080 <pipe@plt>
lea    0xe0f(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    -0x1(%r14),%r13d
mov    %r14d,%ebx
lea    0xe07(%rip),%r14
mov    $0xa,%r12d
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%r15,%rbp,8),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
cmp    %rbp,%r13
mov    $0x2c,%edi
cmove  %r12d,%edi
call   1030 <putchar@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1240 <main+0x80>
mov    0x8(%r15),%rdi
call   10b0 <atoi@plt>
lea    0xdbe(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
call   10e0 <fork@plt>
test   %eax,%eax
jne    1334 <main+0x174>
mov    0x18(%rsp),%edi
call   1070 <close@plt>
lea    0x1e(%rsp),%rbx
xchg   %ax,%ax
mov    0x14(%rsp),%edi
mov    %rbx,%rsi
mov    $0xa,%edx
call   1090 <read@plt>
test   %rax,%rax
jg     12a0 <main+0xe0>
mov    0x14(%rsp),%edi
call   1070 <close@plt>
lea    0x1e(%rsp),%rbx
mov    %rbx,%rdi
call   10b0 <atoi@plt>
mov    %eax,%ebp
lea    0xd78(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%ebp
lea    0xd84(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
call   10c0 <sprintf@plt>
lea    0xd76(%rip),%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1060 <printf@plt>
mov    0xc(%rsp),%edi
call   1070 <close@plt>
mov    0x10(%rsp),%ebp
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <write@plt>
mov    0x10(%rsp),%edi
call   1070 <close@plt>
jmp    13e9 <main+0x229>
mov    0x8(%r15),%rdi
call   10b0 <atoi@plt>
mov    %eax,%ebp
lea    0xd4a(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%ebp
lea    0xd13(%rip),%rsi
lea    0x1e(%rsp),%rbx
mov    %rbx,%rdi
mov    %ebp,%edx
call   10c0 <sprintf@plt>
lea    0xd32(%rip),%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x14(%rsp),%edi
call   1070 <close@plt>
mov    0x18(%rsp),%ebp
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <write@plt>
mov    0x18(%rsp),%edi
call   1070 <close@plt>
mov    0x10(%rsp),%edi
call   1070 <close@plt>
xchg   %ax,%ax
mov    0xc(%rsp),%edi
mov    %rbx,%rsi
mov    $0xa,%edx
call   1090 <read@plt>
test   %rax,%rax
jg     13b0 <main+0x1f0>
mov    0xc(%rsp),%edi
call   1070 <close@plt>
lea    0x1e(%rsp),%rdi
call   10b0 <atoi@plt>
lea    0xce0(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2be8(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"Numero invalido de argumentos. (%d)\0A\00"
@.str.1 = [13 x i8] c"Argumentos: \00"
@.str.2 = [4 x i8] c"%s \00"
@.str.3 = [3 x i8] c"%c\00"
@.str.4 = [23 x i8] c"Numero fornecido: %d\0A\0A\00"
@.str.5 = [31 x i8] c"Valor recebido pelo filho: %d\0A\00"
@.str.6 = [3 x i8] c"%d\00"
@.str.7 = [33 x i8] c"Filho vai enviar: %d - char %s\0A\0A\00"
@EXIT_SUCCESS = global i32 0
@.str.8 = [17 x i8] c"Pai recebeu: %d\0A\00"
@.str.9 = [31 x i8] c"Pai vai enviar: %d - char %s\0A\0A\00"
@.str.10 = [31 x i8] c"Pai imprime a saida final: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [2 x i32]
%8 = alloca [2 x i32]
%9 = alloca i32
%10 = alloca [10 x i8]
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = load i32, i32* %4
%13 = icmp sle i32 %12, 1
br i1 %13, label %14, label %19
14: ; preds = %2
%15 = load i32, i32* @stderr
%16 = load i32, i32* %4
%17 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %16)
%18 = call i32 @exit(i32 -1)
unreachable
19: ; preds = %2
%20 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%21 = call i32 @pipe(i32* %20)
%22 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%23 = call i32 @pipe(i32* %22)
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %11
br label %25
25: ; preds = %43, %19
%26 = load i32, i32* %11
%27 = load i32, i32* %4
%28 = icmp slt i32 %26, %27
br i1 %28, label %29, label %46
29: ; preds = %25
%30 = load i8**, i8*** %5
%31 = load i32, i32* %11
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8*, i8** %30, i64 %32
%34 = load i8*, i8** %33
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %34)
%36 = load i32, i32* %11
%37 = load i32, i32* %4
%38 = sub nsw i32 %37, 1
%39 = icmp eq i32 %36, %38
%40 = zext i1 %39 to i64
%41 = select i1 %39, i32 10, i32 44
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %41)
br label %43
43: ; preds = %29
%44 = load i32, i32* %11
%45 = add nsw i32 %44, 1
store i32 %45, i32* %11
br label %25
46: ; preds = %25
%47 = load i8**, i8*** %5
%48 = getelementptr inbounds i8*, i8** %47, i64 1
%49 = load i8*, i8** %48
%50 = call i32 @atoi(i8* %49)
store i32 %50, i32* %9
%51 = load i32, i32* %9
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i32 %51)
%53 = call i32 (...) @fork()
store i32 %53, i32* %6
%54 = load i32, i32* %6
%55 = icmp ne i32 %54, 0
br i1 %55, label %97, label %56
56: ; preds = %46
%57 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
%58 = load i32, i32* %57
%59 = call i32 @close(i32 %58)
br label %60
60: ; preds = %66, %56
%61 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%62 = load i32, i32* %61
%63 = bitcast [10 x i8]* %10 to i8**
%64 = call i64 @read(i32 %62, i8** %63, i32 10)
%65 = icmp sgt i64 %64, 0
br i1 %65, label %66, label %67
66: ; preds = %60
br label %60
67: ; preds = %60
%68 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%69 = load i32, i32* %68
%70 = call i32 @close(i32 %69)
%71 = getelementptr inbounds [10 x i8], [10 x i8]* %10, i64 0, i64 0
%72 = call i32 @atoi(i8* %71)
store i32 %72, i32* %9
%73 = load i32, i32* %9
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), i32 %73)
%75 = load i32, i32* %9
%76 = add nsw i32 %75, 1
store i32 %76, i32* %9
%77 = getelementptr inbounds [10 x i8], [10 x i8]* %10, i64 0, i64 0
%78 = load i32, i32* %9
%79 = call i32 @sprintf(i8* %77, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 %78)
%80 = load i32, i32* %9
%81 = getelementptr inbounds [10 x i8], [10 x i8]* %10, i64 0, i64 0
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0), i32 %80, i8* %81)
%83 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%84 = load i32, i32* %83
%85 = call i32 @close(i32 %84)
%86 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
%87 = load i32, i32* %86
%88 = getelementptr inbounds [10 x i8], [10 x i8]* %10, i64 0, i64 0
%89 = getelementptr inbounds [10 x i8], [10 x i8]* %10, i64 0, i64 0
%90 = call i32 @strlen(i8* %89)
%91 = call i32 @write(i32 %87, i8* %88, i32 %90)
%92 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
%93 = load i32, i32* %92
%94 = call i32 @close(i32 %93)
%95 = load i32, i32* @EXIT_SUCCESS
%96 = call i32 @exit(i32 %95)
unreachable
97: ; preds = %46
%98 = load i8**, i8*** %5
%99 = getelementptr inbounds i8*, i8** %98, i64 1
%100 = load i8*, i8** %99
%101 = call i32 @atoi(i8* %100)
store i32 %101, i32* %9
%102 = load i32, i32* %9
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0), i32 %102)
%104 = load i32, i32* %9
%105 = add nsw i32 %104, 1
store i32 %105, i32* %9
%106 = getelementptr inbounds [10 x i8], [10 x i8]* %10, i64 0, i64 0
%107 = load i32, i32* %9
%108 = call i32 @sprintf(i8* %106, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 %107)
%109 = load i32, i32* %9
%110 = getelementptr inbounds [10 x i8], [10 x i8]* %10, i64 0, i64 0
%111 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.9, i64 0, i64 0), i32 %109, i8* %110)
%112 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%113 = load i32, i32* %112
%114 = call i32 @close(i32 %113)
%115 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
%116 = load i32, i32* %115
%117 = getelementptr inbounds [10 x i8], [10 x i8]* %10, i64 0, i64 0
%118 = getelementptr inbounds [10 x i8], [10 x i8]* %10, i64 0, i64 0
%119 = call i32 @strlen(i8* %118)
%120 = call i32 @write(i32 %116, i8* %117, i32 %119)
%121 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
%122 = load i32, i32* %121
%123 = call i32 @close(i32 %122)
%124 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
%125 = load i32, i32* %124
%126 = call i32 @close(i32 %125)
br label %127
127: ; preds = %133, %97
%128 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%129 = load i32, i32* %128
%130 = bitcast [10 x i8]* %10 to i8**
%131 = call i64 @read(i32 %129, i8** %130, i32 10)
%132 = icmp sgt i64 %131, 0
br i1 %132, label %133, label %134
133: ; preds = %127
br label %127
134: ; preds = %127
%135 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%136 = load i32, i32* %135
%137 = call i32 @close(i32 %136)
%138 = getelementptr inbounds [10 x i8], [10 x i8]* %10, i64 0, i64 0
%139 = call i32 @atoi(i8* %138)
store i32 %139, i32* %9
%140 = load i32, i32* %9
%141 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.10, i64 0, i64 0), i32 %140)
%142 = load i32, i32* @EXIT_SUCCESS
%143 = call i32 @exit(i32 %142)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"Numero invalido de argumentos. (%d)\0A\00"
@.str.1 = [13 x i8] c"Argumentos: \00"
@.str.2 = [4 x i8] c"%s \00"
@.str.4 = [23 x i8] c"Numero fornecido: %d\0A\0A\00"
@.str.5 = [31 x i8] c"Valor recebido pelo filho: %d\0A\00"
@.str.6 = [3 x i8] c"%d\00"
@.str.7 = [33 x i8] c"Filho vai enviar: %d - char %s\0A\0A\00"
@EXIT_SUCCESS = global i32 0
@.str.8 = [17 x i8] c"Pai recebeu: %d\0A\00"
@.str.9 = [31 x i8] c"Pai vai enviar: %d - char %s\0A\0A\00"
@.str.10 = [31 x i8] c"Pai imprime a saida final: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [2 x i32]
%4 = alloca [2 x i32]
%5 = alloca [10 x i8]
%6 = bitcast [2 x i32]* %3 to i8*
%7 = bitcast [2 x i32]* %4 to i8*
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%9 = icmp slt i32 %0, 2
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = tail call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %0)
%13 = tail call i32 @exit(i32 -1)
unreachable
14: ; preds = %2
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%16 = call i32 @pipe(i32* %15)
%17 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%18 = call i32 @pipe(i32* %17)
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%20 = add nsw i32 %0, -1
%21 = zext i32 %20 to i64
%22 = zext i32 %0 to i64
br label %30
23: ; preds = %30
%24 = getelementptr inbounds i8*, i8** %1, i64 1
%25 = load i8*, i8** %24
%26 = call i32 @atoi(i8* %25)
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i32 %26)
%28 = call i32 (...) @fork()
%29 = icmp eq i32 %28, 0
br i1 %29, label %40, label %67
30: ; preds = %14, %30
%31 = phi i64 [ 0, %14 ], [ %38, %30 ]
%32 = getelementptr inbounds i8*, i8** %1, i64 %31
%33 = load i8*, i8** %32
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %33)
%35 = icmp eq i64 %31, %21
%36 = select i1 %35, i32 10, i32 44
%37 = call i32 @putchar(i32 %36)
%38 = add nuw nsw i64 %31, 1
%39 = icmp eq i64 %38, %22
br i1 %39, label %23, label %30
40: ; preds = %23
%41 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
%42 = load i32, i32* %41
%43 = call i32 @close(i32 %42)
%44 = bitcast [10 x i8]* %5 to i8**
br label %45
45: ; preds = %45, %40
%46 = load i32, i32* %15
%47 = call i64 @read(i32 %46, i8** %44, i32 10)
%48 = icmp sgt i64 %47, 0
br i1 %48, label %45, label %49
49: ; preds = %45
%50 = load i32, i32* %15
%51 = call i32 @close(i32 %50)
%52 = call i32 @atoi(i8* %8)
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), i32 %52)
%54 = add nsw i32 %52, 1
%55 = call i32 @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 %54)
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0), i32 %54, i8* %8)
%57 = load i32, i32* %17
%58 = call i32 @close(i32 %57)
%59 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%60 = load i32, i32* %59
%61 = call i32 @strlen(i8* %8)
%62 = call i32 @write(i32 %60, i8* %8, i32 %61)
%63 = load i32, i32* %59
%64 = call i32 @close(i32 %63)
%65 = load i32, i32* @EXIT_SUCCESS
%66 = call i32 @exit(i32 %65)
unreachable
67: ; preds = %23
%68 = load i8*, i8** %24
%69 = call i32 @atoi(i8* %68)
%70 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0), i32 %69)
%71 = add nsw i32 %69, 1
%72 = call i32 @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 %71)
%73 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.9, i64 0, i64 0), i32 %71, i8* %8)
%74 = load i32, i32* %15
%75 = call i32 @close(i32 %74)
%76 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
%77 = load i32, i32* %76
%78 = call i32 @strlen(i8* %8)
%79 = call i32 @write(i32 %77, i8* %8, i32 %78)
%80 = load i32, i32* %76
%81 = call i32 @close(i32 %80)
%82 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%83 = load i32, i32* %82
%84 = call i32 @close(i32 %83)
%85 = bitcast [10 x i8]* %5 to i8**
br label %86
86: ; preds = %86, %67
%87 = load i32, i32* %17
%88 = call i64 @read(i32 %87, i8** %85, i32 10)
%89 = icmp sgt i64 %88, 0
br i1 %89, label %86, label %90
90: ; preds = %86
%91 = load i32, i32* %17
%92 = call i32 @close(i32 %91)
%93 = call i32 @atoi(i8* %8)
%94 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.10, i64 0, i64 0), i32 %93)
%95 = load i32, i32* @EXIT_SUCCESS
%96 = call i32 @exit(i32 %95)
unreachable
}