#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*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ readerror(char *);
int /*<<< orphan*/ sscanf(char *, char *, int *, ...);
int /*<<< orphan*/ *stderr;
int main(int argc, char **argv) {
  char buf[65536], buf2[512], buf3[512], buf4[512];
  FILE *inp, *out;
  int i, j, k, natoms, nx, ny, nz, nx1, ny1, nz1, counter;
  if (argc != 3) {
    fprintf(stderr, "usage: %s in.cube out.cube\n", argv[0]);
    return 1;
  }
  inp = fopen(argv[1], "r");
  if (!inp) {
    fprintf(stderr, "cannot open cube input file %s for reading.\n", argv[1]);
    return 2;
  }
  out = fopen(argv[2], "w");
  if (!out) {
    fprintf(stderr, "cannot open cube output file %s for writing.\n", argv[2]);
    return 3;
  }
  for (i = 0; i < 3; i++) {
    if (!fgets(buf, 65536, inp))
      readerror(argv[1]);
    fputs(buf, out);
  }
  sscanf(buf, "%d", &natoms);
  if (!fgets(buf, 65536, inp))
    readerror(argv[1]);
  sscanf(buf, "%d%512s%512s%512s", &nx, buf2, buf3, buf4);
  fprintf(out, " %d %s %s %s\n", nx - 1, buf2, buf3, buf4);
  if (!fgets(buf, 65536, inp))
    readerror(argv[1]);
  sscanf(buf, "%d%512s%512s%512s", &ny, buf2, buf3, buf4);
  fprintf(out, " %d %s %s %s\n", ny - 1, buf2, buf3, buf4);
  if (!fgets(buf, 65536, inp))
    readerror(argv[1]);
  sscanf(buf, "%d%512s%512s%512s", &nz, buf2, buf3, buf4);
  fprintf(out, " %d %s %s %s\n", nz - 1, buf2, buf3, buf4);
  for (i = 0; i < natoms; i++) {
    if (!fgets(buf, 65536, inp))
      readerror(argv[1]);
    fputs(buf, out);
  }
  counter = 0;
  nx1 = nx - 1;
  ny1 = ny - 1;
  nz1 = nz - 1;
  for (i = 0; i < nx; i++) {
    for (j = 0; j < ny; j++) {
      for (k = 0; k < nz; k++) {
        fscanf(inp, "%512s", buf2);
        if (i != nx1 && j != ny1 && k != nz1) {
          fprintf(out, " %s", buf2);
        }
        counter++;
        if (counter == 6) {
          fputs("\n", out);
          counter = 0;
        }
      }
      if (counter != 0) {
        fputs("\n", out);
        counter = 0;
      }
    }
  }
  fclose(out);
  fclose(inp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10650,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     11ce <main+0x4e>
mov    0x2e36(%rip),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe45(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    16eb <main+0x56b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe3f(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x10618(%rbp)
cmpq   $0x0,-0x10618(%rbp)
jne    1223 <main+0xa3>
mov    0x2de2(%rip),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xe0e(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x2,-0x4(%rbp)
jmp    16eb <main+0x56b>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe19(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x10620(%rbp)
cmpq   $0x0,-0x10620(%rbp)
jne    1278 <main+0xf8>
mov    0x2d8d(%rip),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdx
lea    0xde8(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x3,-0x4(%rbp)
jmp    16eb <main+0x56b>
movl   $0x0,-0x10624(%rbp)
cmpl   $0x3,-0x10624(%rbp)
jge    12e4 <main+0x164>
lea    -0x10010(%rbp),%rdi
mov    -0x10618(%rbp),%rdx
mov    $0x10000,%esi
call   1060 <fgets@plt>
cmp    $0x0,%eax
jne    12bd <main+0x13d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10a0 <readerror@plt>
lea    -0x10010(%rbp),%rdi
mov    -0x10620(%rbp),%rsi
call   1040 <fputs@plt>
mov    -0x10624(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10624(%rbp)
jmp    1282 <main+0x102>
lea    -0x10010(%rbp),%rdi
lea    0xd89(%rip),%rsi
lea    -0x10630(%rbp),%rdx
mov    $0x0,%al
call   1080 <sscanf@plt>
lea    -0x10010(%rbp),%rdi
mov    -0x10618(%rbp),%rdx
mov    $0x10000,%esi
call   1060 <fgets@plt>
cmp    $0x0,%eax
jne    132e <main+0x1ae>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10a0 <readerror@plt>
lea    -0x10010(%rbp),%rdi
lea    -0x10210(%rbp),%rcx
lea    -0x10410(%rbp),%r8
lea    -0x10610(%rbp),%r9
lea    0xd2d(%rip),%rsi
lea    -0x10634(%rbp),%rdx
mov    $0x0,%al
call   1080 <sscanf@plt>
mov    -0x10620(%rbp),%rdi
mov    -0x10634(%rbp),%edx
sub    $0x1,%edx
lea    -0x10210(%rbp),%rcx
lea    -0x10410(%rbp),%r8
lea    -0x10610(%rbp),%r9
lea    0xd05(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
lea    -0x10010(%rbp),%rdi
mov    -0x10618(%rbp),%rdx
mov    $0x10000,%esi
call   1060 <fgets@plt>
cmp    $0x0,%eax
jne    13c0 <main+0x240>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10a0 <readerror@plt>
lea    -0x10010(%rbp),%rdi
lea    -0x10210(%rbp),%rcx
lea    -0x10410(%rbp),%r8
lea    -0x10610(%rbp),%r9
lea    0xc9b(%rip),%rsi
lea    -0x10638(%rbp),%rdx
mov    $0x0,%al
call   1080 <sscanf@plt>
mov    -0x10620(%rbp),%rdi
mov    -0x10638(%rbp),%edx
sub    $0x1,%edx
lea    -0x10210(%rbp),%rcx
lea    -0x10410(%rbp),%r8
lea    -0x10610(%rbp),%r9
lea    0xc73(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
lea    -0x10010(%rbp),%rdi
mov    -0x10618(%rbp),%rdx
mov    $0x10000,%esi
call   1060 <fgets@plt>
cmp    $0x0,%eax
jne    1452 <main+0x2d2>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10a0 <readerror@plt>
lea    -0x10010(%rbp),%rdi
lea    -0x10210(%rbp),%rcx
lea    -0x10410(%rbp),%r8
lea    -0x10610(%rbp),%r9
lea    0xc09(%rip),%rsi
lea    -0x1063c(%rbp),%rdx
mov    $0x0,%al
call   1080 <sscanf@plt>
mov    -0x10620(%rbp),%rdi
mov    -0x1063c(%rbp),%edx
sub    $0x1,%edx
lea    -0x10210(%rbp),%rcx
lea    -0x10410(%rbp),%r8
lea    -0x10610(%rbp),%r9
lea    0xbe1(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x0,-0x10624(%rbp)
mov    -0x10624(%rbp),%eax
cmp    -0x10630(%rbp),%eax
jge    1527 <main+0x3a7>
lea    -0x10010(%rbp),%rdi
mov    -0x10618(%rbp),%rdx
mov    $0x10000,%esi
call   1060 <fgets@plt>
cmp    $0x0,%eax
jne    1500 <main+0x380>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10a0 <readerror@plt>
lea    -0x10010(%rbp),%rdi
mov    -0x10620(%rbp),%rsi
call   1040 <fputs@plt>
mov    -0x10624(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10624(%rbp)
jmp    14c0 <main+0x340>
movl   $0x0,-0x1064c(%rbp)
mov    -0x10634(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10640(%rbp)
mov    -0x10638(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10644(%rbp)
mov    -0x1063c(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10648(%rbp)
movl   $0x0,-0x10624(%rbp)
mov    -0x10624(%rbp),%eax
cmp    -0x10634(%rbp),%eax
jge    16cc <main+0x54c>
movl   $0x0,-0x10628(%rbp)
mov    -0x10628(%rbp),%eax
cmp    -0x10638(%rbp),%eax
jge    16b3 <main+0x533>
movl   $0x0,-0x1062c(%rbp)
mov    -0x1062c(%rbp),%eax
cmp    -0x1063c(%rbp),%eax
jge    1670 <main+0x4f0>
mov    -0x10618(%rbp),%rdi
lea    -0x10210(%rbp),%rdx
lea    0xac3(%rip),%rsi
call   1050 <fscanf@plt>
mov    -0x10624(%rbp),%eax
cmp    -0x10640(%rbp),%eax
je     161e <main+0x49e>
mov    -0x10628(%rbp),%eax
cmp    -0x10644(%rbp),%eax
je     161e <main+0x49e>
mov    -0x1062c(%rbp),%eax
cmp    -0x10648(%rbp),%eax
je     161e <main+0x49e>
mov    -0x10620(%rbp),%rdi
lea    -0x10210(%rbp),%rdx
lea    0xa87(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x1064c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1064c(%rbp)
cmpl   $0x6,-0x1064c(%rbp)
jne    1657 <main+0x4d7>
mov    -0x10620(%rbp),%rsi
lea    0xa01(%rip),%rdi
call   1040 <fputs@plt>
movl   $0x0,-0x1064c(%rbp)
jmp    165c <main+0x4dc>
mov    -0x1062c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1062c(%rbp)
jmp    15a0 <main+0x420>
cmpl   $0x0,-0x1064c(%rbp)
je     169a <main+0x51a>
mov    -0x10620(%rbp),%rsi
lea    0x9be(%rip),%rdi
call   1040 <fputs@plt>
movl   $0x0,-0x1064c(%rbp)
jmp    169f <main+0x51f>
mov    -0x10628(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10628(%rbp)
jmp    1584 <main+0x404>
jmp    16b8 <main+0x538>
mov    -0x10624(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10624(%rbp)
jmp    1568 <main+0x3e8>
mov    -0x10620(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x10618(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10650,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10648,%rsp
mov    %rsi,%r14
cmp    $0x3,%edi
jne    1457 <main+0x2c7>
mov    0x8(%r14),%rdi
lea    0xe64(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     15b9 <main+0x429>
mov    %rax,%rbp
mov    0x10(%r14),%rdi
lea    0xe77(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     15dc <main+0x44c>
mov    %rax,%r15
lea    0x640(%rsp),%rdi
mov    $0x10000,%esi
mov    %rbp,%rdx
call   1070 <fgets@plt>
test   %eax,%eax
jne    1207 <main+0x77>
mov    0x8(%r14),%rdi
call   10b0 <readerror@plt>
lea    0x640(%rsp),%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <fputs@plt>
mov    %rbx,%rdi
mov    $0x10000,%esi
mov    %rbp,%rdx
call   1070 <fgets@plt>
test   %eax,%eax
jne    1237 <main+0xa7>
mov    0x8(%r14),%rdi
call   10b0 <readerror@plt>
lea    0x640(%rsp),%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <fputs@plt>
mov    %rbx,%rdi
mov    $0x10000,%esi
mov    %rbp,%rdx
call   1070 <fgets@plt>
test   %eax,%eax
jne    1267 <main+0xd7>
mov    0x8(%r14),%rdi
call   10b0 <readerror@plt>
lea    0x640(%rsp),%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <fputs@plt>
lea    0xdfa(%rip),%rsi
lea    0x24(%rsp),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1090 <sscanf@plt>
mov    %rbx,%rdi
mov    $0x10000,%esi
mov    %rbp,%rdx
call   1070 <fgets@plt>
test   %eax,%eax
jne    12ad <main+0x11d>
mov    0x8(%r14),%rdi
call   10b0 <readerror@plt>
lea    0xdca(%rip),%rsi
lea    0x640(%rsp),%rdi
lea    0x14(%rsp),%rdx
lea    0x40(%rsp),%rbx
lea    0x440(%rsp),%r12
lea    0x240(%rsp),%r13
mov    %rbx,%rcx
mov    %r12,%r8
mov    %r13,%r9
xor    %eax,%eax
call   1090 <sscanf@plt>
mov    0x14(%rsp),%edx
add    $0xffffffff,%edx
lea    0xd9c(%rip),%rsi
mov    %r15,%rdi
mov    %rbx,%rcx
mov    %r12,%r8
mov    %r13,%r9
xor    %eax,%eax
call   1080 <fprintf@plt>
lea    0x640(%rsp),%rdi
mov    $0x10000,%esi
mov    %rbp,%rdx
call   1070 <fgets@plt>
test   %eax,%eax
jne    1329 <main+0x199>
mov    0x8(%r14),%rdi
call   10b0 <readerror@plt>
lea    0xd4e(%rip),%rsi
lea    0x640(%rsp),%rdi
lea    0x10(%rsp),%rdx
lea    0x40(%rsp),%r12
lea    0x440(%rsp),%rbx
lea    0x240(%rsp),%r13
mov    %r12,%rcx
mov    %rbx,%r8
mov    %r13,%r9
xor    %eax,%eax
call   1090 <sscanf@plt>
mov    0x10(%rsp),%edx
add    $0xffffffff,%edx
lea    0xd20(%rip),%rsi
mov    %r15,%rdi
mov    %r12,%rcx
mov    %rbx,%r8
mov    %r13,%r9
xor    %eax,%eax
call   1080 <fprintf@plt>
lea    0x640(%rsp),%rdi
mov    $0x10000,%esi
mov    %r15,%r12
mov    %rbp,0x28(%rsp)
mov    %rbp,%rdx
call   1070 <fgets@plt>
test   %eax,%eax
jne    13ad <main+0x21d>
mov    0x8(%r14),%rdi
call   10b0 <readerror@plt>
lea    0xcca(%rip),%rsi
xor    %ebp,%ebp
lea    0x640(%rsp),%rdi
lea    0x8(%rsp),%rdx
lea    0x40(%rsp),%rbx
lea    0x440(%rsp),%r15
lea    0x240(%rsp),%r13
mov    %rbx,%rcx
mov    %r15,%r8
mov    %r13,%r9
xor    %eax,%eax
call   1090 <sscanf@plt>
mov    0x8(%rsp),%edx
add    $0xffffffff,%edx
lea    0xc9a(%rip),%rsi
mov    %r12,0x18(%rsp)
mov    %r12,%rdi
mov    %rbx,%rcx
mov    %r15,%r8
mov    %r13,%r9
xor    %eax,%eax
call   1080 <fprintf@plt>
cmpl   $0x0,0x24(%rsp)
jle    147c <main+0x2ec>
lea    0x640(%rsp),%rbx
jmp    1436 <main+0x2a6>
nop
mov    %rbx,%rdi
mov    0x18(%rsp),%rsi
call   1040 <fputs@plt>
add    $0x1,%ebp
cmp    0x24(%rsp),%ebp
jge    147c <main+0x2ec>
mov    %rbx,%rdi
mov    $0x10000,%esi
mov    0x28(%rsp),%rdx
call   1070 <fgets@plt>
test   %eax,%eax
jne    1420 <main+0x290>
mov    0x8(%r14),%rdi
call   10b0 <readerror@plt>
jmp    1420 <main+0x290>
mov    0x2b82(%rip),%rax
mov    (%rax),%rdi
mov    (%r14),%rdx
lea    0xb95(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0x1,%eax
jmp    15fd <main+0x46d>
mov    0x14(%rsp),%eax
test   %eax,%eax
jle    15a1 <main+0x411>
lea    -0x1(%rax),%ecx
mov    %ecx,0x38(%rsp)
mov    0x10(%rsp),%ecx
lea    -0x1(%rcx),%edx
mov    %edx,0x34(%rsp)
mov    0x8(%rsp),%ebp
add    $0xffffffff,%ebp
lea    0x40(%rsp),%r15
movl   $0x0,0xc(%rsp)
jmp    14c7 <main+0x337>
mov    0x14(%rsp),%eax
mov    0xc(%rsp),%edx
add    $0x1,%edx
mov    %edx,0xc(%rsp)
cmp    %eax,%edx
jge    15a1 <main+0x411>
test   %ecx,%ecx
jle    14b4 <main+0x324>
xor    %ebx,%ebx
jmp    14db <main+0x34b>
nop
add    $0x1,%ebx
mov    0x10(%rsp),%ecx
cmp    %ecx,%ebx
jge    14b0 <main+0x320>
cmpl   $0x0,0x8(%rsp)
jle    14d0 <main+0x340>
mov    0xc(%rsp),%eax
cmp    0x38(%rsp),%eax
sete   %al
mov    %ebx,0x3c(%rsp)
cmp    0x34(%rsp),%ebx
sete   %r14b
or     %al,%r14b
xor    %r13d,%r13d
xor    %r12d,%r12d
jmp    1525 <main+0x395>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%r13d
cmp    $0x6,%r13d
je     1560 <main+0x3d0>
add    $0x1,%r12d
cmp    0x8(%rsp),%r12d
jge    1580 <main+0x3f0>
mov    0x28(%rsp),%rdi
lea    0xb59(%rip),%rsi
mov    %r15,%rdx
call   1050 <fscanf@plt>
cmp    %r12d,%ebp
sete   %al
or     %r14b,%al
jne    1510 <main+0x380>
mov    0x18(%rsp),%rdi
lea    0xb4e(%rip),%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
jmp    1510 <main+0x380>
nopl   0x0(%rax)
mov    $0xa,%edi
mov    0x18(%rsp),%rsi
call   1060 <fputc@plt>
xor    %r13d,%r13d
jmp    151a <main+0x38a>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
test   %r13d,%r13d
mov    0x3c(%rsp),%ebx
je     14d0 <main+0x340>
mov    $0xa,%edi
mov    0x18(%rsp),%rsi
call   1060 <fputc@plt>
jmp    14d0 <main+0x340>
mov    0x18(%rsp),%rdi
call   1030 <fclose@plt>
mov    0x28(%rsp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
jmp    15fd <main+0x46d>
mov    0x2a20(%rip),%rax
mov    (%rax),%rdi
mov    0x8(%r14),%rdx
lea    0xa50(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0x2,%eax
jmp    15fd <main+0x46d>
mov    0x29fd(%rip),%rax
mov    (%rax),%rdi
mov    0x10(%r14),%rdx
lea    0xa5c(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0x3,%eax
add    $0x10648,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32* null
@.str = [28 x i8] c"usage: %s in.cube out.cube\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [45 x i8] c"cannot open cube input file %s for reading.\0A\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [46 x i8] c"cannot open cube output file %s for writing.\0A\00"
@.str.5 = [3 x i8] c"%d\00"
@.str.6 = [18 x i8] c"%d%512s%512s%512s\00"
@.str.7 = [14 x i8] c" %d %s %s %s\0A\00"
@.str.8 = [6 x i8] c"%512s\00"
@.str.9 = [4 x i8] c" %s\00"
@.str.10 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [65536 x i8]
%7 = alloca [512 x i8]
%8 = alloca [512 x i8]
%9 = alloca [512 x i8]
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%23 = load i32, i32* %4
%24 = icmp ne i32 %23, 3
br i1 %24, label %25, label %31
25: ; preds = %2
%26 = load i32*, i32** @stderr
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 0
%29 = load i8*, i8** %28
%30 = call i32 (i32*, i8*, ...) @fprintf(i32* %26, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %29)
store i32 1, i32* %3
br label %239
31: ; preds = %2
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 1
%34 = load i8*, i8** %33
%35 = call i32* @fopen(i8* %34, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %35, i32** %10
%36 = load i32*, i32** %10
%37 = icmp ne i32* %36, null
br i1 %37, label %44, label %38
38: ; preds = %31
%39 = load i32*, i32** @stderr
%40 = load i8**, i8*** %5
%41 = getelementptr inbounds i8*, i8** %40, i64 1
%42 = load i8*, i8** %41
%43 = call i32 (i32*, i8*, ...) @fprintf(i32* %39, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0), i8* %42)
store i32 2, i32* %3
br label %239
44: ; preds = %31
%45 = load i8**, i8*** %5
%46 = getelementptr inbounds i8*, i8** %45, i64 2
%47 = load i8*, i8** %46
%48 = call i32* @fopen(i8* %47, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %48, i32** %11
%49 = load i32*, i32** %11
%50 = icmp ne i32* %49, null
br i1 %50, label %57, label %51
51: ; preds = %44
%52 = load i32*, i32** @stderr
%53 = load i8**, i8*** %5
%54 = getelementptr inbounds i8*, i8** %53, i64 2
%55 = load i8*, i8** %54
%56 = call i32 (i32*, i8*, ...) @fprintf(i32* %52, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.4, i64 0, i64 0), i8* %55)
store i32 3, i32* %3
br label %239
57: ; preds = %44
store i32 0, i32* %12
br label %58
58: ; preds = %75, %57
%59 = load i32, i32* %12
%60 = icmp slt i32 %59, 3
br i1 %60, label %61, label %78
61: ; preds = %58
%62 = getelementptr inbounds [65536 x i8], [65536 x i8]* %6, i64 0, i64 0
%63 = load i32*, i32** %10
%64 = call i32 @fgets(i8* %62, i32 65536, i32* %63)
%65 = icmp ne i32 %64, 0
br i1 %65, label %71, label %66
66: ; preds = %61
%67 = load i8**, i8*** %5
%68 = getelementptr inbounds i8*, i8** %67, i64 1
%69 = load i8*, i8** %68
%70 = call i32 @readerror(i8* %69)
br label %71
71: ; preds = %66, %61
%72 = getelementptr inbounds [65536 x i8], [65536 x i8]* %6, i64 0, i64 0
%73 = load i32*, i32** %11
%74 = call i32 @fputs(i8* %72, i32* %73)
br label %75
75: ; preds = %71
%76 = load i32, i32* %12
%77 = add nsw i32 %76, 1
store i32 %77, i32* %12
br label %58
78: ; preds = %58
%79 = getelementptr inbounds [65536 x i8], [65536 x i8]* %6, i64 0, i64 0
%80 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %79, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %15)
%81 = getelementptr inbounds [65536 x i8], [65536 x i8]* %6, i64 0, i64 0
%82 = load i32*, i32** %10
%83 = call i32 @fgets(i8* %81, i32 65536, i32* %82)
%84 = icmp ne i32 %83, 0
br i1 %84, label %90, label %85
85: ; preds = %78
%86 = load i8**, i8*** %5
%87 = getelementptr inbounds i8*, i8** %86, i64 1
%88 = load i8*, i8** %87
%89 = call i32 @readerror(i8* %88)
br label %90
90: ; preds = %85, %78
%91 = getelementptr inbounds [65536 x i8], [65536 x i8]* %6, i64 0, i64 0
%92 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%93 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%94 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%95 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %91, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i32* %16, i8* %92, i8* %93, i8* %94)
%96 = load i32*, i32** %11
%97 = load i32, i32* %16
%98 = sub nsw i32 %97, 1
%99 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%100 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%101 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%102 = call i32 (i32*, i8*, ...) @fprintf(i32* %96, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i32 %98, i8* %99, i8* %100, i8* %101)
%103 = getelementptr inbounds [65536 x i8], [65536 x i8]* %6, i64 0, i64 0
%104 = load i32*, i32** %10
%105 = call i32 @fgets(i8* %103, i32 65536, i32* %104)
%106 = icmp ne i32 %105, 0
br i1 %106, label %112, label %107
107: ; preds = %90
%108 = load i8**, i8*** %5
%109 = getelementptr inbounds i8*, i8** %108, i64 1
%110 = load i8*, i8** %109
%111 = call i32 @readerror(i8* %110)
br label %112
112: ; preds = %107, %90
%113 = getelementptr inbounds [65536 x i8], [65536 x i8]* %6, i64 0, i64 0
%114 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%115 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%116 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%117 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %113, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i32* %17, i8* %114, i8* %115, i8* %116)
%118 = load i32*, i32** %11
%119 = load i32, i32* %17
%120 = sub nsw i32 %119, 1
%121 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%122 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%123 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%124 = call i32 (i32*, i8*, ...) @fprintf(i32* %118, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i32 %120, i8* %121, i8* %122, i8* %123)
%125 = getelementptr inbounds [65536 x i8], [65536 x i8]* %6, i64 0, i64 0
%126 = load i32*, i32** %10
%127 = call i32 @fgets(i8* %125, i32 65536, i32* %126)
%128 = icmp ne i32 %127, 0
br i1 %128, label %134, label %129
129: ; preds = %112
%130 = load i8**, i8*** %5
%131 = getelementptr inbounds i8*, i8** %130, i64 1
%132 = load i8*, i8** %131
%133 = call i32 @readerror(i8* %132)
br label %134
134: ; preds = %129, %112
%135 = getelementptr inbounds [65536 x i8], [65536 x i8]* %6, i64 0, i64 0
%136 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%137 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%138 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%139 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %135, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i32* %18, i8* %136, i8* %137, i8* %138)
%140 = load i32*, i32** %11
%141 = load i32, i32* %18
%142 = sub nsw i32 %141, 1
%143 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%144 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%145 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%146 = call i32 (i32*, i8*, ...) @fprintf(i32* %140, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i32 %142, i8* %143, i8* %144, i8* %145)
store i32 0, i32* %12
br label %147
147: ; preds = %165, %134
%148 = load i32, i32* %12
%149 = load i32, i32* %15
%150 = icmp slt i32 %148, %149
br i1 %150, label %151, label %168
151: ; preds = %147
%152 = getelementptr inbounds [65536 x i8], [65536 x i8]* %6, i64 0, i64 0
%153 = load i32*, i32** %10
%154 = call i32 @fgets(i8* %152, i32 65536, i32* %153)
%155 = icmp ne i32 %154, 0
br i1 %155, label %161, label %156
156: ; preds = %151
%157 = load i8**, i8*** %5
%158 = getelementptr inbounds i8*, i8** %157, i64 1
%159 = load i8*, i8** %158
%160 = call i32 @readerror(i8* %159)
br label %161
161: ; preds = %156, %151
%162 = getelementptr inbounds [65536 x i8], [65536 x i8]* %6, i64 0, i64 0
%163 = load i32*, i32** %11
%164 = call i32 @fputs(i8* %162, i32* %163)
br label %165
165: ; preds = %161
%166 = load i32, i32* %12
%167 = add nsw i32 %166, 1
store i32 %167, i32* %12
br label %147
168: ; preds = %147
store i32 0, i32* %22
%169 = load i32, i32* %16
%170 = sub nsw i32 %169, 1
store i32 %170, i32* %19
%171 = load i32, i32* %17
%172 = sub nsw i32 %171, 1
store i32 %172, i32* %20
%173 = load i32, i32* %18
%174 = sub nsw i32 %173, 1
store i32 %174, i32* %21
store i32 0, i32* %12
br label %175
175: ; preds = %231, %168
%176 = load i32, i32* %12
%177 = load i32, i32* %16
%178 = icmp slt i32 %176, %177
br i1 %178, label %179, label %234
179: ; preds = %175
store i32 0, i32* %13
br label %180
180: ; preds = %227, %179
%181 = load i32, i32* %13
%182 = load i32, i32* %17
%183 = icmp slt i32 %181, %182
br i1 %183, label %184, label %230
184: ; preds = %180
store i32 0, i32* %14
br label %185
185: ; preds = %217, %184
%186 = load i32, i32* %14
%187 = load i32, i32* %18
%188 = icmp slt i32 %186, %187
br i1 %188, label %189, label %220
189: ; preds = %185
%190 = load i32*, i32** %10
%191 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%192 = call i32 @fscanf(i32* %190, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i8* %191)
%193 = load i32, i32* %12
%194 = load i32, i32* %19
%195 = icmp ne i32 %193, %194
br i1 %195, label %196, label %208
196: ; preds = %189
%197 = load i32, i32* %13
%198 = load i32, i32* %20
%199 = icmp ne i32 %197, %198
br i1 %199, label %200, label %208
200: ; preds = %196
%201 = load i32, i32* %14
%202 = load i32, i32* %21
%203 = icmp ne i32 %201, %202
br i1 %203, label %204, label %208
204: ; preds = %200
%205 = load i32*, i32** %11
%206 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%207 = call i32 (i32*, i8*, ...) @fprintf(i32* %205, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8* %206)
br label %208
208: ; preds = %204, %200, %196, %189
%209 = load i32, i32* %22
%210 = add nsw i32 %209, 1
store i32 %210, i32* %22
%211 = load i32, i32* %22
%212 = icmp eq i32 %211, 6
br i1 %212, label %213, label %216
213: ; preds = %208
%214 = load i32*, i32** %11
%215 = call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0), i32* %214)
store i32 0, i32* %22
br label %216
216: ; preds = %213, %208
br label %217
217: ; preds = %216
%218 = load i32, i32* %14
%219 = add nsw i32 %218, 1
store i32 %219, i32* %14
br label %185
220: ; preds = %185
%221 = load i32, i32* %22
%222 = icmp ne i32 %221, 0
br i1 %222, label %223, label %226
223: ; preds = %220
%224 = load i32*, i32** %11
%225 = call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0), i32* %224)
store i32 0, i32* %22
br label %226
226: ; preds = %223, %220
br label %227
227: ; preds = %226
%228 = load i32, i32* %13
%229 = add nsw i32 %228, 1
store i32 %229, i32* %13
br label %180
230: ; preds = %180
br label %231
231: ; preds = %230
%232 = load i32, i32* %12
%233 = add nsw i32 %232, 1
store i32 %233, i32* %12
br label %175
234: ; preds = %175
%235 = load i32*, i32** %11
%236 = call i32 @fclose(i32* %235)
%237 = load i32*, i32** %10
%238 = call i32 @fclose(i32* %237)
store i32 0, i32* %3
br label %239
239: ; preds = %234, %51, %38, %25
%240 = load i32, i32* %3
ret i32 %240
}

LLVM IR (-O2):
@stderr = global i32* null
@.str = [28 x i8] c"usage: %s in.cube out.cube\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [45 x i8] c"cannot open cube input file %s for reading.\0A\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [46 x i8] c"cannot open cube output file %s for writing.\0A\00"
@.str.5 = [3 x i8] c"%d\00"
@.str.6 = [18 x i8] c"%d%512s%512s%512s\00"
@.str.7 = [14 x i8] c" %d %s %s %s\0A\00"
@.str.8 = [6 x i8] c"%512s\00"
@.str.9 = [4 x i8] c" %s\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [65536 x i8]
%4 = alloca [512 x i8]
%5 = alloca [512 x i8]
%6 = alloca [512 x i8]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = getelementptr inbounds [65536 x i8], [65536 x i8]* %3, i64 0, i64 0
%12 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%13 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%14 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%15 = bitcast i32* %7 to i8*
%16 = bitcast i32* %8 to i8*
%17 = bitcast i32* %9 to i8*
%18 = bitcast i32* %10 to i8*
%19 = icmp eq i32 %0, 3
br i1 %19, label %24, label %20
20: ; preds = %2
%21 = load i32*, i32** @stderr
%22 = load i8*, i8** %1
%23 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %21, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %22)
br label %167
24: ; preds = %2
%25 = getelementptr inbounds i8*, i8** %1, i64 1
%26 = load i8*, i8** %25
%27 = tail call i32* @fopen(i8* %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%28 = icmp eq i32* %27, null
br i1 %28, label %29, label %33
29: ; preds = %24
%30 = load i32*, i32** @stderr
%31 = load i8*, i8** %25
%32 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %30, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0), i8* %31)
br label %167
33: ; preds = %24
%34 = getelementptr inbounds i8*, i8** %1, i64 2
%35 = load i8*, i8** %34
%36 = tail call i32* @fopen(i8* %35, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%37 = icmp eq i32* %36, null
br i1 %37, label %41, label %38
38: ; preds = %33
%39 = call i32 @fgets(i8* %11, i32 65536, i32* %27)
%40 = icmp eq i32 %39, 0
br i1 %40, label %45, label %48
41: ; preds = %33
%42 = load i32*, i32** @stderr
%43 = load i8*, i8** %34
%44 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %42, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.4, i64 0, i64 0), i8* %43)
br label %167
45: ; preds = %38
%46 = load i8*, i8** %25
%47 = call i32 @readerror(i8* %46)
br label %48
48: ; preds = %45, %38
%49 = call i32 @fputs(i8* %11, i32* %36)
%50 = call i32 @fgets(i8* %11, i32 65536, i32* %27)
%51 = icmp eq i32 %50, 0
br i1 %51, label %52, label %55
52: ; preds = %48
%53 = load i8*, i8** %25
%54 = call i32 @readerror(i8* %53)
br label %55
55: ; preds = %52, %48
%56 = call i32 @fputs(i8* %11, i32* %36)
%57 = call i32 @fgets(i8* %11, i32 65536, i32* %27)
%58 = icmp eq i32 %57, 0
br i1 %58, label %59, label %62
59: ; preds = %55
%60 = load i8*, i8** %25
%61 = call i32 @readerror(i8* %60)
br label %62
62: ; preds = %59, %55
%63 = call i32 @fputs(i8* %11, i32* %36)
%64 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %7)
%65 = call i32 @fgets(i8* %11, i32 65536, i32* %27)
%66 = icmp eq i32 %65, 0
br i1 %66, label %67, label %70
67: ; preds = %62
%68 = load i8*, i8** %25
%69 = call i32 @readerror(i8* %68)
br label %70
70: ; preds = %67, %62
%71 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %11, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i32* %8, i8* %12, i8* %13, i8* %14)
%72 = load i32, i32* %8
%73 = add nsw i32 %72, -1
%74 = call i32 (i32*, i8*, ...) @fprintf(i32* %36, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i32 %73, i8* %12, i8* %13, i8* %14)
%75 = call i32 @fgets(i8* %11, i32 65536, i32* %27)
%76 = icmp eq i32 %75, 0
br i1 %76, label %77, label %80
77: ; preds = %70
%78 = load i8*, i8** %25
%79 = call i32 @readerror(i8* %78)
br label %80
80: ; preds = %77, %70
%81 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %11, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i32* %9, i8* %12, i8* %13, i8* %14)
%82 = load i32, i32* %9
%83 = add nsw i32 %82, -1
%84 = call i32 (i32*, i8*, ...) @fprintf(i32* %36, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i32 %83, i8* %12, i8* %13, i8* %14)
%85 = call i32 @fgets(i8* %11, i32 65536, i32* %27)
%86 = icmp eq i32 %85, 0
br i1 %86, label %87, label %90
87: ; preds = %80
%88 = load i8*, i8** %25
%89 = call i32 @readerror(i8* %88)
br label %90
90: ; preds = %87, %80
%91 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %11, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i32* %10, i8* %12, i8* %13, i8* %14)
%92 = load i32, i32* %10
%93 = add nsw i32 %92, -1
%94 = call i32 (i32*, i8*, ...) @fprintf(i32* %36, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i32 %93, i8* %12, i8* %13, i8* %14)
%95 = load i32, i32* %7
%96 = icmp sgt i32 %95, 0
br i1 %96, label %97, label %109
97: ; preds = %90, %104
%98 = phi i32 [ %106, %104 ], [ 0, %90 ]
%99 = call i32 @fgets(i8* %11, i32 65536, i32* %27)
%100 = icmp eq i32 %99, 0
br i1 %100, label %101, label %104
101: ; preds = %97
%102 = load i8*, i8** %25
%103 = call i32 @readerror(i8* %102)
br label %104
104: ; preds = %101, %97
%105 = call i32 @fputs(i8* %11, i32* %36)
%106 = add nuw nsw i32 %98, 1
%107 = load i32, i32* %7
%108 = icmp slt i32 %106, %107
br i1 %108, label %97, label %109
109: ; preds = %104, %90
%110 = load i32, i32* %8
%111 = add nsw i32 %110, -1
%112 = load i32, i32* %9
%113 = add nsw i32 %112, -1
%114 = load i32, i32* %10
%115 = add nsw i32 %114, -1
%116 = icmp sgt i32 %110, 0
br i1 %116, label %117, label %164
117: ; preds = %109, %159
%118 = phi i32 [ %160, %159 ], [ %110, %109 ]
%119 = phi i32 [ %161, %159 ], [ %112, %109 ]
%120 = phi i32 [ %162, %159 ], [ 0, %109 ]
%121 = icmp sgt i32 %119, 0
br i1 %121, label %122, label %159
122: ; preds = %117
%123 = icmp eq i32 %120, %111
br label %124
124: ; preds = %122, %153
%125 = phi i32 [ 0, %122 ], [ %154, %153 ]
%126 = load i32, i32* %10
%127 = icmp sgt i32 %126, 0
br i1 %127, label %128, label %153
128: ; preds = %124
%129 = icmp eq i32 %125, %113
%130 = select i1 %123, i1 true, i1 %129
br label %131
131: ; preds = %128, %144
%132 = phi i32 [ 0, %128 ], [ %145, %144 ]
%133 = phi i32 [ 0, %128 ], [ %146, %144 ]
%134 = call i32 @fscanf(i32* %27, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i8* %12)
%135 = icmp eq i32 %133, %115
%136 = select i1 %130, i1 true, i1 %135
br i1 %136, label %139, label %137
137: ; preds = %131
%138 = call i32 (i32*, i8*, ...) @fprintf(i32* %36, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8* %12)
br label %139
139: ; preds = %137, %131
%140 = add nsw i32 %132, 1
%141 = icmp eq i32 %140, 6
br i1 %141, label %142, label %144
142: ; preds = %139
%143 = call i32 @fputc(i32 10, i32* %36)
br label %144
144: ; preds = %139, %142
%145 = phi i32 [ 0, %142 ], [ %140, %139 ]
%146 = add nuw nsw i32 %133, 1
%147 = load i32, i32* %10
%148 = icmp slt i32 %146, %147
br i1 %148, label %131, label %149
149: ; preds = %144
%150 = icmp eq i32 %145, 0
br i1 %150, label %153, label %151
151: ; preds = %149
%152 = call i32 @fputc(i32 10, i32* %36)
br label %153
153: ; preds = %124, %149, %151
%154 = add nuw nsw i32 %125, 1
%155 = load i32, i32* %9
%156 = icmp slt i32 %154, %155
br i1 %156, label %124, label %157
157: ; preds = %153
%158 = load i32, i32* %8
br label %159
159: ; preds = %157, %117
%160 = phi i32 [ %158, %157 ], [ %118, %117 ]
%161 = phi i32 [ %155, %157 ], [ %119, %117 ]
%162 = add nuw nsw i32 %120, 1
%163 = icmp slt i32 %162, %160
br i1 %163, label %117, label %164
164: ; preds = %159, %109
%165 = call i32 @fclose(i32* %36)
%166 = call i32 @fclose(i32* %27)
br label %167
167: ; preds = %164, %41, %29, %20
%168 = phi i32 [ 1, %20 ], [ 0, %164 ], [ 3, %41 ], [ 2, %29 ]
ret i32 %168
}