#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*/ fprintf(int /*<<< orphan*/ *, char *);
void ansiprintboard(int b[8][8], int view, int color, FILE *out) {
  int i, j;
  if (view == 2) {
    if (color == 2)
      fprintf(out, "\n   ~~~~~~~~~~~~~~~ ");
    else
      fprintf(out, "\n.  ~~~~~~~~~~~~~~~ ");
    for (j = 7; j >= 0; j--) {
      fprintf(out, "\n   ");
      for (i = 0; i <= 7; i++) {
        switch (b[i][j]) {
        case 2 | 4:
          fprintf(out, "b ");
          break;
        case 2 | 8:
          fprintf(out, "B ");
          break;
        case 1 | 4:
          fprintf(out, "w ");
          break;
        case 1 | 8:
          fprintf(out, "W ");
          break;
        case 16:
          fprintf(out, "- ");
          break;
        default:
          fprintf(out, "  ");
        }
      }
    }
  } else {
    if (color == 2)
      fprintf(out, "\n-  ~~~~~~~~~~~~~~~ ");
    else
      fprintf(out, "\n*  ~~~~~~~~~~~~~~~ ");
    for (j = 0; j <= 7; j++) {
      fprintf(out, "\n   ");
      for (i = 7; i >= 0; i--) {
        switch (b[i][j]) {
        case 2 | 4:
          fprintf(out, "b ");
          break;
        case 2 | 8:
          fprintf(out, "B ");
          break;
        case 1 | 4:
          fprintf(out, "w ");
          break;
        case 1 | 8:
          fprintf(out, "W ");
          break;
        case 16:
          fprintf(out, "- ");
          break;
        default:
          fprintf(out, "  ");
        }
      }
    }
  }
  fprintf(out, "\n\n");
}


x86 assembly (clang, -O0):
<ansiprintboard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
cmpl   $0x2,-0xc(%rbp)
jne    1271 <ansiprintboard+0x161>
cmpl   $0x2,-0x10(%rbp)
jne    114f <ansiprintboard+0x3f>
mov    -0x18(%rbp),%rdi
lea    0xf1b(%rip),%rsi
call   1030 <fprintf@plt>
jmp    115f <ansiprintboard+0x4f>
mov    -0x18(%rbp),%rdi
lea    0xf1b(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x7,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jl     126c <ansiprintboard+0x15c>
mov    -0x18(%rbp),%rdi
lea    0xf0f(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x7,-0x1c(%rbp)
jg     1259 <ansiprintboard+0x149>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    $0xfffffffb,%eax
mov    %eax,%ecx
mov    %rcx,-0x28(%rbp)
sub    $0xb,%eax
ja     1236 <ansiprintboard+0x126>
mov    -0x28(%rbp),%rax
lea    0xe6c(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x18(%rbp),%rdi
lea    0xeb7(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1246 <ansiprintboard+0x136>
mov    -0x18(%rbp),%rdi
lea    0xea5(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1246 <ansiprintboard+0x136>
mov    -0x18(%rbp),%rdi
lea    0xe93(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1246 <ansiprintboard+0x136>
mov    -0x18(%rbp),%rdi
lea    0xe81(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1246 <ansiprintboard+0x136>
mov    -0x18(%rbp),%rdi
lea    0xe6f(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1246 <ansiprintboard+0x136>
mov    -0x18(%rbp),%rdi
lea    0xe4b(%rip),%rsi
call   1030 <fprintf@plt>
jmp    124b <ansiprintboard+0x13b>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1187 <ansiprintboard+0x77>
jmp    125e <ansiprintboard+0x14e>
mov    -0x20(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x20(%rbp)
jmp    1166 <ansiprintboard+0x56>
jmp    13b2 <ansiprintboard+0x2a2>
cmpl   $0x2,-0x10(%rbp)
jne    1290 <ansiprintboard+0x180>
mov    -0x18(%rbp),%rdi
lea    0xe18(%rip),%rsi
call   1030 <fprintf@plt>
jmp    12a0 <ansiprintboard+0x190>
mov    -0x18(%rbp),%rdi
lea    0xe18(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x0,-0x20(%rbp)
cmpl   $0x7,-0x20(%rbp)
jg     13ad <ansiprintboard+0x29d>
mov    -0x18(%rbp),%rdi
lea    0xdce(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x7,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jl     139a <ansiprintboard+0x28a>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    $0xfffffffb,%eax
mov    %eax,%ecx
mov    %rcx,-0x30(%rbp)
sub    $0xb,%eax
ja     1377 <ansiprintboard+0x267>
mov    -0x30(%rbp),%rax
lea    0xcfb(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x18(%rbp),%rdi
lea    0xd76(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1387 <ansiprintboard+0x277>
mov    -0x18(%rbp),%rdi
lea    0xd64(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1387 <ansiprintboard+0x277>
mov    -0x18(%rbp),%rdi
lea    0xd52(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1387 <ansiprintboard+0x277>
mov    -0x18(%rbp),%rdi
lea    0xd40(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1387 <ansiprintboard+0x277>
mov    -0x18(%rbp),%rdi
lea    0xd2e(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1387 <ansiprintboard+0x277>
mov    -0x18(%rbp),%rdi
lea    0xd0a(%rip),%rsi
call   1030 <fprintf@plt>
jmp    138c <ansiprintboard+0x27c>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    12c8 <ansiprintboard+0x1b8>
jmp    139f <ansiprintboard+0x28f>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    12a7 <ansiprintboard+0x197>
jmp    13b2 <ansiprintboard+0x2a2>
mov    -0x18(%rbp),%rdi
lea    0xd0b(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ansiprintboard>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r12
mov    %rdi,%r14
cmp    $0x2,%esi
jne    12f0 <ansiprintboard+0x1e0>
cmp    $0x2,%edx
lea    0xecc(%rip),%rax
lea    0xeda(%rip),%rdi
cmove  %rax,%rdi
mov    $0x14,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1030 <fwrite@plt>
xor    %ebx,%ebx
lea    0xed0(%rip),%r15
lea    0xecb(%rip),%r13
lea    0x2c58(%rip),%rbp
jmp    1190 <ansiprintboard+0x80>
nopw   0x0(%rax,%rax,1)
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1030 <fwrite@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0xfffffffffffffff8,%rbx
je     14be <ansiprintboard+0x3ae>
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r15,%rdi
mov    %r12,%rcx
call   1030 <fwrite@plt>
mov    0x1c(%r14,%rbx,4),%eax
add    $0xfffffffb,%eax
mov    %r13,%rdi
cmp    $0xb,%eax
ja     11bc <ansiprintboard+0xac>
cltq
mov    0x0(%rbp,%rax,8),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1030 <fwrite@plt>
mov    0x3c(%r14,%rbx,4),%eax
add    $0xfffffffb,%eax
mov    %r13,%rdi
cmp    $0xb,%eax
ja     11e5 <ansiprintboard+0xd5>
cltq
mov    0x0(%rbp,%rax,8),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1030 <fwrite@plt>
mov    0x5c(%r14,%rbx,4),%eax
add    $0xfffffffb,%eax
mov    %r13,%rdi
cmp    $0xb,%eax
ja     120e <ansiprintboard+0xfe>
cltq
mov    0x0(%rbp,%rax,8),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1030 <fwrite@plt>
mov    0x7c(%r14,%rbx,4),%eax
add    $0xfffffffb,%eax
mov    %r13,%rdi
cmp    $0xb,%eax
ja     1237 <ansiprintboard+0x127>
cltq
mov    0x0(%rbp,%rax,8),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1030 <fwrite@plt>
mov    0x9c(%r14,%rbx,4),%eax
add    $0xfffffffb,%eax
mov    %r13,%rdi
cmp    $0xb,%eax
ja     1263 <ansiprintboard+0x153>
cltq
mov    0x0(%rbp,%rax,8),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1030 <fwrite@plt>
mov    0xbc(%r14,%rbx,4),%eax
add    $0xfffffffb,%eax
mov    %r13,%rdi
cmp    $0xb,%eax
ja     128f <ansiprintboard+0x17f>
cltq
mov    0x0(%rbp,%rax,8),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1030 <fwrite@plt>
mov    0xdc(%r14,%rbx,4),%eax
add    $0xfffffffb,%eax
mov    %r13,%rdi
cmp    $0xb,%eax
ja     12bb <ansiprintboard+0x1ab>
cltq
mov    0x0(%rbp,%rax,8),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1030 <fwrite@plt>
mov    0xfc(%r14,%rbx,4),%eax
add    $0xfffffffb,%eax
mov    %r13,%rdi
cmp    $0xb,%eax
ja     1170 <ansiprintboard+0x60>
cltq
mov    0x0(%rbp,%rax,8),%rdi
jmp    1170 <ansiprintboard+0x60>
cmp    $0x2,%edx
lea    0xd44(%rip),%rax
lea    0xd52(%rip),%rdi
cmove  %rax,%rdi
mov    $0x14,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1030 <fwrite@plt>
mov    $0xfffffffffffffff8,%rbx
lea    0xd05(%rip),%r15
lea    0xd00(%rip),%r13
lea    0x2a8d(%rip),%rbp
jmp    135b <ansiprintboard+0x24b>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1030 <fwrite@plt>
inc    %rbx
je     14be <ansiprintboard+0x3ae>
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r15,%rdi
mov    %r12,%rcx
call   1030 <fwrite@plt>
mov    0x100(%r14,%rbx,4),%eax
add    $0xfffffffb,%eax
mov    %r13,%rdi
cmp    $0xb,%eax
ja     138a <ansiprintboard+0x27a>
cltq
mov    0x0(%rbp,%rax,8),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1030 <fwrite@plt>
mov    0xe0(%r14,%rbx,4),%eax
add    $0xfffffffb,%eax
mov    %r13,%rdi
cmp    $0xb,%eax
ja     13b6 <ansiprintboard+0x2a6>
cltq
mov    0x0(%rbp,%rax,8),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1030 <fwrite@plt>
mov    0xc0(%r14,%rbx,4),%eax
add    $0xfffffffb,%eax
mov    %r13,%rdi
cmp    $0xb,%eax
ja     13e2 <ansiprintboard+0x2d2>
cltq
mov    0x0(%rbp,%rax,8),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1030 <fwrite@plt>
mov    0xa0(%r14,%rbx,4),%eax
add    $0xfffffffb,%eax
mov    %r13,%rdi
cmp    $0xb,%eax
ja     140e <ansiprintboard+0x2fe>
cltq
mov    0x0(%rbp,%rax,8),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1030 <fwrite@plt>
mov    0x80(%r14,%rbx,4),%eax
add    $0xfffffffb,%eax
mov    %r13,%rdi
cmp    $0xb,%eax
ja     143a <ansiprintboard+0x32a>
cltq
mov    0x0(%rbp,%rax,8),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1030 <fwrite@plt>
mov    0x60(%r14,%rbx,4),%eax
add    $0xfffffffb,%eax
mov    %r13,%rdi
cmp    $0xb,%eax
ja     1463 <ansiprintboard+0x353>
cltq
mov    0x0(%rbp,%rax,8),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1030 <fwrite@plt>
mov    0x40(%r14,%rbx,4),%eax
add    $0xfffffffb,%eax
mov    %r13,%rdi
cmp    $0xb,%eax
ja     148c <ansiprintboard+0x37c>
cltq
mov    0x0(%rbp,%rax,8),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1030 <fwrite@plt>
mov    0x20(%r14,%rbx,4),%eax
add    $0xfffffffb,%eax
mov    %r13,%rdi
cmp    $0xb,%eax
ja     1340 <ansiprintboard+0x230>
cltq
mov    0x0(%rbp,%rax,8),%rdi
jmp    1340 <ansiprintboard+0x230>
lea    0xba3(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r12,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fwrite@plt>

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

LLVM IR (-O2):
@.str = [21 x i8] c"\0A ~~~~~~~~~~~~~~~ \00"
@.str.1 = [21 x i8] c"\0A. ~~~~~~~~~~~~~~~ \00"
@.str.2 = [5 x i8] c"\0A \00"
@.str.3 = [3 x i8] c"b \00"
@.str.4 = [3 x i8] c"B \00"
@.str.5 = [3 x i8] c"w \00"
@.str.6 = [3 x i8] c"W \00"
@.str.7 = [3 x i8] c"- \00"
@.str.8 = [3 x i8] c" \00"
@.str.9 = [21 x i8] c"\0A- ~~~~~~~~~~~~~~~ \00"
@.str.10 = [21 x i8] c"\0A* ~~~~~~~~~~~~~~~ \00"
@.str.11 = [3 x i8] c"\0A\0A\00"
@switch.table.ansiprintboard.12 = [12 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0)]
define void @ansiprintboard([8 x i32]* nocapture %0, i32 %1, i32 %2, i32* nocapture %3) {
%5 = icmp eq i32 %1, 2
%6 = icmp eq i32 %2, 2
br i1 %5, label %7, label %103
7: ; preds = %4
%8 = select i1 %6, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0)
%9 = tail call i64 @fwrite(i8* %8, i64 20, i64 1, i32* %3)
br label %10
10: ; preds = %7, %98
%11 = phi i64 [ 7, %7 ], [ %101, %98 ]
%12 = tail call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i64 4, i64 1, i32* %3)
%13 = getelementptr inbounds [8 x i32], [8 x i32]* %0, i64 0, i64 %11
%14 = load i32, i32* %13
%15 = add i32 %14, -5
%16 = icmp ult i32 %15, 12
br i1 %16, label %17, label %21
17: ; preds = %10
%18 = sext i32 %15 to i64
%19 = getelementptr inbounds [12 x i8*], [12 x i8*]* @switch.table.ansiprintboard.12, i64 0, i64 %18
%20 = load i8*, i8** %19
br label %21
21: ; preds = %10, %17
%22 = phi i8* [ %20, %17 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), %10 ]
%23 = tail call i64 @fwrite(i8* %22, i64 2, i64 1, i32* %3)
%24 = getelementptr inbounds [8 x i32], [8 x i32]* %0, i64 1, i64 %11
%25 = load i32, i32* %24
%26 = add i32 %25, -5
%27 = icmp ult i32 %26, 12
br i1 %27, label %28, label %32
28: ; preds = %21
%29 = sext i32 %26 to i64
%30 = getelementptr inbounds [12 x i8*], [12 x i8*]* @switch.table.ansiprintboard.12, i64 0, i64 %29
%31 = load i8*, i8** %30
br label %32
32: ; preds = %28, %21
%33 = phi i8* [ %31, %28 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), %21 ]
%34 = tail call i64 @fwrite(i8* %33, i64 2, i64 1, i32* %3)
%35 = getelementptr inbounds [8 x i32], [8 x i32]* %0, i64 2, i64 %11
%36 = load i32, i32* %35
%37 = add i32 %36, -5
%38 = icmp ult i32 %37, 12
br i1 %38, label %39, label %43
39: ; preds = %32
%40 = sext i32 %37 to i64
%41 = getelementptr inbounds [12 x i8*], [12 x i8*]* @switch.table.ansiprintboard.12, i64 0, i64 %40
%42 = load i8*, i8** %41
br label %43
43: ; preds = %39, %32
%44 = phi i8* [ %42, %39 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), %32 ]
%45 = tail call i64 @fwrite(i8* %44, i64 2, i64 1, i32* %3)
%46 = getelementptr inbounds [8 x i32], [8 x i32]* %0, i64 3, i64 %11
%47 = load i32, i32* %46
%48 = add i32 %47, -5
%49 = icmp ult i32 %48, 12
br i1 %49, label %50, label %54
50: ; preds = %43
%51 = sext i32 %48 to i64
%52 = getelementptr inbounds [12 x i8*], [12 x i8*]* @switch.table.ansiprintboard.12, i64 0, i64 %51
%53 = load i8*, i8** %52
br label %54
54: ; preds = %50, %43
%55 = phi i8* [ %53, %50 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), %43 ]
%56 = tail call i64 @fwrite(i8* %55, i64 2, i64 1, i32* %3)
%57 = getelementptr inbounds [8 x i32], [8 x i32]* %0, i64 4, i64 %11
%58 = load i32, i32* %57
%59 = add i32 %58, -5
%60 = icmp ult i32 %59, 12
br i1 %60, label %61, label %65
61: ; preds = %54
%62 = sext i32 %59 to i64
%63 = getelementptr inbounds [12 x i8*], [12 x i8*]* @switch.table.ansiprintboard.12, i64 0, i64 %62
%64 = load i8*, i8** %63
br label %65
65: ; preds = %61, %54
%66 = phi i8* [ %64, %61 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), %54 ]
%67 = tail call i64 @fwrite(i8* %66, i64 2, i64 1, i32* %3)
%68 = getelementptr inbounds [8 x i32], [8 x i32]* %0, i64 5, i64 %11
%69 = load i32, i32* %68
%70 = add i32 %69, -5
%71 = icmp ult i32 %70, 12
br i1 %71, label %72, label %76
72: ; preds = %65
%73 = sext i32 %70 to i64
%74 = getelementptr inbounds [12 x i8*], [12 x i8*]* @switch.table.ansiprintboard.12, i64 0, i64 %73
%75 = load i8*, i8** %74
br label %76
76: ; preds = %72, %65
%77 = phi i8* [ %75, %72 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), %65 ]
%78 = tail call i64 @fwrite(i8* %77, i64 2, i64 1, i32* %3)
%79 = getelementptr inbounds [8 x i32], [8 x i32]* %0, i64 6, i64 %11
%80 = load i32, i32* %79
%81 = add i32 %80, -5
%82 = icmp ult i32 %81, 12
br i1 %82, label %83, label %87
83: ; preds = %76
%84 = sext i32 %81 to i64
%85 = getelementptr inbounds [12 x i8*], [12 x i8*]* @switch.table.ansiprintboard.12, i64 0, i64 %84
%86 = load i8*, i8** %85
br label %87
87: ; preds = %83, %76
%88 = phi i8* [ %86, %83 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), %76 ]
%89 = tail call i64 @fwrite(i8* %88, i64 2, i64 1, i32* %3)
%90 = getelementptr inbounds [8 x i32], [8 x i32]* %0, i64 7, i64 %11
%91 = load i32, i32* %90
%92 = add i32 %91, -5
%93 = icmp ult i32 %92, 12
br i1 %93, label %94, label %98
94: ; preds = %87
%95 = sext i32 %92 to i64
%96 = getelementptr inbounds [12 x i8*], [12 x i8*]* @switch.table.ansiprintboard.12, i64 0, i64 %95
%97 = load i8*, i8** %96
br label %98
98: ; preds = %94, %87
%99 = phi i8* [ %97, %94 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), %87 ]
%100 = tail call i64 @fwrite(i8* %99, i64 2, i64 1, i32* %3)
%101 = add nsw i64 %11, -1
%102 = icmp eq i64 %11, 0
br i1 %102, label %199, label %10
103: ; preds = %4
%104 = select i1 %6, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.10, i64 0, i64 0)
%105 = tail call i64 @fwrite(i8* %104, i64 20, i64 1, i32* %3)
br label %106
106: ; preds = %103, %194
%107 = phi i64 [ 0, %103 ], [ %197, %194 ]
%108 = tail call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i64 4, i64 1, i32* %3)
%109 = getelementptr inbounds [8 x i32], [8 x i32]* %0, i64 7, i64 %107
%110 = load i32, i32* %109
%111 = add i32 %110, -5
%112 = icmp ult i32 %111, 12
br i1 %112, label %113, label %117
113: ; preds = %106
%114 = sext i32 %111 to i64
%115 = getelementptr inbounds [12 x i8*], [12 x i8*]* @switch.table.ansiprintboard.12, i64 0, i64 %114
%116 = load i8*, i8** %115
br label %117
117: ; preds = %106, %113
%118 = phi i8* [ %116, %113 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), %106 ]
%119 = tail call i64 @fwrite(i8* %118, i64 2, i64 1, i32* %3)
%120 = getelementptr inbounds [8 x i32], [8 x i32]* %0, i64 6, i64 %107
%121 = load i32, i32* %120
%122 = add i32 %121, -5
%123 = icmp ult i32 %122, 12
br i1 %123, label %124, label %128
124: ; preds = %117
%125 = sext i32 %122 to i64
%126 = getelementptr inbounds [12 x i8*], [12 x i8*]* @switch.table.ansiprintboard.12, i64 0, i64 %125
%127 = load i8*, i8** %126
br label %128
128: ; preds = %124, %117
%129 = phi i8* [ %127, %124 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), %117 ]
%130 = tail call i64 @fwrite(i8* %129, i64 2, i64 1, i32* %3)
%131 = getelementptr inbounds [8 x i32], [8 x i32]* %0, i64 5, i64 %107
%132 = load i32, i32* %131
%133 = add i32 %132, -5
%134 = icmp ult i32 %133, 12
br i1 %134, label %135, label %139
135: ; preds = %128
%136 = sext i32 %133 to i64
%137 = getelementptr inbounds [12 x i8*], [12 x i8*]* @switch.table.ansiprintboard.12, i64 0, i64 %136
%138 = load i8*, i8** %137
br label %139
139: ; preds = %135, %128
%140 = phi i8* [ %138, %135 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), %128 ]
%141 = tail call i64 @fwrite(i8* %140, i64 2, i64 1, i32* %3)
%142 = getelementptr inbounds [8 x i32], [8 x i32]* %0, i64 4, i64 %107
%143 = load i32, i32* %142
%144 = add i32 %143, -5
%145 = icmp ult i32 %144, 12
br i1 %145, label %146, label %150
146: ; preds = %139
%147 = sext i32 %144 to i64
%148 = getelementptr inbounds [12 x i8*], [12 x i8*]* @switch.table.ansiprintboard.12, i64 0, i64 %147
%149 = load i8*, i8** %148
br label %150
150: ; preds = %146, %139
%151 = phi i8* [ %149, %146 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), %139 ]
%152 = tail call i64 @fwrite(i8* %151, i64 2, i64 1, i32* %3)
%153 = getelementptr inbounds [8 x i32], [8 x i32]* %0, i64 3, i64 %107
%154 = load i32, i32* %153
%155 = add i32 %154, -5
%156 = icmp ult i32 %155, 12
br i1 %156, label %157, label %161
157: ; preds = %150
%158 = sext i32 %155 to i64
%159 = getelementptr inbounds [12 x i8*], [12 x i8*]* @switch.table.ansiprintboard.12, i64 0, i64 %158
%160 = load i8*, i8** %159
br label %161
161: ; preds = %157, %150
%162 = phi i8* [ %160, %157 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), %150 ]
%163 = tail call i64 @fwrite(i8* %162, i64 2, i64 1, i32* %3)
%164 = getelementptr inbounds [8 x i32], [8 x i32]* %0, i64 2, i64 %107
%165 = load i32, i32* %164
%166 = add i32 %165, -5
%167 = icmp ult i32 %166, 12
br i1 %167, label %168, label %172
168: ; preds = %161
%169 = sext i32 %166 to i64
%170 = getelementptr inbounds [12 x i8*], [12 x i8*]* @switch.table.ansiprintboard.12, i64 0, i64 %169
%171 = load i8*, i8** %170
br label %172
172: ; preds = %168, %161
%173 = phi i8* [ %171, %168 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), %161 ]
%174 = tail call i64 @fwrite(i8* %173, i64 2, i64 1, i32* %3)
%175 = getelementptr inbounds [8 x i32], [8 x i32]* %0, i64 1, i64 %107
%176 = load i32, i32* %175
%177 = add i32 %176, -5
%178 = icmp ult i32 %177, 12
br i1 %178, label %179, label %183
179: ; preds = %172
%180 = sext i32 %177 to i64
%181 = getelementptr inbounds [12 x i8*], [12 x i8*]* @switch.table.ansiprintboard.12, i64 0, i64 %180
%182 = load i8*, i8** %181
br label %183
183: ; preds = %179, %172
%184 = phi i8* [ %182, %179 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), %172 ]
%185 = tail call i64 @fwrite(i8* %184, i64 2, i64 1, i32* %3)
%186 = getelementptr inbounds [8 x i32], [8 x i32]* %0, i64 0, i64 %107
%187 = load i32, i32* %186
%188 = add i32 %187, -5
%189 = icmp ult i32 %188, 12
br i1 %189, label %190, label %194
190: ; preds = %183
%191 = sext i32 %188 to i64
%192 = getelementptr inbounds [12 x i8*], [12 x i8*]* @switch.table.ansiprintboard.12, i64 0, i64 %191
%193 = load i8*, i8** %192
br label %194
194: ; preds = %190, %183
%195 = phi i8* [ %193, %190 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), %183 ]
%196 = tail call i64 @fwrite(i8* %195, i64 2, i64 1, i32* %3)
%197 = add nuw nsw i64 %107, 1
%198 = icmp eq i64 %197, 8
br i1 %198, label %199, label %106
199: ; preds = %194, %98
%200 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i64 2, i64 1, i32* %3)
ret void
}