#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 int /*<<< orphan*/ i;
typedef int /*<<< orphan*/ confirm;
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
int O_APPEND;
int O_CREAT;
int O_RDONLY;
int O_RDWR;
int /*<<< orphan*/ close(int);
int dup2(int, int);
int /*<<< orphan*/ execve(char *, char **, int /*<<< orphan*/ *);
int fork();
int open(char const *, int);
int pipe(int *);
int /*<<< orphan*/ printf(char *, char);
int read(int, ...);
int write(int, ...);
int main(int argc, char const *argv[]) {
  int fd1[2];
  int fd2[2];
  int retpipe = 0;
  int retopen = 0;
  int retcreat = 0;
  int retread = -999;
  int retwrite = -999;
  char buffer[500];
  char caracter;
  int contador = 0;
  int i = 0;
  int child = -999;
  char confirm[500];
  int dupreturn = 0;
  int bytesRecibidos = 0;
  int aux = 0;
  int retdup = 0;
  retcreat = open(argv[2], O_CREAT | O_RDWR | O_APPEND);
  retpipe = pipe(fd1);
  retpipe = 0;
  retpipe = pipe(fd2);
  child = fork();
  if (child == 0) {
    close(fd2[0]);
    close(fd1[1]);
    retdup = dup2(fd1[0], 0);
    retdup = dup2(fd2[1], 1);
    char *args[] = {"./ponmayusculas", NULL};
    execve("./ponmayusculas", args, NULL);
  } else {
    retopen = open(argv[1], O_RDONLY);
    close(fd1[0]);
    close(fd2[1]);
    do {
      retread = read(retopen, &caracter, 1);
      if (caracter != '\n') {
        buffer[i] = caracter;
        i++;
      } else {
        buffer[i + 1] = '\0';
        printf("%c\n", buffer[4]);
        contador++;
        i = i + 1;
        if ((contador % 2) != 0) {
          retwrite = write(fd1[1], &i, sizeof(i));
          retwrite = -999;
          retwrite = write(fd1[1], &buffer, i);
          retread = read(fd2[0], &confirm, sizeof(confirm));
        } else {
          retwrite = write(retcreat, &buffer, i);
        }
        for (i = 0; i < sizeof(buffer); i++) {
          buffer[i] = ' ';
        }
        i = 0;
      }
    } while (retread != 0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x460,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0xfffffc19,-0x30(%rbp)
movl   $0xfffffc19,-0x34(%rbp)
movl   $0x0,-0x238(%rbp)
movl   $0x0,-0x23c(%rbp)
movl   $0xfffffc19,-0x240(%rbp)
fc ff ff
movl   $0x0,-0x444(%rbp)
movl   $0x0,-0x448(%rbp)
movl   $0x0,-0x44c(%rbp)
movl   $0x0,-0x450(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    0x2dd7(%rip),%rax
mov    (%rax),%esi
mov    0x2db6(%rip),%rax
or     (%rax),%esi
mov    0x2d8d(%rip),%rax
or     (%rax),%esi
call   10a0 <open@plt>
mov    %eax,-0x2c(%rbp)
lea    -0x18(%rbp),%rdi
call   1070 <pipe@plt>
mov    %eax,-0x24(%rbp)
movl   $0x0,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
call   1070 <pipe@plt>
mov    %eax,-0x24(%rbp)
mov    $0x0,%al
call   10b0 <fork@plt>
mov    %eax,-0x240(%rbp)
cmpl   $0x0,-0x240(%rbp)
jne    12e1 <main+0x151>
mov    -0x20(%rbp),%edi
call   1060 <close@plt>
mov    -0x14(%rbp),%edi
call   1060 <close@plt>
mov    -0x18(%rbp),%edi
xor    %esi,%esi
call   1040 <dup2@plt>
mov    %eax,-0x450(%rbp)
mov    -0x1c(%rbp),%edi
mov    $0x1,%esi
call   1040 <dup2@plt>
mov    %eax,-0x450(%rbp)
mov    0x2b40(%rip),%rax
mov    %rax,-0x460(%rbp)
mov    0x2b3a(%rip),%rax
mov    %rax,-0x458(%rbp)
lea    -0x460(%rbp),%rsi
lea    0xd2d(%rip),%rdi
xor    %eax,%eax
mov    %eax,%edx
call   1090 <execve@plt>
jmp    1486 <main+0x2f6>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2ce8(%rip),%rax
mov    (%rax),%esi
call   10a0 <open@plt>
mov    %eax,-0x28(%rbp)
mov    -0x18(%rbp),%edi
call   1060 <close@plt>
mov    -0x1c(%rbp),%edi
call   1060 <close@plt>
mov    -0x28(%rbp),%edi
lea    -0x231(%rbp),%rsi
mov    $0x1,%edx
mov    $0x0,%al
call   1080 <read@plt>
mov    %eax,-0x30(%rbp)
movsbl -0x231(%rbp),%eax
cmp    $0xa,%eax
je     135b <main+0x1cb>
mov    -0x231(%rbp),%cl
movslq -0x23c(%rbp),%rax
mov    %cl,-0x230(%rbp,%rax,1)
mov    -0x23c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x23c(%rbp)
jmp    1472 <main+0x2e2>
mov    -0x23c(%rbp),%eax
add    $0x1,%eax
cltq
movb   $0x0,-0x230(%rbp,%rax,1)
lea    0xc9b(%rip),%rdi
movsbl -0x22c(%rbp),%esi
call   1050 <printf@plt>
mov    -0x238(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x238(%rbp)
mov    -0x23c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x23c(%rbp)
mov    -0x238(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     140e <main+0x27e>
mov    -0x14(%rbp),%edi
lea    -0x23c(%rbp),%rsi
mov    $0x4,%edx
mov    $0x0,%al
call   1030 <write@plt>
mov    %eax,-0x34(%rbp)
movl   $0xfffffc19,-0x34(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x23c(%rbp),%edx
lea    -0x230(%rbp),%rsi
mov    $0x0,%al
call   1030 <write@plt>
mov    %eax,-0x34(%rbp)
mov    -0x20(%rbp),%edi
lea    -0x440(%rbp),%rsi
mov    $0x1f4,%edx
mov    $0x0,%al
call   1080 <read@plt>
mov    %eax,-0x30(%rbp)
jmp    1428 <main+0x298>
mov    -0x2c(%rbp),%edi
mov    -0x23c(%rbp),%edx
lea    -0x230(%rbp),%rsi
mov    $0x0,%al
call   1030 <write@plt>
mov    %eax,-0x34(%rbp)
movl   $0x0,-0x23c(%rbp)
movslq -0x23c(%rbp),%rax
cmp    $0x1f4,%rax
jae    1468 <main+0x2d8>
movslq -0x23c(%rbp),%rax
movb   $0x20,-0x230(%rbp,%rax,1)
20
mov    -0x23c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x23c(%rbp)
jmp    1432 <main+0x2a2>
movl   $0x0,-0x23c(%rbp)
jmp    1477 <main+0x2e7>
cmpl   $0x0,-0x30(%rbp)
jne    130a <main+0x17a>
jmp    1486 <main+0x2f6>
xor    %eax,%eax
add    $0x460,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x418,%rsp
mov    %rsi,%rbx
movl   $0x0,0x8(%rsp)
mov    0x2e35(%rip),%rax
mov    0x2e16(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x10(%rbx),%rdi
mov    0x2de7(%rip),%rax
or     (%rax),%esi
call   10b0 <open@plt>
mov    %eax,0x1c(%rsp)
lea    0xc(%rsp),%rdi
call   1080 <pipe@plt>
lea    0x14(%rsp),%rdi
call   1080 <pipe@plt>
xor    %eax,%eax
call   10c0 <fork@plt>
test   %eax,%eax
je     131b <main+0x17b>
mov    0x8(%rbx),%rdi
mov    0x2dc6(%rip),%rax
mov    (%rax),%esi
call   10b0 <open@plt>
mov    %eax,%ebp
mov    0xc(%rsp),%edi
call   1070 <close@plt>
mov    0x18(%rsp),%edi
call   1070 <close@plt>
lea    0x7(%rsp),%r15
lea    0x20(%rsp),%rbx
lea    0xdd2(%rip),%r12
xor    %r14d,%r14d
jmp    1264 <main+0xc4>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %cl,0x20(%rsp,%rax,1)
add    $0x1,%eax
mov    %eax,0x8(%rsp)
test   %r13d,%r13d
je     1365 <main+0x1c5>
mov    %ebp,%edi
mov    %r15,%rsi
mov    $0x1,%edx
xor    %eax,%eax
call   1090 <read@plt>
mov    %eax,%r13d
movzbl 0x7(%rsp),%ecx
movslq 0x8(%rsp),%rax
cmp    $0xa,%cl
jne    1250 <main+0xb0>
movb   $0x0,0x1(%rax,%rbx,1)
movsbl 0x24(%rsp),%esi
mov    %r12,%rdi
call   1050 <printf@plt>
add    $0x1,%r14d
mov    0x8(%rsp),%edx
add    $0x1,%edx
mov    %edx,0x8(%rsp)
test   $0x1,%r14b
jne    12c0 <main+0x120>
mov    0x1c(%rsp),%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <write@plt>
jmp    1302 <main+0x162>
xchg   %ax,%ax
mov    0x10(%rsp),%edi
mov    $0x4,%edx
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1030 <write@plt>
mov    0x10(%rsp),%edi
mov    0x8(%rsp),%edx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <write@plt>
mov    0x14(%rsp),%edi
mov    $0x1f4,%edx
lea    0x220(%rsp),%rsi
xor    %eax,%eax
call   1090 <read@plt>
mov    %eax,%r13d
mov    $0x1f4,%edx
mov    %rbx,%rdi
mov    $0x20,%esi
call   1060 <memset@plt>
xor    %eax,%eax
jmp    1257 <main+0xb7>
mov    0x14(%rsp),%edi
call   1070 <close@plt>
mov    0x10(%rsp),%edi
call   1070 <close@plt>
mov    0xc(%rsp),%edi
xor    %esi,%esi
call   1040 <dup2@plt>
mov    0x18(%rsp),%edi
mov    $0x1,%esi
call   1040 <dup2@plt>
movaps 0x2aa3(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
lea    0xca7(%rip),%rdi
lea    0x20(%rsp),%rsi
xor    %edx,%edx
call   10a0 <execve@plt>
xor    %eax,%eax
add    $0x418,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@O_CREAT = global i32 0
@O_RDWR = global i32 0
@O_APPEND = global i32 0
@.str = [16 x i8] c"./ponmayusculas\00"
@__const.main.args = [2 x i8*] [i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i32 0, i32 0), i8* null]
@O_RDONLY = global i32 0
@.str.1 = [4 x i8] c"%c\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2 x i32]
%7 = alloca [2 x i32]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca [500 x i8]
%14 = alloca i8
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca [500 x i8]
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca [2 x i8*]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
store i32 -999, i32* %11
store i32 -999, i32* %12
store i32 0, i32* %15
store i32 0, i32* %16
store i32 -999, i32* %17
store i32 0, i32* %19
store i32 0, i32* %20
store i32 0, i32* %21
store i32 0, i32* %22
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 2
%26 = load i8*, i8** %25
%27 = load i32, i32* @O_CREAT
%28 = load i32, i32* @O_RDWR
%29 = or i32 %27, %28
%30 = load i32, i32* @O_APPEND
%31 = or i32 %29, %30
%32 = call i32 @open(i8* %26, i32 %31)
store i32 %32, i32* %10
%33 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%34 = call i32 @pipe(i32* %33)
store i32 %34, i32* %8
store i32 0, i32* %8
%35 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%36 = call i32 @pipe(i32* %35)
store i32 %36, i32* %8
%37 = call i32 (...) @fork()
store i32 %37, i32* %17
%38 = load i32, i32* %17
%39 = icmp eq i32 %38, 0
br i1 %39, label %40, label %56
40: ; preds = %2
%41 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%42 = load i32, i32* %41
%43 = call i32 @close(i32 %42)
%44 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%45 = load i32, i32* %44
%46 = call i32 @close(i32 %45)
%47 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%48 = load i32, i32* %47
%49 = call i32 @dup2(i32 %48, i32 0)
store i32 %49, i32* %22
%50 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
%51 = load i32, i32* %50
%52 = call i32 @dup2(i32 %51, i32 1)
store i32 %52, i32* %22
%53 = bitcast [2 x i8*]* %23 to i8*
%54 = getelementptr inbounds [2 x i8*], [2 x i8*]* %23, i64 0, i64 0
%55 = call i32 @execve(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8** %54, i32* null)
br label %129
56: ; preds = %2
%57 = load i8**, i8*** %5
%58 = getelementptr inbounds i8*, i8** %57, i64 1
%59 = load i8*, i8** %58
%60 = load i32, i32* @O_RDONLY
%61 = call i32 @open(i8* %59, i32 %60)
store i32 %61, i32* %9
%62 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%63 = load i32, i32* %62
%64 = call i32 @close(i32 %63)
%65 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
%66 = load i32, i32* %65
%67 = call i32 @close(i32 %66)
br label %68
68: ; preds = %125, %56
%69 = load i32, i32* %9
%70 = call i32 (i32, ...) @read(i32 %69, i8* %14, i32 1)
store i32 %70, i32* %11
%71 = load i8, i8* %14
%72 = sext i8 %71 to i32
%73 = icmp ne i32 %72, 10
br i1 %73, label %74, label %81
74: ; preds = %68
%75 = load i8, i8* %14
%76 = load i32, i32* %16
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds [500 x i8], [500 x i8]* %13, i64 0, i64 %77
store i8 %75, i8* %78
%79 = load i32, i32* %16
%80 = add nsw i32 %79, 1
store i32 %80, i32* %16
br label %124
81: ; preds = %68
%82 = load i32, i32* %16
%83 = add nsw i32 %82, 1
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds [500 x i8], [500 x i8]* %13, i64 0, i64 %84
store i8 0, i8* %85
%86 = getelementptr inbounds [500 x i8], [500 x i8]* %13, i64 0, i64 4
%87 = load i8, i8* %86
%88 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext %87)
%89 = load i32, i32* %15
%90 = add nsw i32 %89, 1
store i32 %90, i32* %15
%91 = load i32, i32* %16
%92 = add nsw i32 %91, 1
store i32 %92, i32* %16
%93 = load i32, i32* %15
%94 = srem i32 %93, 2
%95 = icmp ne i32 %94, 0
br i1 %95, label %96, label %107
96: ; preds = %81
%97 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%98 = load i32, i32* %97
%99 = call i32 (i32, ...) @write(i32 %98, i32* %16, i64 4)
store i32 %99, i32* %12
store i32 -999, i32* %12
%100 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%101 = load i32, i32* %100
%102 = load i32, i32* %16
%103 = call i32 (i32, ...) @write(i32 %101, [500 x i8]* %13, i32 %102)
store i32 %103, i32* %12
%104 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%105 = load i32, i32* %104
%106 = call i32 (i32, ...) @read(i32 %105, [500 x i8]* %18, i64 500)
store i32 %106, i32* %11
br label %111
107: ; preds = %81
%108 = load i32, i32* %10
%109 = load i32, i32* %16
%110 = call i32 (i32, ...) @write(i32 %108, [500 x i8]* %13, i32 %109)
store i32 %110, i32* %12
br label %111
111: ; preds = %107, %96
store i32 0, i32* %16
br label %112
112: ; preds = %120, %111
%113 = load i32, i32* %16
%114 = sext i32 %113 to i64
%115 = icmp ult i64 %114, 500
br i1 %115, label %116, label %123
116: ; preds = %112
%117 = load i32, i32* %16
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds [500 x i8], [500 x i8]* %13, i64 0, i64 %118
store i8 32, i8* %119
br label %120
120: ; preds = %116
%121 = load i32, i32* %16
%122 = add nsw i32 %121, 1
store i32 %122, i32* %16
br label %112
123: ; preds = %112
store i32 0, i32* %16
br label %124
124: ; preds = %123, %74
br label %125
125: ; preds = %124
%126 = load i32, i32* %11
%127 = icmp ne i32 %126, 0
br i1 %127, label %68, label %128
128: ; preds = %125
br label %129
129: ; preds = %128, %40
ret i32 0
}

LLVM IR (-O2):
@O_CREAT = global i32 0
@O_RDWR = global i32 0
@O_APPEND = global i32 0
@.str = [16 x i8] c"./ponmayusculas\00"
@__const.main.args = [2 x i8*] [i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i32 0, i32 0), i8* null]
@O_RDONLY = global i32 0
@.str.1 = [4 x i8] c"%c\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [2 x i32]
%4 = alloca [2 x i32]
%5 = alloca [500 x i8]
%6 = getelementptr inbounds [500 x i8], [500 x i8]* %5, i64 0, i64 0
%7 = alloca i8
%8 = alloca i32
%9 = alloca [500 x i8]
%10 = alloca [2 x i8*]
%11 = bitcast [2 x i32]* %3 to i8*
%12 = bitcast [2 x i32]* %4 to i8*
%13 = getelementptr inbounds [500 x i8], [500 x i8]* %5, i64 0, i64 0
%14 = bitcast i32* %8 to i8*
store i32 0, i32* %8
%15 = getelementptr inbounds [500 x i8], [500 x i8]* %9, i64 0, i64 0
%16 = getelementptr inbounds i8*, i8** %1, i64 2
%17 = load i8*, i8** %16
%18 = load i32, i32* @O_CREAT
%19 = load i32, i32* @O_RDWR
%20 = or i32 %19, %18
%21 = load i32, i32* @O_APPEND
%22 = or i32 %20, %21
%23 = tail call i32 @open(i8* %17, i32 %22)
%24 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%25 = call i32 @pipe(i32* %24)
%26 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%27 = call i32 @pipe(i32* %26)
%28 = call i32 (...) @fork()
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %44
30: ; preds = %2
%31 = load i32, i32* %26
%32 = call i32 @close(i32 %31)
%33 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
%34 = load i32, i32* %33
%35 = call i32 @close(i32 %34)
%36 = load i32, i32* %24
%37 = call i32 @dup2(i32 %36, i32 0)
%38 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%39 = load i32, i32* %38
%40 = call i32 @dup2(i32 %39, i32 1)
%41 = bitcast [2 x i8*]* %10 to i8*
%42 = getelementptr inbounds [2 x i8*], [2 x i8*]* %10, i64 0, i64 0
%43 = call i32 @execve(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8** %42, i32* null)
br label %94
44: ; preds = %2
%45 = getelementptr inbounds i8*, i8** %1, i64 1
%46 = load i8*, i8** %45
%47 = load i32, i32* @O_RDONLY
%48 = call i32 @open(i8* %46, i32 %47)
%49 = load i32, i32* %24
%50 = call i32 @close(i32 %49)
%51 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%52 = load i32, i32* %51
%53 = call i32 @close(i32 %52)
%54 = getelementptr inbounds [500 x i8], [500 x i8]* %5, i64 0, i64 4
%55 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
br label %56
56: ; preds = %89, %44
%57 = phi i32 [ 0, %44 ], [ %91, %89 ]
%58 = call i32 (i32, ...) @read(i32 %48, i8* %7, i32 1)
%59 = load i8, i8* %7
%60 = icmp eq i8 %59, 10
%61 = load i32, i32* %8
br i1 %60, label %66, label %62
62: ; preds = %56
%63 = sext i32 %61 to i64
%64 = getelementptr inbounds [500 x i8], [500 x i8]* %5, i64 0, i64 %63
store i8 %59, i8* %64
%65 = add nsw i32 %61, 1
br label %89
66: ; preds = %56
%67 = add nsw i32 %61, 1
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds [500 x i8], [500 x i8]* %5, i64 0, i64 %68
store i8 0, i8* %69
%70 = load i8, i8* %54
%71 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext %70)
%72 = add nsw i32 %57, 1
%73 = load i32, i32* %8
%74 = add nsw i32 %73, 1
store i32 %74, i32* %8
%75 = and i32 %72, 1
%76 = icmp eq i32 %75, 0
br i1 %76, label %85, label %77
77: ; preds = %66
%78 = load i32, i32* %55
%79 = call i32 (i32, ...) @write(i32 %78, i32* %8, i64 4)
%80 = load i32, i32* %55
%81 = load i32, i32* %8
%82 = call i32 (i32, ...) @write(i32 %80, [500 x i8]* %5, i32 %81)
%83 = load i32, i32* %26
%84 = call i32 (i32, ...) @read(i32 %83, [500 x i8]* %9, i64 500)
br label %87
85: ; preds = %66
%86 = call i32 (i32, ...) @write(i32 %23, [500 x i8]* %5, i32 %74)
br label %87
87: ; preds = %85, %77
%88 = phi i32 [ %84, %77 ], [ %58, %85 ]
br label %89
89: ; preds = %87, %62
%90 = phi i32 [ %65, %62 ], [ 0, %87 ]
%91 = phi i32 [ %57, %62 ], [ %72, %87 ]
%92 = phi i32 [ %58, %62 ], [ %88, %87 ]
store i32 %90, i32* %8
%93 = icmp eq i32 %92, 0
br i1 %93, label %94, label %56
94: ; preds = %89, %30
ret i32 0
}