#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 LIM;

/* Variables and functions */
int /*<<< orphan*/ blank(int **, int, int);
int ceil(int);
char getchar();
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int i, j;
  const int LIM = (6 + 2) - 1;
  int xword[(6 + 2)][(6 + 2)];
  int cellValue;
  int clueNum;
  int cellHeight;
  int row, col;
  char ch;
  char *blackRow = "+++++";
  char *numRow = "%02d  +";
  char *borderRow = "    +";
  char *emptyRow = "     ";
  for (i = 0; i < (6 + 2); i++)
    xword[0][i] = xword[LIM][i] = xword[i][0] = xword[i][LIM] = -1;
  printf("*** Knuth Crossword Exercise. ***\n\n");
  printf("Please enter %d rows of %d numbers.\n", (6 + 2) - 2, (6 + 2) - 2);
  printf("Separate with single spaces.\n");
  for (row = 1; row < LIM; row++) {
    col = 1;
    printf("\nRow %d: ", row);
    while ((ch = getchar()) != '\n') {
      if (ch == '1' || ch == '0')
        xword[row][col++] = ch - '0';
    }
    if (col != LIM) {
      printf("Input error.\n");
      return 1;
    }
  }
  for (j = 1; j < ceil((6 + 2) / 2.0); j++)
    for (i = j; i < (6 + 2) - j; i++) {
      blank(xword, j, i);
      blank(xword, (LIM)-j, i);
      blank(xword, i, j);
      blank(xword, i, (LIM)-j);
    }
  printf("\n");
  for (row = 0, clueNum = 1; row < (6 + 2); row++) {
    for (cellHeight = 0; cellHeight < 3; cellHeight++) {
      if ((cellHeight && row == LIM) || (cellHeight < 2 && !row))
        continue;
      printf("\n");
      for (col = 0; col < (6 + 2); col++) {
        cellValue = xword[row][col];
        if (cellValue == 1) {
          printf("%s", blackRow);
        } else if (!cellValue) {
          if (cellHeight == 2) {
            printf("%s", blackRow);
          } else if (!cellHeight &&
                     ((!xword[row + 1][col] && xword[row - 1][col]) ||
                      (!xword[row][col + 1] && xword[row][col - 1]))) {
            printf(numRow, clueNum++);
          } else
            printf("%s", borderRow);
        } else if (row != LIM && col != LIM) {
          if (cellHeight < 2) {
            if (!xword[row][col + 1])
              printf("%s", borderRow);
            else
              printf("%s", emptyRow);
          } else if (!xword[row + 1][col]) {
            printf("%s", blackRow);
          } else if (!xword[row][col + 1] || !xword[row + 1][col + 1]) {
            printf("%s", borderRow);
          } else {
            printf("%s", emptyRow);
          }
        }
      }
    }
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x150,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7,-0x10(%rbp)
lea    0xea0(%rip),%rax
mov    %rax,-0x130(%rbp)
lea    0xe98(%rip),%rax
mov    %rax,-0x138(%rbp)
lea    0xe92(%rip),%rax
mov    %rax,-0x140(%rbp)
lea    0xe8a(%rip),%rax
mov    %rax,-0x148(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    11fc <main+0xbc>
movslq -0x8(%rbp),%rcx
lea    -0x110(%rbp),%rax
shl    $0x5,%rcx
add    %rcx,%rax
movl   $0xffffffff,0x1c(%rax)
movslq -0x8(%rbp),%rcx
lea    -0x110(%rbp),%rax
shl    $0x5,%rcx
add    %rcx,%rax
movl   $0xffffffff,(%rax)
movslq -0x8(%rbp),%rax
movl   $0xffffffff,-0x30(%rbp,%rax,4)
ff
movslq -0x8(%rbp),%rax
movl   $0xffffffff,-0x110(%rbp,%rax,4)
ff ff ff ff
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1198 <main+0x58>
lea    0xe17(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe2d(%rip),%rdi
mov    $0x6,%edx
mov    %edx,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe3d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x120(%rbp)
cmpl   $0x7,-0x120(%rbp)
jge    1316 <main+0x1d6>
movl   $0x1,-0x124(%rbp)
mov    -0x120(%rbp),%esi
lea    0xe26(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x125(%rbp)
movsbl %al,%eax
cmp    $0xa,%eax
je     12d6 <main+0x196>
movsbl -0x125(%rbp),%eax
cmp    $0x31,%eax
je     129b <main+0x15b>
movsbl -0x125(%rbp),%eax
cmp    $0x30,%eax
jne    12d1 <main+0x191>
movsbl -0x125(%rbp),%edx
sub    $0x30,%edx
movslq -0x120(%rbp),%rcx
lea    -0x110(%rbp),%rax
shl    $0x5,%rcx
add    %rcx,%rax
mov    -0x124(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x124(%rbp)
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
jmp    1262 <main+0x122>
cmpl   $0x7,-0x124(%rbp)
je     12fd <main+0x1bd>
lea    0xda1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    17ba <main+0x67a>
jmp    1302 <main+0x1c2>
mov    -0x120(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x120(%rbp)
jmp    1237 <main+0xf7>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14c(%rbp)
mov    $0x4,%edi
call   1030 <ceil@plt>
mov    %eax,%ecx
mov    -0x14c(%rbp),%eax
cmp    %ecx,%eax
jge    13cc <main+0x28c>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x8,%ecx
sub    -0xc(%rbp),%ecx
cmp    %ecx,%eax
jge    13b9 <main+0x279>
lea    -0x110(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1060 <blank@plt>
lea    -0x110(%rbp),%rdi
mov    $0x7,%esi
sub    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1060 <blank@plt>
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1060 <blank@plt>
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    $0x7,%edx
sub    -0xc(%rbp),%edx
call   1060 <blank@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1346 <main+0x206>
jmp    13be <main+0x27e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    131d <main+0x1dd>
lea    0xc69(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x120(%rbp)
movl   $0x1,-0x118(%rbp)
cmpl   $0x8,-0x120(%rbp)
jge    17a5 <main+0x665>
movl   $0x0,-0x11c(%rbp)
cmpl   $0x3,-0x11c(%rbp)
jge    178c <main+0x64c>
cmpl   $0x0,-0x11c(%rbp)
je     142c <main+0x2ec>
cmpl   $0x7,-0x120(%rbp)
je     1446 <main+0x306>
cmpl   $0x2,-0x11c(%rbp)
jge    144b <main+0x30b>
cmpl   $0x0,-0x120(%rbp)
jne    144b <main+0x30b>
jmp    1778 <main+0x638>
lea    0xbea(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x124(%rbp)
cmpl   $0x8,-0x124(%rbp)
jge    1773 <main+0x633>
movslq -0x120(%rbp),%rcx
lea    -0x110(%rbp),%rax
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0x124(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x114(%rbp)
cmpl   $0x1,-0x114(%rbp)
jne    14bc <main+0x37c>
mov    -0x130(%rbp),%rsi
lea    0xbe9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    175a <main+0x61a>
cmpl   $0x0,-0x114(%rbp)
jne    15ec <main+0x4ac>
cmpl   $0x2,-0x11c(%rbp)
jne    14f0 <main+0x3b0>
mov    -0x130(%rbp),%rsi
lea    0xbb5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    15e7 <main+0x4a7>
cmpl   $0x0,-0x11c(%rbp)
jne    15cd <main+0x48d>
mov    -0x120(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rcx
lea    -0x110(%rbp),%rax
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0x124(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    1553 <main+0x413>
mov    -0x120(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    -0x110(%rbp),%rax
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0x124(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    15a9 <main+0x469>
movslq -0x120(%rbp),%rcx
lea    -0x110(%rbp),%rax
shl    $0x5,%rcx
add    %rcx,%rax
mov    -0x124(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    15cd <main+0x48d>
movslq -0x120(%rbp),%rcx
lea    -0x110(%rbp),%rax
shl    $0x5,%rcx
add    %rcx,%rax
mov    -0x124(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     15cd <main+0x48d>
mov    -0x138(%rbp),%rdi
mov    -0x118(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x118(%rbp)
mov    $0x0,%al
call   1040 <printf@plt>
jmp    15e2 <main+0x4a2>
mov    -0x140(%rbp),%rsi
lea    0xabe(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    15e7 <main+0x4a7>
jmp    1755 <main+0x615>
cmpl   $0x7,-0x120(%rbp)
je     1750 <main+0x610>
cmpl   $0x7,-0x124(%rbp)
je     1750 <main+0x610>
cmpl   $0x2,-0x11c(%rbp)
jge    1672 <main+0x532>
movslq -0x120(%rbp),%rcx
lea    -0x110(%rbp),%rax
shl    $0x5,%rcx
add    %rcx,%rax
mov    -0x124(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    1658 <main+0x518>
mov    -0x140(%rbp),%rsi
lea    0xa4d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    166d <main+0x52d>
mov    -0x148(%rbp),%rsi
lea    0xa33(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    174b <main+0x60b>
mov    -0x120(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rcx
lea    -0x110(%rbp),%rax
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0x124(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    16b7 <main+0x577>
mov    -0x130(%rbp),%rsi
lea    0x9ee(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1746 <main+0x606>
movslq -0x120(%rbp),%rcx
lea    -0x110(%rbp),%rax
shl    $0x5,%rcx
add    %rcx,%rax
mov    -0x124(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     1712 <main+0x5d2>
mov    -0x120(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rcx
lea    -0x110(%rbp),%rax
shl    $0x5,%rcx
add    %rcx,%rax
mov    -0x124(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    172c <main+0x5ec>
mov    -0x140(%rbp),%rsi
lea    0x979(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1741 <main+0x601>
mov    -0x148(%rbp),%rsi
lea    0x95f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1746 <main+0x606>
jmp    174b <main+0x60b>
jmp    1750 <main+0x610>
jmp    1755 <main+0x615>
jmp    175a <main+0x61a>
jmp    175f <main+0x61f>
mov    -0x124(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x124(%rbp)
jmp    1463 <main+0x323>
jmp    1778 <main+0x638>
mov    -0x11c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x11c(%rbp)
jmp    1405 <main+0x2c5>
jmp    1791 <main+0x651>
mov    -0x120(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x120(%rbp)
jmp    13ee <main+0x2ae>
lea    0x890(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x150,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x118,%rsp
movq   $0xffffffffffffffff,0x4c(%rsp)
ff ff
movq   $0xffffffffffffffff,0x6c(%rsp)
ff ff
movq   $0xffffffffffffffff,0x8c(%rsp)
movq   $0xffffffffffffffff,0xac(%rsp)
movq   $0xffffffffffffffff,0xcc(%rsp)
pcmpeqd %xmm0,%xmm0
movdqa %xmm0,0x10(%rsp)
movdqa %xmm0,0x20(%rsp)
movl   $0xffffffff,0x30(%rsp)
ff
movdqu %xmm0,0xec(%rsp)
movdqu %xmm0,0xfc(%rsp)
movl   $0xffffffff,0x10c(%rsp)
ff ff ff ff
lea    0xe69(%rip),%rdi
call   1040 <puts@plt>
lea    0xe2b(%rip),%rdi
mov    $0x6,%esi
mov    $0x6,%edx
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe68(%rip),%rdi
call   1040 <puts@plt>
lea    0xe2c(%rip),%rdi
mov    $0x1,%ebx
mov    $0x1,%esi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
call   1070 <getchar@plt>
cmp    $0xa,%al
jne    124b <main+0xeb>
jmp    1465 <main+0x305>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1070 <getchar@plt>
cmp    $0xa,%al
je     1267 <main+0x107>
mov    %eax,%ecx
and    $0xfe,%cl
cmp    $0x30,%cl
jne    1240 <main+0xe0>
movzbl %al,%eax
add    $0xffffffd0,%eax
movslq %ebx,%rcx
add    $0x1,%ebx
mov    %eax,0x30(%rsp,%rcx,4)
jmp    1240 <main+0xe0>
cmp    $0x7,%ebx
jne    1465 <main+0x305>
lea    0xdc8(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
call   1070 <getchar@plt>
cmp    $0xa,%al
je     1465 <main+0x305>
mov    $0x1,%ebx
jmp    12ab <main+0x14b>
nopl   0x0(%rax)
xor    %eax,%eax
call   1070 <getchar@plt>
cmp    $0xa,%al
je     12c7 <main+0x167>
mov    %eax,%ecx
and    $0xfe,%cl
cmp    $0x30,%cl
jne    12a0 <main+0x140>
movzbl %al,%eax
add    $0xffffffd0,%eax
movslq %ebx,%rcx
add    $0x1,%ebx
mov    %eax,0x50(%rsp,%rcx,4)
jmp    12a0 <main+0x140>
cmp    $0x7,%ebx
jne    1465 <main+0x305>
lea    0xd68(%rip),%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
call   1070 <getchar@plt>
cmp    $0xa,%al
je     1465 <main+0x305>
mov    $0x1,%ebx
jmp    130b <main+0x1ab>
nopl   0x0(%rax)
xor    %eax,%eax
call   1070 <getchar@plt>
cmp    $0xa,%al
je     1327 <main+0x1c7>
mov    %eax,%ecx
and    $0xfe,%cl
cmp    $0x30,%cl
jne    1300 <main+0x1a0>
movzbl %al,%eax
add    $0xffffffd0,%eax
movslq %ebx,%rcx
add    $0x1,%ebx
mov    %eax,0x70(%rsp,%rcx,4)
jmp    1300 <main+0x1a0>
cmp    $0x7,%ebx
jne    1465 <main+0x305>
lea    0xd08(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
call   1070 <getchar@plt>
cmp    $0xa,%al
je     1465 <main+0x305>
mov    $0x1,%ebx
jmp    136b <main+0x20b>
nopl   0x0(%rax)
xor    %eax,%eax
call   1070 <getchar@plt>
cmp    $0xa,%al
je     138a <main+0x22a>
mov    %eax,%ecx
and    $0xfe,%cl
cmp    $0x30,%cl
jne    1360 <main+0x200>
movzbl %al,%eax
add    $0xffffffd0,%eax
movslq %ebx,%rcx
add    $0x1,%ebx
mov    %eax,0x90(%rsp,%rcx,4)
jmp    1360 <main+0x200>
cmp    $0x7,%ebx
jne    1465 <main+0x305>
lea    0xca5(%rip),%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
call   1070 <getchar@plt>
cmp    $0xa,%al
je     1465 <main+0x305>
mov    $0x1,%ebx
jmp    13c7 <main+0x267>
xor    %eax,%eax
call   1070 <getchar@plt>
cmp    $0xa,%al
je     13e6 <main+0x286>
mov    %eax,%ecx
and    $0xfe,%cl
cmp    $0x30,%cl
jne    13bc <main+0x25c>
movzbl %al,%eax
add    $0xffffffd0,%eax
movslq %ebx,%rcx
add    $0x1,%ebx
mov    %eax,0xb0(%rsp,%rcx,4)
jmp    13bc <main+0x25c>
cmp    $0x7,%ebx
jne    1465 <main+0x305>
lea    0xc4d(%rip),%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
call   1070 <getchar@plt>
cmp    $0xa,%al
je     1465 <main+0x305>
mov    $0x1,%ebx
jmp    141b <main+0x2bb>
xor    %eax,%eax
call   1070 <getchar@plt>
cmp    $0xa,%al
je     143a <main+0x2da>
mov    %eax,%ecx
and    $0xfe,%cl
cmp    $0x30,%cl
jne    1410 <main+0x2b0>
movzbl %al,%eax
add    $0xffffffd0,%eax
movslq %ebx,%rcx
add    $0x1,%ebx
mov    %eax,0xd0(%rsp,%rcx,4)
jmp    1410 <main+0x2b0>
cmp    $0x7,%ebx
jne    1465 <main+0x305>
mov    $0x4,%edi
call   1050 <ceil@plt>
cmp    $0x2,%eax
jl     14f9 <main+0x399>
mov    $0x1,%r13d
mov    $0x6,%r12d
lea    0x10(%rsp),%r14
jmp    149f <main+0x33f>
lea    0xc20(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%eax
add    $0x118,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
add    $0x1,%r13d
mov    $0x4,%edi
call   1050 <ceil@plt>
add    $0xfffffffe,%r12d
cmp    %eax,%r13d
jge    14f9 <main+0x399>
mov    $0x8,%eax
sub    %r13d,%eax
cmp    %eax,%r13d
jge    1488 <main+0x328>
mov    $0x7,%r15d
sub    %r13d,%r15d
xor    %ebx,%ebx
lea    (%rbx,%r13,1),%ebp
mov    %r14,%rdi
mov    %r13d,%esi
mov    %ebp,%edx
call   1080 <blank@plt>
mov    %r14,%rdi
mov    %r15d,%esi
mov    %ebp,%edx
call   1080 <blank@plt>
mov    %r14,%rdi
mov    %ebp,%esi
mov    %r13d,%edx
call   1080 <blank@plt>
mov    %r14,%rdi
mov    %ebp,%esi
mov    %r15d,%edx
call   1080 <blank@plt>
add    $0x1,%ebx
cmp    %ebx,%r12d
jne    14b7 <main+0x357>
jmp    1488 <main+0x328>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x34(%rsp),%r13
mov    $0x1,%eax
mov    %rax,(%rsp)
lea    0xb31(%rip),%r14
lea    0xae1(%rip),%rbx
xor    %ebp,%ebp
jmp    1539 <main+0x3d9>
add    $0x20,%r13
mov    0x8(%rsp),%rax
mov    %rax,%rbp
cmp    $0x8,%rax
je     165e <main+0x4fe>
lea    0x1(%rbp),%rax
mov    %rax,0x8(%rsp)
xor    %r15d,%r15d
jmp    155a <main+0x3fa>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r15d
cmp    $0x3,%r15d
je     1523 <main+0x3c3>
test   %r15d,%r15d
je     1565 <main+0x405>
cmp    $0x7,%rbp
je     1550 <main+0x3f0>
cmp    $0x1,%r15d
ja     1570 <main+0x410>
test   %rbp,%rbp
je     1550 <main+0x3f0>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xfffffffffffffff8,%r12
jmp    15a2 <main+0x442>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
inc    %r12
je     1550 <main+0x3f0>
mov    -0x4(%r13,%r12,4),%eax
test   %eax,%eax
je     15d0 <main+0x470>
cmp    $0x1,%eax
je     1590 <main+0x430>
cmp    $0x7,%rbp
je     159d <main+0x43d>
cmp    $0xffffffffffffffff,%r12
je     159d <main+0x43d>
cmp    $0x1,%r15d
ja     15f5 <main+0x495>
cmpl   $0x0,0x0(%r13,%r12,4)
jne    160d <main+0x4ad>
jmp    1620 <main+0x4c0>
nopl   0x0(%rax)
cmp    $0x2,%r15d
je     1590 <main+0x430>
test   %r15d,%r15d
jne    1620 <main+0x4c0>
cmpl   $0x0,0x1c(%r13,%r12,4)
je     162f <main+0x4cf>
cmpl   $0x0,0x0(%r13,%r12,4)
jne    1620 <main+0x4c0>
cmpl   $0x0,-0x8(%r13,%r12,4)
jne    1637 <main+0x4d7>
jmp    1620 <main+0x4c0>
cmpl   $0x0,0x1c(%r13,%r12,4)
je     1590 <main+0x430>
cmpl   $0x0,0x0(%r13,%r12,4)
je     1620 <main+0x4c0>
cmpl   $0x0,0x20(%r13,%r12,4)
je     1620 <main+0x4c0>
mov    %r14,%rdi
lea    0x9fd(%rip),%rsi
jmp    1596 <main+0x436>
nopl   0x0(%rax)
mov    %r14,%rdi
lea    0x9e4(%rip),%rsi
jmp    1596 <main+0x436>
cmpl   $0x0,-0x24(%r13,%r12,4)
je     15e3 <main+0x483>
mov    (%rsp),%rsi
lea    0x1(%rsi),%ebx
lea    0x9c1(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %ebx,%eax
mov    %rax,(%rsp)
lea    0x9a7(%rip),%rbx
jmp    159d <main+0x43d>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
jmp    1476 <main+0x316>

LLVM IR (-O0):
@.str = [6 x i8] c"+++++\00"
@.str.1 = [8 x i8] c"%02d +\00"
@.str.2 = [6 x i8] c" +\00"
@.str.3 = [6 x i8] c" \00"
@.str.4 = [36 x i8] c"*** Knuth Crossword Exercise. ***\0A\0A\00"
@.str.5 = [37 x i8] c"Please enter %d rows of %d numbers.\0A\00"
@.str.6 = [30 x i8] c"Separate with single spaces.\0A\00"
@.str.7 = [10 x i8] c"\0ARow %d: \00"
@.str.8 = [14 x i8] c"Input error.\0A\00"
@.str.9 = [2 x i8] c"\0A\00"
@.str.10 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [8 x [8 x i32]]
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
store i32 0, i32* %1
store i32 7, i32* %4
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %12
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8** %13
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8** %14
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8** %15
store i32 0, i32* %2
br label %16
16: ; preds = %36, %0
%17 = load i32, i32* %2
%18 = icmp slt i32 %17, 8
br i1 %18, label %19, label %39
19: ; preds = %16
%20 = load i32, i32* %2
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %5, i64 0, i64 %21
%23 = getelementptr inbounds [8 x i32], [8 x i32]* %22, i64 0, i64 7
store i32 -1, i32* %23
%24 = load i32, i32* %2
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %5, i64 0, i64 %25
%27 = getelementptr inbounds [8 x i32], [8 x i32]* %26, i64 0, i64 0
store i32 -1, i32* %27
%28 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %5, i64 0, i64 7
%29 = load i32, i32* %2
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [8 x i32], [8 x i32]* %28, i64 0, i64 %30
store i32 -1, i32* %31
%32 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %5, i64 0, i64 0
%33 = load i32, i32* %2
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [8 x i32], [8 x i32]* %32, i64 0, i64 %34
store i32 -1, i32* %35
br label %36
36: ; preds = %19
%37 = load i32, i32* %2
%38 = add nsw i32 %37, 1
store i32 %38, i32* %2
br label %16
39: ; preds = %16
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0))
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0), i32 6, i32 6)
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0))
store i32 1, i32* %9
br label %43
43: ; preds = %79, %39
%44 = load i32, i32* %9
%45 = icmp slt i32 %44, 7
br i1 %45, label %46, label %82
46: ; preds = %43
store i32 1, i32* %10
%47 = load i32, i32* %9
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i32 %47)
br label %49
49: ; preds = %72, %46
%50 = call signext i8 (...) @getchar()
store i8 %50, i8* %11
%51 = sext i8 %50 to i32
%52 = icmp ne i32 %51, 10
br i1 %52, label %53, label %73
53: ; preds = %49
%54 = load i8, i8* %11
%55 = sext i8 %54 to i32
%56 = icmp eq i32 %55, 49
br i1 %56, label %61, label %57
57: ; preds = %53
%58 = load i8, i8* %11
%59 = sext i8 %58 to i32
%60 = icmp eq i32 %59, 48
br i1 %60, label %61, label %72
61: ; preds = %57, %53
%62 = load i8, i8* %11
%63 = sext i8 %62 to i32
%64 = sub nsw i32 %63, 48
%65 = load i32, i32* %9
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %5, i64 0, i64 %66
%68 = load i32, i32* %10
%69 = add nsw i32 %68, 1
store i32 %69, i32* %10
%70 = sext i32 %68 to i64
%71 = getelementptr inbounds [8 x i32], [8 x i32]* %67, i64 0, i64 %70
store i32 %64, i32* %71
br label %72
72: ; preds = %61, %57
br label %49
73: ; preds = %49
%74 = load i32, i32* %10
%75 = icmp ne i32 %74, 7
br i1 %75, label %76, label %78
76: ; preds = %73
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0))
store i32 1, i32* %1
br label %311
78: ; preds = %73
br label %79
79: ; preds = %78
%80 = load i32, i32* %9
%81 = add nsw i32 %80, 1
store i32 %81, i32* %9
br label %43
82: ; preds = %43
store i32 1, i32* %3
br label %83
83: ; preds = %121, %82
%84 = load i32, i32* %3
%85 = call i32 @ceil(i32 4)
%86 = icmp slt i32 %84, %85
br i1 %86, label %87, label %124
87: ; preds = %83
%88 = load i32, i32* %3
store i32 %88, i32* %2
br label %89
89: ; preds = %117, %87
%90 = load i32, i32* %2
%91 = load i32, i32* %3
%92 = sub nsw i32 8, %91
%93 = icmp slt i32 %90, %92
br i1 %93, label %94, label %120
94: ; preds = %89
%95 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %5, i64 0, i64 0
%96 = bitcast [8 x i32]* %95 to i32**
%97 = load i32, i32* %3
%98 = load i32, i32* %2
%99 = call i32 @blank(i32** %96, i32 %97, i32 %98)
%100 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %5, i64 0, i64 0
%101 = bitcast [8 x i32]* %100 to i32**
%102 = load i32, i32* %3
%103 = sub nsw i32 7, %102
%104 = load i32, i32* %2
%105 = call i32 @blank(i32** %101, i32 %103, i32 %104)
%106 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %5, i64 0, i64 0
%107 = bitcast [8 x i32]* %106 to i32**
%108 = load i32, i32* %2
%109 = load i32, i32* %3
%110 = call i32 @blank(i32** %107, i32 %108, i32 %109)
%111 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %5, i64 0, i64 0
%112 = bitcast [8 x i32]* %111 to i32**
%113 = load i32, i32* %2
%114 = load i32, i32* %3
%115 = sub nsw i32 7, %114
%116 = call i32 @blank(i32** %112, i32 %113, i32 %115)
br label %117
117: ; preds = %94
%118 = load i32, i32* %2
%119 = add nsw i32 %118, 1
store i32 %119, i32* %2
br label %89
120: ; preds = %89
br label %121
121: ; preds = %120
%122 = load i32, i32* %3
%123 = add nsw i32 %122, 1
store i32 %123, i32* %3
br label %83
124: ; preds = %83
%125 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
store i32 0, i32* %9
store i32 1, i32* %7
br label %126
126: ; preds = %306, %124
%127 = load i32, i32* %9
%128 = icmp slt i32 %127, 8
br i1 %128, label %129, label %309
129: ; preds = %126
store i32 0, i32* %8
br label %130
130: ; preds = %302, %129
%131 = load i32, i32* %8
%132 = icmp slt i32 %131, 3
br i1 %132, label %133, label %305
133: ; preds = %130
%134 = load i32, i32* %8
%135 = icmp ne i32 %134, 0
br i1 %135, label %136, label %139
136: ; preds = %133
%137 = load i32, i32* %9
%138 = icmp eq i32 %137, 7
br i1 %138, label %145, label %139
139: ; preds = %136, %133
%140 = load i32, i32* %8
%141 = icmp slt i32 %140, 2
br i1 %141, label %142, label %146
142: ; preds = %139
%143 = load i32, i32* %9
%144 = icmp ne i32 %143, 0
br i1 %144, label %146, label %145
145: ; preds = %142, %136
br label %302
146: ; preds = %142, %139
%147 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
store i32 0, i32* %10
br label %148
148: ; preds = %298, %146
%149 = load i32, i32* %10
%150 = icmp slt i32 %149, 8
br i1 %150, label %151, label %301
151: ; preds = %148
%152 = load i32, i32* %9
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %5, i64 0, i64 %153
%155 = load i32, i32* %10
%156 = sext i32 %155 to i64
%157 = getelementptr inbounds [8 x i32], [8 x i32]* %154, i64 0, i64 %156
%158 = load i32, i32* %157
store i32 %158, i32* %6
%159 = load i32, i32* %6
%160 = icmp eq i32 %159, 1
br i1 %160, label %161, label %164
161: ; preds = %151
%162 = load i8*, i8** %12
%163 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8* %162)
br label %297
164: ; preds = %151
%165 = load i32, i32* %6
%166 = icmp ne i32 %165, 0
br i1 %166, label %226, label %167
167: ; preds = %164
%168 = load i32, i32* %8
%169 = icmp eq i32 %168, 2
br i1 %169, label %170, label %173
170: ; preds = %167
%171 = load i8*, i8** %12
%172 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8* %171)
br label %225
173: ; preds = %167
%174 = load i32, i32* %8
%175 = icmp ne i32 %174, 0
br i1 %175, label %221, label %176
176: ; preds = %173
%177 = load i32, i32* %9
%178 = add nsw i32 %177, 1
%179 = sext i32 %178 to i64
%180 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %5, i64 0, i64 %179
%181 = load i32, i32* %10
%182 = sext i32 %181 to i64
%183 = getelementptr inbounds [8 x i32], [8 x i32]* %180, i64 0, i64 %182
%184 = load i32, i32* %183
%185 = icmp ne i32 %184, 0
br i1 %185, label %196, label %186
186: ; preds = %176
%187 = load i32, i32* %9
%188 = sub nsw i32 %187, 1
%189 = sext i32 %188 to i64
%190 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %5, i64 0, i64 %189
%191 = load i32, i32* %10
%192 = sext i32 %191 to i64
%193 = getelementptr inbounds [8 x i32], [8 x i32]* %190, i64 0, i64 %192
%194 = load i32, i32* %193
%195 = icmp ne i32 %194, 0
br i1 %195, label %216, label %196
196: ; preds = %186, %176
%197 = load i32, i32* %9
%198 = sext i32 %197 to i64
%199 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %5, i64 0, i64 %198
%200 = load i32, i32* %10
%201 = add nsw i32 %200, 1
%202 = sext i32 %201 to i64
%203 = getelementptr inbounds [8 x i32], [8 x i32]* %199, i64 0, i64 %202
%204 = load i32, i32* %203
%205 = icmp ne i32 %204, 0
br i1 %205, label %221, label %206
206: ; preds = %196
%207 = load i32, i32* %9
%208 = sext i32 %207 to i64
%209 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %5, i64 0, i64 %208
%210 = load i32, i32* %10
%211 = sub nsw i32 %210, 1
%212 = sext i32 %211 to i64
%213 = getelementptr inbounds [8 x i32], [8 x i32]* %209, i64 0, i64 %212
%214 = load i32, i32* %213
%215 = icmp ne i32 %214, 0
br i1 %215, label %216, label %221
216: ; preds = %206, %186
%217 = load i8*, i8** %13
%218 = load i32, i32* %7
%219 = add nsw i32 %218, 1
store i32 %219, i32* %7
%220 = call i32 (i8*, ...) @printf(i8* %217, i32 %218)
br label %224
221: ; preds = %206, %196, %173
%222 = load i8*, i8** %14
%223 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8* %222)
br label %224
224: ; preds = %221, %216
br label %225
225: ; preds = %224, %170
br label %296
226: ; preds = %164
%227 = load i32, i32* %9
%228 = icmp ne i32 %227, 7
br i1 %228, label %229, label %295
229: ; preds = %226
%230 = load i32, i32* %10
%231 = icmp ne i32 %230, 7
br i1 %231, label %232, label %295
232: ; preds = %229
%233 = load i32, i32* %8
%234 = icmp slt i32 %233, 2
br i1 %234, label %235, label %252
235: ; preds = %232
%236 = load i32, i32* %9
%237 = sext i32 %236 to i64
%238 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %5, i64 0, i64 %237
%239 = load i32, i32* %10
%240 = add nsw i32 %239, 1
%241 = sext i32 %240 to i64
%242 = getelementptr inbounds [8 x i32], [8 x i32]* %238, i64 0, i64 %241
%243 = load i32, i32* %242
%244 = icmp ne i32 %243, 0
br i1 %244, label %248, label %245
245: ; preds = %235
%246 = load i8*, i8** %14
%247 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8* %246)
br label %251
248: ; preds = %235
%249 = load i8*, i8** %15
%250 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8* %249)
br label %251
251: ; preds = %248, %245
br label %294
252: ; preds = %232
%253 = load i32, i32* %9
%254 = add nsw i32 %253, 1
%255 = sext i32 %254 to i64
%256 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %5, i64 0, i64 %255
%257 = load i32, i32* %10
%258 = sext i32 %257 to i64
%259 = getelementptr inbounds [8 x i32], [8 x i32]* %256, i64 0, i64 %258
%260 = load i32, i32* %259
%261 = icmp ne i32 %260, 0
br i1 %261, label %265, label %262
262: ; preds = %252
%263 = load i8*, i8** %12
%264 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8* %263)
br label %293
265: ; preds = %252
%266 = load i32, i32* %9
%267 = sext i32 %266 to i64
%268 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %5, i64 0, i64 %267
%269 = load i32, i32* %10
%270 = add nsw i32 %269, 1
%271 = sext i32 %270 to i64
%272 = getelementptr inbounds [8 x i32], [8 x i32]* %268, i64 0, i64 %271
%273 = load i32, i32* %272
%274 = icmp ne i32 %273, 0
br i1 %274, label %275, label %286
275: ; preds = %265
%276 = load i32, i32* %9
%277 = add nsw i32 %276, 1
%278 = sext i32 %277 to i64
%279 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %5, i64 0, i64 %278
%280 = load i32, i32* %10
%281 = add nsw i32 %280, 1
%282 = sext i32 %281 to i64
%283 = getelementptr inbounds [8 x i32], [8 x i32]* %279, i64 0, i64 %282
%284 = load i32, i32* %283
%285 = icmp ne i32 %284, 0
br i1 %285, label %289, label %286
286: ; preds = %275, %265
%287 = load i8*, i8** %14
%288 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8* %287)
br label %292
289: ; preds = %275
%290 = load i8*, i8** %15
%291 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8* %290)
br label %292
292: ; preds = %289, %286
br label %293
293: ; preds = %292, %262
br label %294
294: ; preds = %293, %251
br label %295
295: ; preds = %294, %229, %226
br label %296
296: ; preds = %295, %225
br label %297
297: ; preds = %296, %161
br label %298
298: ; preds = %297
%299 = load i32, i32* %10
%300 = add nsw i32 %299, 1
store i32 %300, i32* %10
br label %148
301: ; preds = %148
br label %302
302: ; preds = %301, %145
%303 = load i32, i32* %8
%304 = add nsw i32 %303, 1
store i32 %304, i32* %8
br label %130
305: ; preds = %130
br label %306
306: ; preds = %305
%307 = load i32, i32* %9
%308 = add nsw i32 %307, 1
store i32 %308, i32* %9
br label %126
309: ; preds = %126
%310 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
store i32 0, i32* %1
br label %311
311: ; preds = %309, %76
%312 = load i32, i32* %1
ret i32 %312
}

LLVM IR (-O2):
@.str = [6 x i8] c"+++++\00"
@.str.1 = [8 x i8] c"%02d +\00"
@.str.2 = [6 x i8] c" +\00"
@.str.3 = [6 x i8] c" \00"
@.str.5 = [37 x i8] c"Please enter %d rows of %d numbers.\0A\00"
@.str.7 = [10 x i8] c"\0ARow %d: \00"
@.str.10 = [3 x i8] c"%s\00"
@str = [35 x i8] c"*** Knuth Crossword Exercise. ***\0A\00"
@str.11 = [29 x i8] c"Separate with single spaces.\00"
@str.12 = [13 x i8] c"Input error.\00"
define i32 @main() {
%1 = alloca [8 x [8 x i32]]
%2 = bitcast [8 x [8 x i32]]* %1 to i8*
%3 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %1, i64 0, i64 1, i64 7
store i32 -1, i32* %3
%4 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %1, i64 0, i64 2, i64 7
store i32 -1, i32* %4
%5 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %1, i64 0, i64 2, i64 0
store i32 -1, i32* %5
%6 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %1, i64 0, i64 3, i64 7
store i32 -1, i32* %6
%7 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %1, i64 0, i64 3, i64 0
store i32 -1, i32* %7
%8 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %1, i64 0, i64 4, i64 7
store i32 -1, i32* %8
%9 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %1, i64 0, i64 4, i64 0
store i32 -1, i32* %9
%10 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %1, i64 0, i64 5, i64 7
store i32 -1, i32* %10
%11 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %1, i64 0, i64 5, i64 0
store i32 -1, i32* %11
%12 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %1, i64 0, i64 6, i64 7
%13 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %1, i64 0, i64 6, i64 0
store i32 -1, i32* %13
%14 = bitcast [8 x [8 x i32]]* %1 to i8*
%15 = bitcast i32* %12 to i8*
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0), i32 6, i32 6)
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.11, i64 0, i64 0))
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i32 1)
%20 = tail call signext i8 (...) @getchar()
%21 = icmp eq i8 %20, 10
br i1 %21, label %149, label %132
22: ; preds = %147
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i32 2)
%24 = tail call signext i8 (...) @getchar()
%25 = icmp eq i8 %24, 10
br i1 %25, label %149, label %26
26: ; preds = %22, %37
%27 = phi i8 [ %39, %37 ], [ %24, %22 ]
%28 = phi i32 [ %38, %37 ], [ 1, %22 ]
%29 = and i8 %27, -2
%30 = icmp eq i8 %29, 48
br i1 %30, label %31, label %37
31: ; preds = %26
%32 = zext i8 %27 to i32
%33 = add nsw i32 %32, -48
%34 = add nsw i32 %28, 1
%35 = sext i32 %28 to i64
%36 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %1, i64 0, i64 2, i64 %35
store i32 %33, i32* %36
br label %37
37: ; preds = %31, %26
%38 = phi i32 [ %34, %31 ], [ %28, %26 ]
%39 = tail call signext i8 (...) @getchar()
%40 = icmp eq i8 %39, 10
br i1 %40, label %41, label %26
41: ; preds = %37
%42 = icmp eq i32 %38, 7
br i1 %42, label %43, label %149
43: ; preds = %41
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i32 3)
%45 = tail call signext i8 (...) @getchar()
%46 = icmp eq i8 %45, 10
br i1 %46, label %149, label %47
47: ; preds = %43, %58
%48 = phi i8 [ %60, %58 ], [ %45, %43 ]
%49 = phi i32 [ %59, %58 ], [ 1, %43 ]
%50 = and i8 %48, -2
%51 = icmp eq i8 %50, 48
br i1 %51, label %52, label %58
52: ; preds = %47
%53 = zext i8 %48 to i32
%54 = add nsw i32 %53, -48
%55 = add nsw i32 %49, 1
%56 = sext i32 %49 to i64
%57 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %1, i64 0, i64 3, i64 %56
store i32 %54, i32* %57
br label %58
58: ; preds = %52, %47
%59 = phi i32 [ %55, %52 ], [ %49, %47 ]
%60 = tail call signext i8 (...) @getchar()
%61 = icmp eq i8 %60, 10
br i1 %61, label %62, label %47
62: ; preds = %58
%63 = icmp eq i32 %59, 7
br i1 %63, label %64, label %149
64: ; preds = %62
%65 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i32 4)
%66 = tail call signext i8 (...) @getchar()
%67 = icmp eq i8 %66, 10
br i1 %67, label %149, label %68
68: ; preds = %64, %79
%69 = phi i8 [ %81, %79 ], [ %66, %64 ]
%70 = phi i32 [ %80, %79 ], [ 1, %64 ]
%71 = and i8 %69, -2
%72 = icmp eq i8 %71, 48
br i1 %72, label %73, label %79
73: ; preds = %68
%74 = zext i8 %69 to i32
%75 = add nsw i32 %74, -48
%76 = add nsw i32 %70, 1
%77 = sext i32 %70 to i64
%78 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %1, i64 0, i64 4, i64 %77
store i32 %75, i32* %78
br label %79
79: ; preds = %73, %68
%80 = phi i32 [ %76, %73 ], [ %70, %68 ]
%81 = tail call signext i8 (...) @getchar()
%82 = icmp eq i8 %81, 10
br i1 %82, label %83, label %68
83: ; preds = %79
%84 = icmp eq i32 %80, 7
br i1 %84, label %85, label %149
85: ; preds = %83
%86 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i32 5)
%87 = tail call signext i8 (...) @getchar()
%88 = icmp eq i8 %87, 10
br i1 %88, label %149, label %89
89: ; preds = %85, %100
%90 = phi i8 [ %102, %100 ], [ %87, %85 ]
%91 = phi i32 [ %101, %100 ], [ 1, %85 ]
%92 = and i8 %90, -2
%93 = icmp eq i8 %92, 48
br i1 %93, label %94, label %100
94: ; preds = %89
%95 = zext i8 %90 to i32
%96 = add nsw i32 %95, -48
%97 = add nsw i32 %91, 1
%98 = sext i32 %91 to i64
%99 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %1, i64 0, i64 5, i64 %98
store i32 %96, i32* %99
br label %100
100: ; preds = %94, %89
%101 = phi i32 [ %97, %94 ], [ %91, %89 ]
%102 = tail call signext i8 (...) @getchar()
%103 = icmp eq i8 %102, 10
br i1 %103, label %104, label %89
104: ; preds = %100
%105 = icmp eq i32 %101, 7
br i1 %105, label %106, label %149
106: ; preds = %104
%107 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i32 6)
%108 = tail call signext i8 (...) @getchar()
%109 = icmp eq i8 %108, 10
br i1 %109, label %149, label %110
110: ; preds = %106, %121
%111 = phi i8 [ %123, %121 ], [ %108, %106 ]
%112 = phi i32 [ %122, %121 ], [ 1, %106 ]
%113 = and i8 %111, -2
%114 = icmp eq i8 %113, 48
br i1 %114, label %115, label %121
115: ; preds = %110
%116 = zext i8 %111 to i32
%117 = add nsw i32 %116, -48
%118 = add nsw i32 %112, 1
%119 = sext i32 %112 to i64
%120 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %1, i64 0, i64 6, i64 %119
store i32 %117, i32* %120
br label %121
121: ; preds = %115, %110
%122 = phi i32 [ %118, %115 ], [ %112, %110 ]
%123 = tail call signext i8 (...) @getchar()
%124 = icmp eq i8 %123, 10
br i1 %124, label %125, label %110
125: ; preds = %121
%126 = icmp eq i32 %122, 7
br i1 %126, label %127, label %149
127: ; preds = %125
%128 = call i32 @ceil(i32 4)
%129 = icmp sgt i32 %128, 1
br i1 %129, label %130, label %171
130: ; preds = %127
%131 = bitcast [8 x [8 x i32]]* %1 to i32**
br label %151
132: ; preds = %0, %143
%133 = phi i8 [ %145, %143 ], [ %20, %0 ]
%134 = phi i32 [ %144, %143 ], [ 1, %0 ]
%135 = and i8 %133, -2
%136 = icmp eq i8 %135, 48
br i1 %136, label %137, label %143
137: ; preds = %132
%138 = zext i8 %133 to i32
%139 = add nsw i32 %138, -48
%140 = add nsw i32 %134, 1
%141 = sext i32 %134 to i64
%142 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %1, i64 0, i64 1, i64 %141
store i32 %139, i32* %142
br label %143
143: ; preds = %132, %137
%144 = phi i32 [ %140, %137 ], [ %134, %132 ]
%145 = tail call signext i8 (...) @getchar()
%146 = icmp eq i8 %145, 10
br i1 %146, label %147, label %132
147: ; preds = %143
%148 = icmp eq i32 %144, 7
br i1 %148, label %22, label %149
149: ; preds = %106, %85, %64, %43, %22, %0, %125, %104, %83, %62, %41, %147
%150 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.12, i64 0, i64 0))
br label %271
151: ; preds = %130, %166
%152 = phi i32 [ 7, %130 ], [ %170, %166 ]
%153 = phi i32 [ 1, %130 ], [ %167, %166 ]
%154 = sub nsw i32 8, %153
%155 = icmp slt i32 %153, %154
br i1 %155, label %156, label %166
156: ; preds = %151
%157 = sub nsw i32 7, %153
br label %158
158: ; preds = %156, %158
%159 = phi i32 [ %153, %156 ], [ %164, %158 ]
%160 = call i32 @blank(i32** %131, i32 %153, i32 %159)
%161 = call i32 @blank(i32** %131, i32 %157, i32 %159)
%162 = call i32 @blank(i32** %131, i32 %159, i32 %153)
%163 = call i32 @blank(i32** %131, i32 %159, i32 %157)
%164 = add nuw i32 %159, 1
%165 = icmp eq i32 %164, %152
br i1 %165, label %166, label %158
166: ; preds = %158, %151
%167 = add nuw nsw i32 %153, 1
%168 = call i32 @ceil(i32 4)
%169 = icmp slt i32 %167, %168
%170 = add nsw i32 %152, -1
br i1 %169, label %151, label %171
171: ; preds = %166, %127
%172 = call i32 @putchar(i32 10)
br label %173
173: ; preds = %171, %267
%174 = phi i64 [ 0, %171 ], [ %178, %267 ]
%175 = phi i32 [ 1, %171 ], [ %264, %267 ]
%176 = icmp eq i64 %174, 7
%177 = icmp ne i64 %174, 0
%178 = add nuw nsw i64 %174, 1
%179 = add nsw i64 %174, -1
%180 = icmp ne i64 %174, 7
br label %181
181: ; preds = %173, %263
%182 = phi i32 [ %175, %173 ], [ %264, %263 ]
%183 = phi i32 [ 0, %173 ], [ %265, %263 ]
%184 = icmp ne i32 %183, 0
%185 = select i1 %184, i1 %176, i1 false
br i1 %185, label %263, label %186
186: ; preds = %181
%187 = icmp ugt i32 %183, 1
%188 = select i1 %187, i1 true, i1 %177
br i1 %188, label %189, label %263
189: ; preds = %186
%190 = call i32 @putchar(i32 10)
%191 = icmp eq i32 %183, 2
%192 = icmp ult i32 %183, 2
br label %193
193: ; preds = %189, %259
%194 = phi i64 [ 0, %189 ], [ %261, %259 ]
%195 = phi i32 [ %182, %189 ], [ %260, %259 ]
%196 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %1, i64 0, i64 %174, i64 %194
%197 = load i32, i32* %196
switch i32 %197, label %227 [
i32 1, label %198
i32 0, label %200
]
198: ; preds = %193
%199 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %259
200: ; preds = %193
br i1 %191, label %201, label %203
201: ; preds = %200
%202 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %259
203: ; preds = %200
br i1 %184, label %225, label %204
204: ; preds = %203
%205 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %1, i64 0, i64 %178, i64 %194
%206 = load i32, i32* %205
%207 = icmp eq i32 %206, 0
br i1 %207, label %208, label %212
208: ; preds = %204
%209 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %1, i64 0, i64 %179, i64 %194
%210 = load i32, i32* %209
%211 = icmp eq i32 %210, 0
br i1 %211, label %212, label %222
212: ; preds = %208, %204
%213 = add nuw nsw i64 %194, 1
%214 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %1, i64 0, i64 %174, i64 %213
%215 = load i32, i32* %214
%216 = icmp eq i32 %215, 0
br i1 %216, label %217, label %225
217: ; preds = %212
%218 = add nsw i64 %194, -1
%219 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %1, i64 0, i64 %174, i64 %218
%220 = load i32, i32* %219
%221 = icmp eq i32 %220, 0
br i1 %221, label %225, label %222
222: ; preds = %217, %208
%223 = add nsw i32 %195, 1
%224 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %195)
br label %259
225: ; preds = %217, %212, %203
%226 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %259
227: ; preds = %193
%228 = icmp ne i64 %194, 7
%229 = select i1 %180, i1 %228, i1 false
br i1 %229, label %230, label %259
230: ; preds = %227
br i1 %192, label %231, label %240
231: ; preds = %230
%232 = add nuw nsw i64 %194, 1
%233 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %1, i64 0, i64 %174, i64 %232
%234 = load i32, i32* %233
%235 = icmp eq i32 %234, 0
br i1 %235, label %236, label %238
236: ; preds = %231
%237 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %259
238: ; preds = %231
%239 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %259
240: ; preds = %230
%241 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %1, i64 0, i64 %178, i64 %194
%242 = load i32, i32* %241
%243 = icmp eq i32 %242, 0
br i1 %243, label %244, label %246
244: ; preds = %240
%245 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %259
246: ; preds = %240
%247 = add nuw nsw i64 %194, 1
%248 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %1, i64 0, i64 %174, i64 %247
%249 = load i32, i32* %248
%250 = icmp eq i32 %249, 0
br i1 %250, label %255, label %251
251: ; preds = %246
%252 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %1, i64 0, i64 %178, i64 %247
%253 = load i32, i32* %252
%254 = icmp eq i32 %253, 0
br i1 %254, label %255, label %257
255: ; preds = %251, %246
%256 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %259
257: ; preds = %251
%258 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %259
259: ; preds = %198, %227, %244, %257, %255, %236, %238, %201, %225, %222
%260 = phi i32 [ %195, %198 ], [ %195, %238 ], [ %195, %236 ], [ %195, %257 ], [ %195, %255 ], [ %195, %244 ], [ %195, %227 ], [ %195, %201 ], [ %195, %225 ], [ %223, %222 ]
%261 = add nuw nsw i64 %194, 1
%262 = icmp eq i64 %261, 8
br i1 %262, label %263, label %193
263: ; preds = %259, %181, %186
%264 = phi i32 [ %182, %181 ], [ %182, %186 ], [ %260, %259 ]
%265 = add nuw nsw i32 %183, 1
%266 = icmp eq i32 %265, 3
br i1 %266, label %267, label %181
267: ; preds = %263
%268 = icmp eq i64 %178, 8
br i1 %268, label %269, label %173
269: ; preds = %267
%270 = call i32 @putchar(i32 10)
br label %271
271: ; preds = %269, %149
%272 = phi i32 [ 1, %149 ], [ 0, %269 ]
ret i32 %272
}