#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 *rows[] = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"};
  const char *cols[] = {"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 - 60 + 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 + 2;
      }
      if (!yourBoard)
        drawText(x - textWidthSpace, y + textWidthSpace + textWidthSpace / 4,
                 rows[i / 10]);
    }
    if (i <= 9 && !yourBoard) {
      drawText(x + textWidthSpace / 2, y - textWidthSpace, cols[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, 0));
    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    $0x3c,%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    $0x2,%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,%esi
xor    %edx,%edx
mov    %esi,%edi
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,0x4(%rsp)
test   %esi,%esi
mov    $0x78,%eax
mov    $0xa0,%ebx
cmovne %eax,%ebx
mov    $0x1,%eax
mov    $0x3d,%ebp
cmovne %eax,%ebp
mov    %rdi,0x10(%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,(%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,0x8(%rsp)
lea    0x2(%rax),%ecx
mov    %ecx,0x1c(%rsp)
add    $0x1,%eax
mov    %eax,0x24(%rsp)
lea    0x2c1e(%rip),%r15
xor    %r12d,%r12d
mov    %r13d,0x20(%rsp)
mov    %r13d,%ebx
jmp    11ff <displayBoard+0xcf>
nop
mov    $0x80,%edi
mov    $0x80,%esi
mov    $0x80,%edx
call   1030 <colorRGB@plt>
mov    %ebx,%edi
mov    (%rsp),%esi
mov    %ebp,%edx
mov    %ebp,%ecx
mov    %eax,%r8d
call   1050 <drawBox@plt>
add    0x24(%rsp),%ebx
add    $0x1,%r12
add    $0xff,%r14b
add    $0x8,%r15
cmp    $0x64,%r12
je     136a <displayBoard+0x23a>
movzbl %r12b,%eax
imul   $0xcd,%eax,%eax
shr    $0xb,%eax
lea    (%rax,%rax,1),%ecx
lea    (%rcx,%rcx,4),%ecx
add    %r14b,%cl
je     1240 <displayBoard+0x110>
mov    (%rsp),%eax
mov    %eax,%r13d
cmpl   $0x0,0x4(%rsp)
jne    1264 <displayBoard+0x134>
cmp    $0x9,%r12
ja     1264 <displayBoard+0x134>
lea    0x5(%rbx),%edi
lea    -0xa(%r13),%esi
mov    (%r15),%rdx
call   1040 <drawText@plt>
jmp    1264 <displayBoard+0x134>
nopl   0x0(%rax,%rax,1)
cmp    $0xa,%r12
mov    $0x0,%r13d
cmovae 0x1c(%rsp),%r13d
cmovae 0x20(%rsp),%ebx
add    (%rsp),%r13d
cmpl   $0x0,0x4(%rsp)
je     1340 <displayBoard+0x210>
mov    %r13d,%eax
mov    %r13d,(%rsp)
mov    0x10(%rsp),%r13
mov    0x8(%rsp),%rbp
mov    0x0(%r13,%r12,4),%eax
test   %eax,%eax
je     12a0 <displayBoard+0x170>
cmp    $0x2,%eax
je     12c9 <displayBoard+0x199>
cmp    $0x4,%eax
je     12f5 <displayBoard+0x1c5>
cmpl   $0x0,0x4(%rsp)
jne    1320 <displayBoard+0x1f0>
jmp    1329 <displayBoard+0x1f9>
nopl   0x0(%rax,%rax,1)
xor    %edi,%edi
xor    %esi,%esi
mov    $0xff,%edx
call   1030 <colorRGB@plt>
mov    %ebx,%edi
mov    (%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    1283 <displayBoard+0x153>
mov    $0xff,%edi
mov    $0xff,%esi
xor    %edx,%edx
call   1030 <colorRGB@plt>
mov    %ebx,%edi
mov    (%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    1288 <displayBoard+0x158>
mov    $0xff,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <colorRGB@plt>
mov    %ebx,%edi
mov    (%rsp),%esi
mov    %ebp,%edx
mov    %ebp,%ecx
mov    %eax,%r8d
call   1050 <drawBox@plt>
mov    0x0(%r13,%r12,4),%eax
cmpl   $0x0,0x4(%rsp)
je     1329 <displayBoard+0x1f9>
cmp    $0x8,%eax
jge    11c0 <displayBoard+0x90>
cmp    $0x8,%eax
jl     11e5 <displayBoard+0xb5>
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    0x2a7f(%rip),%rcx
mov    (%rcx,%rax,8),%rdx
call   1040 <drawText@plt>
cmpl   $0x0,0x4(%rsp)
je     1224 <displayBoard+0xf4>
jmp    1264 <displayBoard+0x134>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"0\00"
@.str.1 = [2 x i8] c"1\00"
@.str.2 = [2 x i8] c"2\00"
@.str.3 = [2 x i8] c"3\00"
@.str.4 = [2 x i8] c"4\00"
@.str.5 = [2 x i8] c"5\00"
@.str.6 = [2 x i8] c"6\00"
@.str.7 = [2 x i8] c"7\00"
@.str.8 = [2 x i8] c"8\00"
@.str.9 = [2 x i8] c"9\00"
@__const.displayBoard.rows = [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)]
@__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)]
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, 60
%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, 2
%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 0)
%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"0\00"
@.str.1 = [2 x i8] c"1\00"
@.str.2 = [2 x i8] c"2\00"
@.str.3 = [2 x i8] c"3\00"
@.str.4 = [2 x i8] c"4\00"
@.str.5 = [2 x i8] c"5\00"
@.str.6 = [2 x i8] c"6\00"
@.str.7 = [2 x i8] c"7\00"
@.str.8 = [2 x i8] c"8\00"
@.str.9 = [2 x i8] c"9\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)]
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 61
%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, 2
%13 = add nuw nsw i32 %11, 1
br label %14
14: ; preds = %2, %81
%15 = phi i64 [ 0, %2 ], [ %83, %81 ]
%16 = phi i32 [ %6, %2 ], [ %82, %81 ]
%17 = phi i32 [ %5, %2 ], [ %47, %81 ]
%18 = trunc i64 %15 to i8
%19 = urem i8 %18, 10
%20 = udiv i8 %18, 10
%21 = icmp eq i8 %19, 0
br i1 %21, label %22, label %34
22: ; preds = %14
%23 = icmp ugt i64 %15, 9
%24 = select i1 %23, i32 %12, i32 0
%25 = add nsw i32 %24, %17
%26 = select i1 %23, i32 %6, i32 %16
br i1 %3, label %45, label %27
27: ; preds = %22
%28 = add nsw i32 %26, -10
%29 = add nsw i32 %25, 12
%30 = zext i8 %20 to i64
%31 = getelementptr inbounds [10 x i8*], [10 x i8*]* @__const.displayBoard.cols, i64 0, i64 %30
%32 = load i8*, i8** %31
%33 = tail call i32 @drawText(i32 %28, i32 %29, i8* %32)
br label %34
34: ; preds = %27, %14
%35 = phi i32 [ %25, %27 ], [ %17, %14 ]
%36 = phi i32 [ %26, %27 ], [ %16, %14 ]
%37 = icmp ugt i64 %15, 9
%38 = or i1 %3, %37
br i1 %38, label %45, label %39
39: ; preds = %34
%40 = add nsw i32 %36, 5
%41 = add nsw i32 %35, -10
%42 = getelementptr inbounds [10 x i8*], [10 x i8*]* @__const.displayBoard.cols, i64 0, i64 %15
%43 = load i8*, i8** %42
%44 = tail call i32 @drawText(i32 %40, i32 %41, i8* %43)
br label %45
45: ; preds = %22, %39, %34
%46 = phi i32 [ %36, %39 ], [ %36, %34 ], [ %26, %22 ]
%47 = phi i32 [ %35, %39 ], [ %35, %34 ], [ %25, %22 ]
%48 = getelementptr inbounds i32, i32* %0, i64 %15
%49 = load i32, i32* %48
%50 = icmp eq i32 %49, 0
br i1 %50, label %51, label %55
51: ; preds = %45
%52 = tail call i32 @colorRGB(i32 0, i32 0, i32 255)
%53 = tail call i32 @drawBox(i32 %46, i32 %47, i32 %11, i32 %11, i32 %52)
%54 = load i32, i32* %48
br label %55
55: ; preds = %51, %45
%56 = phi i32 [ %54, %51 ], [ %49, %45 ]
%57 = icmp eq i32 %56, 2
br i1 %57, label %58, label %62
58: ; preds = %55
%59 = tail call i32 @colorRGB(i32 255, i32 255, i32 0)
%60 = tail call i32 @drawBox(i32 %46, i32 %47, i32 %11, i32 %11, i32 %59)
%61 = load i32, i32* %48
br label %62
62: ; preds = %58, %55
%63 = phi i32 [ %61, %58 ], [ %56, %55 ]
%64 = icmp eq i32 %63, 4
br i1 %64, label %65, label %69
65: ; preds = %62
%66 = tail call i32 @colorRGB(i32 255, i32 0, i32 0)
%67 = tail call i32 @drawBox(i32 %46, i32 %47, i32 %11, i32 %11, i32 %66)
%68 = load i32, i32* %48
br label %69
69: ; preds = %65, %62
%70 = phi i32 [ %68, %65 ], [ %63, %62 ]
%71 = icmp sgt i32 %70, 7
%72 = and i1 %3, %71
br i1 %72, label %73, label %75
73: ; preds = %69
%74 = tail call i32 @colorRGB(i32 128, i32 128, i32 128)
br label %78
75: ; preds = %69
br i1 %71, label %76, label %81
76: ; preds = %75
%77 = tail call i32 @colorRGB(i32 0, i32 0, i32 255)
br label %78
78: ; preds = %73, %76
%79 = phi i32 [ %77, %76 ], [ %74, %73 ]
%80 = tail call i32 @drawBox(i32 %46, i32 %47, i32 %11, i32 %11, i32 %79)
br label %81
81: ; preds = %78, %75
%82 = add nsw i32 %13, %46
%83 = add nuw nsw i64 %15, 1
%84 = icmp eq i64 %83, 100
br i1 %84, label %85, label %14
85: ; preds = %81
ret void
}