#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ colorRGB(int, int, int);
int /*<<< orphan*/ drawBox(int, int, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ drawText(int, int, char const *);
void displayBoard(int board[], int yourBoard) {
  int x = 1;
  int y = 1;
  int dimension = 120;
  int top = 0;
  int left = 0;
  int textWidthSpace = 10;
  const char *cols[] = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J"};
  const char *rows[] = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"};
  if (yourBoard) {
    x = left = 1;
    y = top = 1;
  } else {
    x = left = dimension + 3 * textWidthSpace + 1;
    y = top = dimension - 50 + 1;
    dimension = 160;
  }
  drawBox(x, y, dimension, dimension, colorRGB(0, 0, 0));
  int square = dimension / 10;
  int i = 0;
  for (i = 0; i < 100; ++i) {
    if (i % 10 == 0) {
      if (i > 9) {
        x = left;
        y += square + 1;
      }
      if (!yourBoard)
        drawText(x - textWidthSpace, y + textWidthSpace + textWidthSpace / 4,
                 cols[i / 10]);
    }
    if (i <= 9 && !yourBoard) {
      drawText(x + textWidthSpace / 2, y - textWidthSpace, rows[i]);
    }
    if (board[i] == 0)
      drawBox(x, y, square, square, colorRGB(0, 0, 255));
    if (board[i] == 2)
      drawBox(x, y, square, square, colorRGB(255, 255, 255));
    if (board[i] == 4)
      drawBox(x, y, square, square, colorRGB(255, 0, 0));
    if (board[i] > 7 && yourBoard)
      drawBox(x, y, square, square, colorRGB(128, 128, 128));
    else if (board[i] > 7)
      drawBox(x, y, square, square, colorRGB(0, 0, 255));
    x += square + 1;
  }
}


x86 assembly (clang, -O0):
<displayBoard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x78,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0xa,-0x24(%rbp)
lea    -0x80(%rbp),%rdi
lea    0x2bf9(%rip),%rsi
mov    $0x50,%edx
call   1040 <memcpy@plt>
lea    -0xd0(%rbp),%rdi
lea    0x2c31(%rip),%rsi
mov    $0x50,%edx
call   1040 <memcpy@plt>
cmpl   $0x0,-0xc(%rbp)
je     11d4 <displayBoard+0x94>
movl   $0x1,-0x20(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x1,-0x1c(%rbp)
movl   $0x1,-0x14(%rbp)
jmp    11fc <displayBoard+0xbc>
mov    -0x18(%rbp),%eax
imul   $0x3,-0x24(%rbp),%ecx
add    %ecx,%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%eax
sub    $0x32,%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    %eax,-0x14(%rbp)
movl   $0xa0,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xe8(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0xe4(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0xe0(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0xdc(%rbp)
xor    %edx,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1030 <colorRGB@plt>
mov    -0xe8(%rbp),%edi
mov    -0xe4(%rbp),%esi
mov    -0xe0(%rbp),%edx
mov    -0xdc(%rbp),%ecx
mov    %eax,%r8d
call   1060 <drawBox@plt>
mov    -0x18(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0xd4(%rbp)
movl   $0x0,-0xd8(%rbp)
movl   $0x0,-0xd8(%rbp)
cmpl   $0x64,-0xd8(%rbp)
jge    1591 <displayBoard+0x451>
mov    -0xd8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    12f8 <displayBoard+0x1b8>
cmpl   $0x9,-0xd8(%rbp)
jle    12b6 <displayBoard+0x176>
mov    -0x20(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    12f3 <displayBoard+0x1b3>
mov    -0x10(%rbp),%edi
sub    -0x24(%rbp),%edi
mov    -0x14(%rbp),%esi
add    -0x24(%rbp),%esi
mov    -0x24(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
add    %eax,%esi
mov    -0xd8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cltq
mov    -0x80(%rbp,%rax,8),%rdx
call   1050 <drawText@plt>
jmp    12f8 <displayBoard+0x1b8>
cmpl   $0x9,-0xd8(%rbp)
jg     1339 <displayBoard+0x1f9>
cmpl   $0x0,-0xc(%rbp)
jne    1339 <displayBoard+0x1f9>
mov    -0x10(%rbp),%edi
mov    -0x24(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    %eax,%edi
mov    -0x14(%rbp),%esi
sub    -0x24(%rbp),%esi
movslq -0xd8(%rbp),%rax
mov    -0xd0(%rbp,%rax,8),%rdx
ff
call   1050 <drawText@plt>
mov    -0x8(%rbp),%rax
movslq -0xd8(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    13a6 <displayBoard+0x266>
mov    -0x10(%rbp),%eax
mov    %eax,-0xf8(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0xf4(%rbp)
mov    -0xd4(%rbp),%eax
mov    %eax,-0xf0(%rbp)
mov    -0xd4(%rbp),%eax
mov    %eax,-0xec(%rbp)
xor    %esi,%esi
mov    $0xff,%edx
mov    %esi,%edi
call   1030 <colorRGB@plt>
mov    -0xf8(%rbp),%edi
mov    -0xf4(%rbp),%esi
mov    -0xf0(%rbp),%edx
mov    -0xec(%rbp),%ecx
mov    %eax,%r8d
call   1060 <drawBox@plt>
mov    -0x8(%rbp),%rax
movslq -0xd8(%rbp),%rcx
cmpl   $0x2,(%rax,%rcx,4)
jne    1413 <displayBoard+0x2d3>
mov    -0x10(%rbp),%eax
mov    %eax,-0x108(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x104(%rbp)
mov    -0xd4(%rbp),%eax
mov    %eax,-0x100(%rbp)
mov    -0xd4(%rbp),%eax
mov    %eax,-0xfc(%rbp)
mov    $0xff,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1030 <colorRGB@plt>
mov    -0x108(%rbp),%edi
mov    -0x104(%rbp),%esi
mov    -0x100(%rbp),%edx
mov    -0xfc(%rbp),%ecx
mov    %eax,%r8d
call   1060 <drawBox@plt>
mov    -0x8(%rbp),%rax
movslq -0xd8(%rbp),%rcx
cmpl   $0x4,(%rax,%rcx,4)
jne    1480 <displayBoard+0x340>
mov    -0x10(%rbp),%eax
mov    %eax,-0x118(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x114(%rbp)
mov    -0xd4(%rbp),%eax
mov    %eax,-0x110(%rbp)
mov    -0xd4(%rbp),%eax
mov    %eax,-0x10c(%rbp)
mov    $0xff,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <colorRGB@plt>
mov    -0x118(%rbp),%edi
mov    -0x114(%rbp),%esi
mov    -0x110(%rbp),%edx
mov    -0x10c(%rbp),%ecx
mov    %eax,%r8d
call   1060 <drawBox@plt>
mov    -0x8(%rbp),%rax
movslq -0xd8(%rbp),%rcx
cmpl   $0x7,(%rax,%rcx,4)
jle    14fc <displayBoard+0x3bc>
cmpl   $0x0,-0xc(%rbp)
je     14fc <displayBoard+0x3bc>
mov    -0x10(%rbp),%eax
mov    %eax,-0x128(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x124(%rbp)
mov    -0xd4(%rbp),%eax
mov    %eax,-0x120(%rbp)
mov    -0xd4(%rbp),%eax
mov    %eax,-0x11c(%rbp)
mov    $0x80,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1030 <colorRGB@plt>
mov    -0x128(%rbp),%edi
mov    -0x124(%rbp),%esi
mov    -0x120(%rbp),%edx
mov    -0x11c(%rbp),%ecx
mov    %eax,%r8d
call   1060 <drawBox@plt>
jmp    156e <displayBoard+0x42e>
mov    -0x8(%rbp),%rax
movslq -0xd8(%rbp),%rcx
cmpl   $0x7,(%rax,%rcx,4)
jle    1569 <displayBoard+0x429>
mov    -0x10(%rbp),%eax
mov    %eax,-0x138(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x134(%rbp)
mov    -0xd4(%rbp),%eax
mov    %eax,-0x130(%rbp)
mov    -0xd4(%rbp),%eax
mov    %eax,-0x12c(%rbp)
xor    %esi,%esi
mov    $0xff,%edx
mov    %esi,%edi
call   1030 <colorRGB@plt>
mov    -0x138(%rbp),%edi
mov    -0x134(%rbp),%esi
mov    -0x130(%rbp),%edx
mov    -0x12c(%rbp),%ecx
mov    %eax,%r8d
call   1060 <drawBox@plt>
jmp    156e <displayBoard+0x42e>
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xd8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd8(%rbp)
jmp    1270 <displayBoard+0x130>
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<displayBoard>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %esi,0x8(%rsp)
test   %esi,%esi
mov    $0x78,%eax
mov    $0xa0,%ebx
cmovne %eax,%ebx
mov    $0x1,%eax
mov    $0x47,%ebp
cmovne %eax,%ebp
mov    %rdi,0x18(%rsp)
mov    $0x97,%r13d
cmovne %eax,%r13d
xor    %r14d,%r14d
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <colorRGB@plt>
mov    %r13d,%edi
mov    %ebp,0x4(%rsp)
mov    %ebp,%esi
mov    %ebx,%edx
mov    %ebx,%ecx
mov    %eax,%r8d
call   1050 <drawBox@plt>
imul   $0xcd,%ebx,%eax
shr    $0xb,%eax
mov    %rax,0x10(%rsp)
add    $0x1,%eax
mov    %eax,0xc(%rsp)
lea    0xea4(%rip),%r15
xor    %r12d,%r12d
mov    %r13d,0x24(%rsp)
mov    %r13d,%ebx
jmp    1200 <displayBoard+0xd0>
nopl   0x0(%rax)
mov    $0x80,%edi
mov    $0x80,%esi
mov    $0x80,%edx
call   1030 <colorRGB@plt>
mov    %ebx,%edi
mov    0x4(%rsp),%esi
mov    %ebp,%edx
mov    %ebp,%ecx
mov    %eax,%r8d
call   1050 <drawBox@plt>
add    0xc(%rsp),%ebx
add    $0x1,%r12
add    $0x4,%r15
add    $0xff,%r14b
cmp    $0x64,%r12
je     1383 <displayBoard+0x253>
movzbl %r12b,%eax
imul   $0xcd,%eax,%eax
shr    $0xb,%eax
lea    (%rax,%rax,1),%ecx
lea    (%rcx,%rcx,4),%ecx
add    %r14b,%cl
je     1250 <displayBoard+0x120>
mov    0x4(%rsp),%eax
mov    %eax,%r13d
cmpl   $0x0,0x8(%rsp)
jne    1275 <displayBoard+0x145>
cmp    $0x9,%r12
ja     1275 <displayBoard+0x145>
lea    0x5(%rbx),%edi
lea    -0xa(%r13),%esi
movslq (%r15),%rdx
lea    0xe13(%rip),%rax
add    %rax,%rdx
call   1040 <drawText@plt>
jmp    1275 <displayBoard+0x145>
nopw   0x0(%rax,%rax,1)
cmp    $0xa,%r12
mov    $0x0,%r13d
cmovae 0xc(%rsp),%r13d
cmovae 0x24(%rsp),%ebx
add    0x4(%rsp),%r13d
cmpl   $0x0,0x8(%rsp)
je     1356 <displayBoard+0x226>
mov    %r13d,%eax
mov    %r13d,0x4(%rsp)
mov    0x18(%rsp),%r13
mov    0x10(%rsp),%rbp
mov    0x0(%r13,%r12,4),%eax
test   %eax,%eax
je     12b0 <displayBoard+0x180>
cmp    $0x2,%eax
je     12da <displayBoard+0x1aa>
cmp    $0x4,%eax
je     130a <displayBoard+0x1da>
cmpl   $0x0,0x8(%rsp)
jne    1336 <displayBoard+0x206>
jmp    133f <displayBoard+0x20f>
nopw   0x0(%rax,%rax,1)
xor    %edi,%edi
xor    %esi,%esi
mov    $0xff,%edx
call   1030 <colorRGB@plt>
mov    %ebx,%edi
mov    0x4(%rsp),%esi
mov    %ebp,%edx
mov    %ebp,%ecx
mov    %eax,%r8d
call   1050 <drawBox@plt>
mov    0x0(%r13,%r12,4),%eax
cmp    $0x2,%eax
jne    1295 <displayBoard+0x165>
mov    $0xff,%edi
mov    $0xff,%esi
mov    $0xff,%edx
call   1030 <colorRGB@plt>
mov    %ebx,%edi
mov    0x4(%rsp),%esi
mov    %ebp,%edx
mov    %ebp,%ecx
mov    %eax,%r8d
call   1050 <drawBox@plt>
mov    0x0(%r13,%r12,4),%eax
cmp    $0x4,%eax
jne    129a <displayBoard+0x16a>
mov    $0xff,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <colorRGB@plt>
mov    %ebx,%edi
mov    0x4(%rsp),%esi
mov    %ebp,%edx
mov    %ebp,%ecx
mov    %eax,%r8d
call   1050 <drawBox@plt>
mov    0x0(%r13,%r12,4),%eax
cmpl   $0x0,0x8(%rsp)
je     133f <displayBoard+0x20f>
cmp    $0x8,%eax
jge    11c0 <displayBoard+0x90>
cmp    $0x8,%eax
jl     11e6 <displayBoard+0xb6>
xor    %edi,%edi
xor    %esi,%esi
mov    $0xff,%edx
jmp    11cf <displayBoard+0x9f>
lea    -0xa(%rbx),%edi
lea    0xc(%r13),%esi
movzbl %al,%eax
lea    0xcc1(%rip),%rcx
movslq (%rcx,%rax,4),%rdx
add    %rcx,%rdx
call   1040 <drawText@plt>
cmpl   $0x0,0x8(%rsp)
je     1226 <displayBoard+0xf6>
jmp    1275 <displayBoard+0x145>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"A\00"
@.str.1 = [2 x i8] c"B\00"
@.str.2 = [2 x i8] c"C\00"
@.str.3 = [2 x i8] c"D\00"
@.str.4 = [2 x i8] c"E\00"
@.str.5 = [2 x i8] c"F\00"
@.str.6 = [2 x i8] c"G\00"
@.str.7 = [2 x i8] c"H\00"
@.str.8 = [2 x i8] c"I\00"
@.str.9 = [2 x i8] c"J\00"
@__const.displayBoard.cols = [10 x i8*] [i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i32 0, i32 0)]
@.str.10 = [2 x i8] c"0\00"
@.str.11 = [2 x i8] c"1\00"
@.str.12 = [2 x i8] c"2\00"
@.str.13 = [2 x i8] c"3\00"
@.str.14 = [2 x i8] c"4\00"
@.str.15 = [2 x i8] c"5\00"
@.str.16 = [2 x i8] c"6\00"
@.str.17 = [2 x i8] c"7\00"
@.str.18 = [2 x i8] c"8\00"
@.str.19 = [2 x i8] c"9\00"
@__const.displayBoard.rows = [10 x i8*] [i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.19, i32 0, i32 0)]
define void @displayBoard(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca [10 x i8*]
%12 = alloca [10 x i8*]
%13 = alloca i32
%14 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 1, i32* %5
store i32 1, i32* %6
store i32 120, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
store i32 10, i32* %10
%15 = bitcast [10 x i8*]* %11 to i8*
%16 = bitcast [10 x i8*]* %12 to i8*
%17 = load i32, i32* %4
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %2
store i32 1, i32* %9
store i32 1, i32* %5
store i32 1, i32* %8
store i32 1, i32* %6
br label %29
20: ; preds = %2
%21 = load i32, i32* %7
%22 = load i32, i32* %10
%23 = mul nsw i32 3, %22
%24 = add nsw i32 %21, %23
%25 = add nsw i32 %24, 1
store i32 %25, i32* %9
store i32 %25, i32* %5
%26 = load i32, i32* %7
%27 = sub nsw i32 %26, 50
%28 = add nsw i32 %27, 1
store i32 %28, i32* %8
store i32 %28, i32* %6
store i32 160, i32* %7
br label %29
29: ; preds = %20, %19
%30 = load i32, i32* %5
%31 = load i32, i32* %6
%32 = load i32, i32* %7
%33 = load i32, i32* %7
%34 = call i32 @colorRGB(i32 0, i32 0, i32 0)
%35 = call i32 @drawBox(i32 %30, i32 %31, i32 %32, i32 %33, i32 %34)
%36 = load i32, i32* %7
%37 = sdiv i32 %36, 10
store i32 %37, i32* %13
store i32 0, i32* %14
store i32 0, i32* %14
br label %38
38: ; preds = %172, %29
%39 = load i32, i32* %14
%40 = icmp slt i32 %39, 100
br i1 %40, label %41, label %175
41: ; preds = %38
%42 = load i32, i32* %14
%43 = srem i32 %42, 10
%44 = icmp eq i32 %43, 0
br i1 %44, label %45, label %74
45: ; preds = %41
%46 = load i32, i32* %14
%47 = icmp sgt i32 %46, 9
br i1 %47, label %48, label %54
48: ; preds = %45
%49 = load i32, i32* %9
store i32 %49, i32* %5
%50 = load i32, i32* %13
%51 = add nsw i32 %50, 1
%52 = load i32, i32* %6
%53 = add nsw i32 %52, %51
store i32 %53, i32* %6
br label %54
54: ; preds = %48, %45
%55 = load i32, i32* %4
%56 = icmp ne i32 %55, 0
br i1 %56, label %73, label %57
57: ; preds = %54
%58 = load i32, i32* %5
%59 = load i32, i32* %10
%60 = sub nsw i32 %58, %59
%61 = load i32, i32* %6
%62 = load i32, i32* %10
%63 = add nsw i32 %61, %62
%64 = load i32, i32* %10
%65 = sdiv i32 %64, 4
%66 = add nsw i32 %63, %65
%67 = load i32, i32* %14
%68 = sdiv i32 %67, 10
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds [10 x i8*], [10 x i8*]* %11, i64 0, i64 %69
%71 = load i8*, i8** %70
%72 = call i32 @drawText(i32 %60, i32 %66, i8* %71)
br label %73
73: ; preds = %57, %54
br label %74
74: ; preds = %73, %41
%75 = load i32, i32* %14
%76 = icmp sle i32 %75, 9
br i1 %76, label %77, label %93
77: ; preds = %74
%78 = load i32, i32* %4
%79 = icmp ne i32 %78, 0
br i1 %79, label %93, label %80
80: ; preds = %77
%81 = load i32, i32* %5
%82 = load i32, i32* %10
%83 = sdiv i32 %82, 2
%84 = add nsw i32 %81, %83
%85 = load i32, i32* %6
%86 = load i32, i32* %10
%87 = sub nsw i32 %85, %86
%88 = load i32, i32* %14
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds [10 x i8*], [10 x i8*]* %12, i64 0, i64 %89
%91 = load i8*, i8** %90
%92 = call i32 @drawText(i32 %84, i32 %87, i8* %91)
br label %93
93: ; preds = %80, %77, %74
%94 = load i32*, i32** %3
%95 = load i32, i32* %14
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds i32, i32* %94, i64 %96
%98 = load i32, i32* %97
%99 = icmp eq i32 %98, 0
br i1 %99, label %100, label %107
100: ; preds = %93
%101 = load i32, i32* %5
%102 = load i32, i32* %6
%103 = load i32, i32* %13
%104 = load i32, i32* %13
%105 = call i32 @colorRGB(i32 0, i32 0, i32 255)
%106 = call i32 @drawBox(i32 %101, i32 %102, i32 %103, i32 %104, i32 %105)
br label %107
107: ; preds = %100, %93
%108 = load i32*, i32** %3
%109 = load i32, i32* %14
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds i32, i32* %108, i64 %110
%112 = load i32, i32* %111
%113 = icmp eq i32 %112, 2
br i1 %113, label %114, label %121
114: ; preds = %107
%115 = load i32, i32* %5
%116 = load i32, i32* %6
%117 = load i32, i32* %13
%118 = load i32, i32* %13
%119 = call i32 @colorRGB(i32 255, i32 255, i32 255)
%120 = call i32 @drawBox(i32 %115, i32 %116, i32 %117, i32 %118, i32 %119)
br label %121
121: ; preds = %114, %107
%122 = load i32*, i32** %3
%123 = load i32, i32* %14
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds i32, i32* %122, i64 %124
%126 = load i32, i32* %125
%127 = icmp eq i32 %126, 4
br i1 %127, label %128, label %135
128: ; preds = %121
%129 = load i32, i32* %5
%130 = load i32, i32* %6
%131 = load i32, i32* %13
%132 = load i32, i32* %13
%133 = call i32 @colorRGB(i32 255, i32 0, i32 0)
%134 = call i32 @drawBox(i32 %129, i32 %130, i32 %131, i32 %132, i32 %133)
br label %135
135: ; preds = %128, %121
%136 = load i32*, i32** %3
%137 = load i32, i32* %14
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds i32, i32* %136, i64 %138
%140 = load i32, i32* %139
%141 = icmp sgt i32 %140, 7
br i1 %141, label %142, label %152
142: ; preds = %135
%143 = load i32, i32* %4
%144 = icmp ne i32 %143, 0
br i1 %144, label %145, label %152
145: ; preds = %142
%146 = load i32, i32* %5
%147 = load i32, i32* %6
%148 = load i32, i32* %13
%149 = load i32, i32* %13
%150 = call i32 @colorRGB(i32 128, i32 128, i32 128)
%151 = call i32 @drawBox(i32 %146, i32 %147, i32 %148, i32 %149, i32 %150)
br label %167
152: ; preds = %142, %135
%153 = load i32*, i32** %3
%154 = load i32, i32* %14
%155 = sext i32 %154 to i64
%156 = getelementptr inbounds i32, i32* %153, i64 %155
%157 = load i32, i32* %156
%158 = icmp sgt i32 %157, 7
br i1 %158, label %159, label %166
159: ; preds = %152
%160 = load i32, i32* %5
%161 = load i32, i32* %6
%162 = load i32, i32* %13
%163 = load i32, i32* %13
%164 = call i32 @colorRGB(i32 0, i32 0, i32 255)
%165 = call i32 @drawBox(i32 %160, i32 %161, i32 %162, i32 %163, i32 %164)
br label %166
166: ; preds = %159, %152
br label %167
167: ; preds = %166, %145
%168 = load i32, i32* %13
%169 = add nsw i32 %168, 1
%170 = load i32, i32* %5
%171 = add nsw i32 %170, %169
store i32 %171, i32* %5
br label %172
172: ; preds = %167
%173 = load i32, i32* %14
%174 = add nsw i32 %173, 1
store i32 %174, i32* %14
br label %38
175: ; preds = %38
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"A\00"
@.str.1 = [2 x i8] c"B\00"
@.str.2 = [2 x i8] c"C\00"
@.str.3 = [2 x i8] c"D\00"
@.str.4 = [2 x i8] c"E\00"
@.str.5 = [2 x i8] c"F\00"
@.str.6 = [2 x i8] c"G\00"
@.str.7 = [2 x i8] c"H\00"
@.str.8 = [2 x i8] c"I\00"
@.str.9 = [2 x i8] c"J\00"
@reltable.displayBoard = [10 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str to i64), i64 ptrtoint ([10 x i32]* @reltable.displayBoard to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.1 to i64), i64 ptrtoint ([10 x i32]* @reltable.displayBoard to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.2 to i64), i64 ptrtoint ([10 x i32]* @reltable.displayBoard to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.3 to i64), i64 ptrtoint ([10 x i32]* @reltable.displayBoard to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.4 to i64), i64 ptrtoint ([10 x i32]* @reltable.displayBoard to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.5 to i64), i64 ptrtoint ([10 x i32]* @reltable.displayBoard to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.6 to i64), i64 ptrtoint ([10 x i32]* @reltable.displayBoard to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.7 to i64), i64 ptrtoint ([10 x i32]* @reltable.displayBoard to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.8 to i64), i64 ptrtoint ([10 x i32]* @reltable.displayBoard to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.9 to i64), i64 ptrtoint ([10 x i32]* @reltable.displayBoard to i64)) to i32)]
@.str.10 = [2 x i8] c"0\00"
@.str.11 = [2 x i8] c"1\00"
@.str.12 = [2 x i8] c"2\00"
@.str.13 = [2 x i8] c"3\00"
@.str.14 = [2 x i8] c"4\00"
@.str.15 = [2 x i8] c"5\00"
@.str.16 = [2 x i8] c"6\00"
@.str.17 = [2 x i8] c"7\00"
@.str.18 = [2 x i8] c"8\00"
@.str.19 = [2 x i8] c"9\00"
@reltable.displayBoard.20 = [10 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.10 to i64), i64 ptrtoint ([10 x i32]* @reltable.displayBoard.20 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.11 to i64), i64 ptrtoint ([10 x i32]* @reltable.displayBoard.20 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.12 to i64), i64 ptrtoint ([10 x i32]* @reltable.displayBoard.20 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.13 to i64), i64 ptrtoint ([10 x i32]* @reltable.displayBoard.20 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.14 to i64), i64 ptrtoint ([10 x i32]* @reltable.displayBoard.20 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.15 to i64), i64 ptrtoint ([10 x i32]* @reltable.displayBoard.20 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.16 to i64), i64 ptrtoint ([10 x i32]* @reltable.displayBoard.20 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.17 to i64), i64 ptrtoint ([10 x i32]* @reltable.displayBoard.20 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.18 to i64), i64 ptrtoint ([10 x i32]* @reltable.displayBoard.20 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.19 to i64), i64 ptrtoint ([10 x i32]* @reltable.displayBoard.20 to i64)) to i32)]
define void @displayBoard(i32* nocapture %0, i32 %1) {
%3 = icmp ne i32 %1, 0
%4 = select i1 %3, i32 120, i32 160
%5 = select i1 %3, i32 1, i32 71
%6 = select i1 %3, i32 1, i32 151
%7 = tail call i32 @colorRGB(i32 0, i32 0, i32 0)
%8 = tail call i32 @drawBox(i32 %6, i32 %5, i32 %4, i32 %4, i32 %7)
%9 = trunc i32 %4 to i8
%10 = udiv i8 %9, 10
%11 = zext i8 %10 to i32
%12 = add nuw nsw i32 %11, 1
br label %13
13: ; preds = %2, %80
%14 = phi i64 [ 0, %2 ], [ %82, %80 ]
%15 = phi i32 [ %6, %2 ], [ %81, %80 ]
%16 = phi i32 [ %5, %2 ], [ %46, %80 ]
%17 = trunc i64 %14 to i8
%18 = urem i8 %17, 10
%19 = udiv i8 %17, 10
%20 = icmp eq i8 %18, 0
br i1 %20, label %21, label %33
21: ; preds = %13
%22 = icmp ugt i64 %14, 9
%23 = select i1 %22, i32 %12, i32 0
%24 = add nsw i32 %23, %16
%25 = select i1 %22, i32 %6, i32 %15
br i1 %3, label %44, label %26
26: ; preds = %21
%27 = add nsw i32 %25, -10
%28 = add nsw i32 %24, 12
%29 = zext i8 %19 to i64
%30 = shl i64 %29, 2
%31 = call i8* @llvm.load.relative.i64(i8* bitcast ([10 x i32]* @reltable.displayBoard to i8*), i64 %30)
%32 = tail call i32 @drawText(i32 %27, i32 %28, i8* %31)
br label %33
33: ; preds = %26, %13
%34 = phi i32 [ %24, %26 ], [ %16, %13 ]
%35 = phi i32 [ %25, %26 ], [ %15, %13 ]
%36 = icmp ugt i64 %14, 9
%37 = or i1 %3, %36
br i1 %37, label %44, label %38
38: ; preds = %33
%39 = add nsw i32 %35, 5
%40 = add nsw i32 %34, -10
%41 = shl i64 %14, 2
%42 = call i8* @llvm.load.relative.i64(i8* bitcast ([10 x i32]* @reltable.displayBoard.20 to i8*), i64 %41)
%43 = tail call i32 @drawText(i32 %39, i32 %40, i8* %42)
br label %44
44: ; preds = %21, %38, %33
%45 = phi i32 [ %35, %38 ], [ %35, %33 ], [ %25, %21 ]
%46 = phi i32 [ %34, %38 ], [ %34, %33 ], [ %24, %21 ]
%47 = getelementptr inbounds i32, i32* %0, i64 %14
%48 = load i32, i32* %47
%49 = icmp eq i32 %48, 0
br i1 %49, label %50, label %54
50: ; preds = %44
%51 = tail call i32 @colorRGB(i32 0, i32 0, i32 255)
%52 = tail call i32 @drawBox(i32 %45, i32 %46, i32 %11, i32 %11, i32 %51)
%53 = load i32, i32* %47
br label %54
54: ; preds = %50, %44
%55 = phi i32 [ %53, %50 ], [ %48, %44 ]
%56 = icmp eq i32 %55, 2
br i1 %56, label %57, label %61
57: ; preds = %54
%58 = tail call i32 @colorRGB(i32 255, i32 255, i32 255)
%59 = tail call i32 @drawBox(i32 %45, i32 %46, i32 %11, i32 %11, i32 %58)
%60 = load i32, i32* %47
br label %61
61: ; preds = %57, %54
%62 = phi i32 [ %60, %57 ], [ %55, %54 ]
%63 = icmp eq i32 %62, 4
br i1 %63, label %64, label %68
64: ; preds = %61
%65 = tail call i32 @colorRGB(i32 255, i32 0, i32 0)
%66 = tail call i32 @drawBox(i32 %45, i32 %46, i32 %11, i32 %11, i32 %65)
%67 = load i32, i32* %47
br label %68
68: ; preds = %64, %61
%69 = phi i32 [ %67, %64 ], [ %62, %61 ]
%70 = icmp sgt i32 %69, 7
%71 = and i1 %3, %70
br i1 %71, label %72, label %74
72: ; preds = %68
%73 = tail call i32 @colorRGB(i32 128, i32 128, i32 128)
br label %77
74: ; preds = %68
br i1 %70, label %75, label %80
75: ; preds = %74
%76 = tail call i32 @colorRGB(i32 0, i32 0, i32 255)
br label %77
77: ; preds = %72, %75
%78 = phi i32 [ %76, %75 ], [ %73, %72 ]
%79 = tail call i32 @drawBox(i32 %45, i32 %46, i32 %11, i32 %11, i32 %78)
br label %80
80: ; preds = %77, %74
%81 = add nsw i32 %12, %45
%82 = add nuw nsw i64 %14, 1
%83 = icmp eq i64 %82, 100
br i1 %83, label %84, label %13
84: ; preds = %80
ret void
}