void print_tile(int num, int tile_num) {
  char color[20];
  char before[8];
  char after[8];
  int row, col;
  int p_y, p_x;
  switch (num) {
  case 2:
    strcpy(color, "\e[48;2;134;222;132m");
    strcpy(before, "    ");
    strcpy(after, "     ");
    break;
  case 4:
    strcpy(color, "\e[48;2;103;204;252m");
    strcpy(before, "    ");
    strcpy(after, "     ");
    break;
  case 8:
    strcpy(color, "\e[48;2;153;51;255m");
    strcpy(before, "    ");
    strcpy(after, "     ");
    break;
  case 16:
    strcpy(color, "\e[48;2;255;154;154m");
    strcpy(before, "    ");
    strcpy(after, "    ");
    break;
  case 32:
    strcpy(color, "\e[48;2;255;227;153m");
    strcpy(before, "    ");
    strcpy(after, "    ");
    break;
  case 64:
    strcpy(color, "\e[48;2;163;205;73m");
    strcpy(before, "    ");
    strcpy(after, "    ");
    break;
  case 128:
    strcpy(color, "\e[48;2;13;169;175m");
    strcpy(before, "   ");
    strcpy(after, "    ");
    break;
  case 256:
    strcpy(color, "\e[48;2;108;56;153m");
    strcpy(before, "   ");
    strcpy(after, "    ");
    break;
  case 512:
    strcpy(color, "\e[48;2;238;197;221m");
    strcpy(before, "   ");
    strcpy(after, "    ");
    break;
  case 1024:
    strcpy(color, "\e[48;2;148;24;24m");
    strcpy(before, "   ");
    strcpy(after, "   ");
    break;
  case 2048:
    strcpy(color, "\e[48;2;0;0;0m");
    strcpy(before, "   ");
    strcpy(after, "   ");
    break;
  case 4096:
    strcpy(color, "\e[48;2;200;200;200m");
    strcpy(before, "   ");
    strcpy(after, "   ");
    break;
  default:
    break;
  }
  row = (int)(tile_num / 4 + 1);
  col = tile_num % 4 + 1;
  p_y = (row - 1) * 6 + 1;
  p_x = (col - 1) * 11 + 1;
  if (num == 0) {
    printf("\e[0m");
    printf("\e[%d;%dH          ", p_y, p_x);
    printf("\e[%d;%dH          ", p_y + 1, p_x);
    printf("\e[%d;%dH          ", p_y + 2, p_x);
    printf("\e[%d;%dH          ", p_y + 3, p_x);
    printf("\e[%d;%dH          ", p_y + 4, p_x);
    printf("\e[0m");
  } else {
    printf("%s", color);
    printf("\e[%d;%dH          ", p_y, p_x);
    printf("\e[%d;%dH          ", p_y + 1, p_x);
    printf("\e[%d;%dH%s%d%s", p_y + 2, p_x, before, num, after);
    printf("\e[%d;%dH          ", p_y + 3, p_x);
    printf("\e[%d;%dH          ", p_y + 4, p_x);
    printf("\e[0m");
  }
}


x86 assembly (clang, -O0):
<print_tile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x44(%rbp)
sub    $0x2,%eax
je     1209 <print_tile+0xe9>
jmp    1142 <print_tile+0x22>
mov    -0x44(%rbp),%eax
sub    $0x4,%eax
je     123e <print_tile+0x11e>
jmp    1153 <print_tile+0x33>
mov    -0x44(%rbp),%eax
sub    $0x8,%eax
je     1273 <print_tile+0x153>
jmp    1164 <print_tile+0x44>
mov    -0x44(%rbp),%eax
sub    $0x10,%eax
je     12a8 <print_tile+0x188>
jmp    1175 <print_tile+0x55>
mov    -0x44(%rbp),%eax
sub    $0x20,%eax
je     12dd <print_tile+0x1bd>
jmp    1186 <print_tile+0x66>
mov    -0x44(%rbp),%eax
sub    $0x40,%eax
je     1312 <print_tile+0x1f2>
jmp    1197 <print_tile+0x77>
mov    -0x44(%rbp),%eax
sub    $0x80,%eax
je     1347 <print_tile+0x227>
jmp    11aa <print_tile+0x8a>
mov    -0x44(%rbp),%eax
sub    $0x100,%eax
je     137c <print_tile+0x25c>
jmp    11bd <print_tile+0x9d>
mov    -0x44(%rbp),%eax
sub    $0x200,%eax
je     13b1 <print_tile+0x291>
jmp    11d0 <print_tile+0xb0>
mov    -0x44(%rbp),%eax
sub    $0x400,%eax
je     13e6 <print_tile+0x2c6>
jmp    11e3 <print_tile+0xc3>
mov    -0x44(%rbp),%eax
sub    $0x800,%eax
je     141b <print_tile+0x2fb>
jmp    11f6 <print_tile+0xd6>
mov    -0x44(%rbp),%eax
sub    $0x1000,%eax
je     1450 <print_tile+0x330>
jmp    1485 <print_tile+0x365>
lea    -0x20(%rbp),%rdi
lea    0xdec(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x28(%rbp),%rdi
lea    0xed3(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x30(%rbp),%rdi
lea    0xec2(%rip),%rsi
call   1030 <strcpy@plt>
jmp    148a <print_tile+0x36a>
lea    -0x20(%rbp),%rdi
lea    0xdcb(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x28(%rbp),%rdi
lea    0xe9e(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x30(%rbp),%rdi
lea    0xe8d(%rip),%rsi
call   1030 <strcpy@plt>
jmp    148a <print_tile+0x36a>
lea    -0x20(%rbp),%rdi
lea    0xdaa(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x28(%rbp),%rdi
lea    0xe69(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x30(%rbp),%rdi
lea    0xe58(%rip),%rsi
call   1030 <strcpy@plt>
jmp    148a <print_tile+0x36a>
lea    -0x20(%rbp),%rdi
lea    0xd88(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x28(%rbp),%rdi
lea    0xe34(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x30(%rbp),%rdi
lea    0xe24(%rip),%rsi
call   1030 <strcpy@plt>
jmp    148a <print_tile+0x36a>
lea    -0x20(%rbp),%rdi
lea    0xd67(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x28(%rbp),%rdi
lea    0xdff(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x30(%rbp),%rdi
lea    0xdef(%rip),%rsi
call   1030 <strcpy@plt>
jmp    148a <print_tile+0x36a>
lea    -0x20(%rbp),%rdi
lea    0xd46(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x28(%rbp),%rdi
lea    0xdca(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x30(%rbp),%rdi
lea    0xdba(%rip),%rsi
call   1030 <strcpy@plt>
jmp    148a <print_tile+0x36a>
lea    -0x20(%rbp),%rdi
lea    0xd24(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x28(%rbp),%rdi
lea    0xd96(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x30(%rbp),%rdi
lea    0xd85(%rip),%rsi
call   1030 <strcpy@plt>
jmp    148a <print_tile+0x36a>
lea    -0x20(%rbp),%rdi
lea    0xd02(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x28(%rbp),%rdi
lea    0xd61(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x30(%rbp),%rdi
lea    0xd50(%rip),%rsi
call   1030 <strcpy@plt>
jmp    148a <print_tile+0x36a>
lea    -0x20(%rbp),%rdi
lea    0xce0(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x28(%rbp),%rdi
lea    0xd2c(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x30(%rbp),%rdi
lea    0xd1b(%rip),%rsi
call   1030 <strcpy@plt>
jmp    148a <print_tile+0x36a>
lea    -0x20(%rbp),%rdi
lea    0xcbf(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x28(%rbp),%rdi
lea    0xcf7(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x30(%rbp),%rdi
lea    0xce7(%rip),%rsi
call   1030 <strcpy@plt>
jmp    148a <print_tile+0x36a>
lea    -0x20(%rbp),%rdi
lea    0xc9c(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x28(%rbp),%rdi
lea    0xcc2(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x30(%rbp),%rdi
lea    0xcb2(%rip),%rsi
call   1030 <strcpy@plt>
jmp    148a <print_tile+0x36a>
lea    -0x20(%rbp),%rdi
lea    0xc75(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x28(%rbp),%rdi
lea    0xc8d(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x30(%rbp),%rdi
lea    0xc7d(%rip),%rsi
call   1030 <strcpy@plt>
jmp    148a <print_tile+0x36a>
jmp    148a <print_tile+0x36a>
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x38(%rbp)
mov    -0x34(%rbp),%eax
sub    $0x1,%eax
imul   $0x6,%eax,%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x38(%rbp),%eax
sub    $0x1,%eax
imul   $0xb,%eax,%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1565 <print_tile+0x445>
lea    0xc09(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x3c(%rbp),%esi
mov    -0x40(%rbp),%edx
lea    0xbfa(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x3c(%rbp),%esi
add    $0x1,%esi
mov    -0x40(%rbp),%edx
lea    0xbe3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x3c(%rbp),%esi
add    $0x2,%esi
mov    -0x40(%rbp),%edx
lea    0xbcc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x3c(%rbp),%esi
add    $0x3,%esi
mov    -0x40(%rbp),%edx
lea    0xbb5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x3c(%rbp),%esi
add    $0x4,%esi
mov    -0x40(%rbp),%edx
lea    0xb9e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xb8b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1601 <print_tile+0x4e1>
lea    -0x20(%rbp),%rsi
lea    0xb98(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x3c(%rbp),%esi
mov    -0x40(%rbp),%edx
lea    0xb65(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x3c(%rbp),%esi
add    $0x1,%esi
mov    -0x40(%rbp),%edx
lea    0xb4e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x3c(%rbp),%esi
add    $0x2,%esi
mov    -0x40(%rbp),%edx
lea    -0x28(%rbp),%rcx
mov    -0x4(%rbp),%r8d
lea    -0x30(%rbp),%r9
lea    0xb3e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x3c(%rbp),%esi
add    $0x3,%esi
mov    -0x40(%rbp),%edx
lea    0xb14(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x3c(%rbp),%esi
add    $0x4,%esi
mov    -0x40(%rbp),%edx
lea    0xafd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xaea(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_tile>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x30,%rsp
mov    %edi,%r14d
cmp    $0x7f,%edi
jg     115a <print_tile+0x4a>
lea    -0x2(%r14),%eax
cmp    $0x1e,%eax
ja     11e3 <print_tile+0xd3>
lea    0xec8(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movups 0xf34(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x6d3233,0x20(%rsp)
jmp    122d <print_tile+0x11d>
cmp    $0x3ff,%r14d
jg     11a3 <print_tile+0x93>
cmp    $0x80,%r14d
je     1286 <print_tile+0x176>
cmp    $0x100,%r14d
je     129c <print_tile+0x18c>
cmp    $0x200,%r14d
jne    1308 <print_tile+0x1f8>
movups 0xf87(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x6d3132,0x20(%rsp)
jmp    12b0 <print_tile+0x1a0>
cmp    $0x400,%r14d
je     12c6 <print_tile+0x1b6>
cmp    $0x800,%r14d
je     12db <print_tile+0x1cb>
cmp    $0x1000,%r14d
jne    1308 <print_tile+0x1f8>
movups 0xf7b(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x6d3030,0x20(%rsp)
jmp    12f9 <print_tile+0x1e9>
cmp    $0x40,%r14d
jne    1308 <print_tile+0x1f8>
movups 0xeeb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x6d3337,0x1f(%rsp)
jmp    1277 <print_tile+0x167>
movups 0xe86(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x6d3235,0x20(%rsp)
jmp    122d <print_tile+0x11d>
movups 0xe84(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x6d3535,0x1f(%rsp)
movl   $0x20202020,0x8(%rsp)
20
movb   $0x0,0xc(%rsp)
movl   $0x20202020,(%rsp)
movw   $0x20,0x4(%rsp)
jmp    1308 <print_tile+0x1f8>
movups 0xe63(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x6d3435,0x20(%rsp)
jmp    1277 <print_tile+0x167>
movups 0xe61(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x6d3335,0x20(%rsp)
movl   $0x20202020,0x8(%rsp)
20
movb   $0x0,0xc(%rsp)
jmp    12b8 <print_tile+0x1a8>
movups 0xe65(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x6d3537,0x1f(%rsp)
jmp    12b0 <print_tile+0x1a0>
movups 0xe62(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x6d3335,0x1f(%rsp)
movl   $0x202020,0x8(%rsp)
movl   $0x20202020,(%rsp)
movb   $0x0,0x4(%rsp)
jmp    1308 <print_tile+0x1f8>
movups 0xe5f(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movw   $0x6d,0x20(%rsp)
jmp    12f9 <print_tile+0x1e9>
movabs $0x6d303b303b303b,%rax
mov    %rax,0x16(%rsp)
movabs $0x303b323b38345b1b,%rax
32 3b 30
mov    %rax,0x10(%rsp)
movl   $0x202020,0x8(%rsp)
movl   $0x202020,(%rsp)
lea    0x3(%rsi),%eax
test   %esi,%esi
cmovns %esi,%eax
mov    %eax,%ecx
and    $0xfffffffc,%ecx
sub    %ecx,%esi
sar    $0x2,%eax
add    %eax,%eax
lea    (%rax,%rax,2),%ebx
mov    %ebx,%ebp
or     $0x1,%ebp
lea    (%rsi,%rsi,4),%eax
lea    (%rsi,%rax,2),%r12d
add    $0x1,%r12d
test   %r14d,%r14d
je     13cd <print_tile+0x2bd>
lea    0xe45(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe13(%rip),%r15
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r12d,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x2(%rbx),%esi
mov    %r15,%rdi
mov    %r12d,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x3(%rbx),%esi
lea    0xdfd(%rip),%rdi
lea    0x8(%rsp),%rcx
mov    %rsp,%r9
mov    %r12d,%edx
mov    %r14d,%r8d
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4(%rbx),%esi
mov    %r15,%rdi
mov    %r12d,%edx
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x5,%ebx
mov    %r15,%rdi
mov    %ebx,%esi
mov    %r12d,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xda7(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xd8c(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xd80(%rip),%r15
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r12d,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x2(%rbx),%esi
mov    %r15,%rdi
mov    %r12d,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x3(%rbx),%esi
mov    %r15,%rdi
mov    %r12d,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4(%rbx),%esi
mov    %r15,%rdi
mov    %r12d,%edx
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x5,%ebx
mov    %r15,%rdi
mov    %ebx,%esi
mov    %r12d,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r14,%rdi
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"\1B[48;2;134;222;132m\00"
@.str.1 = [5 x i8] c" \00"
@.str.2 = [6 x i8] c" \00"
@.str.3 = [20 x i8] c"\1B[48;2;103;204;252m\00"
@.str.4 = [19 x i8] c"\1B[48;2;153;51;255m\00"
@.str.5 = [20 x i8] c"\1B[48;2;255;154;154m\00"
@.str.6 = [20 x i8] c"\1B[48;2;255;227;153m\00"
@.str.7 = [19 x i8] c"\1B[48;2;163;205;73m\00"
@.str.8 = [19 x i8] c"\1B[48;2;13;169;175m\00"
@.str.9 = [4 x i8] c" \00"
@.str.10 = [19 x i8] c"\1B[48;2;108;56;153m\00"
@.str.11 = [20 x i8] c"\1B[48;2;238;197;221m\00"
@.str.12 = [18 x i8] c"\1B[48;2;148;24;24m\00"
@.str.13 = [14 x i8] c"\1B[48;2;0;0;0m\00"
@.str.14 = [20 x i8] c"\1B[48;2;200;200;200m\00"
@.str.15 = [5 x i8] c"\1B[0m\00"
@.str.16 = [19 x i8] c"\1B[%d;%dH \00"
@.str.17 = [3 x i8] c"%s\00"
@.str.18 = [15 x i8] c"\1B[%d;%dH%s%d%s\00"
define void @print_tile(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [20 x i8]
%6 = alloca [8 x i8]
%7 = alloca [8 x i8]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%12 = load i32, i32* %3
switch i32 %12, label %97 [
i32 2, label %13
i32 4, label %20
i32 8, label %27
i32 16, label %34
i32 32, label %41
i32 64, label %48
i32 128, label %55
i32 256, label %62
i32 512, label %69
i32 1024, label %76
i32 2048, label %83
i32 4096, label %90
]
13: ; preds = %2
%14 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%15 = call i8* @strcpy(i8* %14, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%16 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%17 = call i8* @strcpy(i8* %16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%18 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 0
%19 = call i8* @strcpy(i8* %18, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %98
20: ; preds = %2
%21 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%22 = call i8* @strcpy(i8* %21, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%23 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%24 = call i8* @strcpy(i8* %23, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%25 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 0
%26 = call i8* @strcpy(i8* %25, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %98
27: ; preds = %2
%28 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%29 = call i8* @strcpy(i8* %28, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%30 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%31 = call i8* @strcpy(i8* %30, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%32 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 0
%33 = call i8* @strcpy(i8* %32, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %98
34: ; preds = %2
%35 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%36 = call i8* @strcpy(i8* %35, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
%37 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%38 = call i8* @strcpy(i8* %37, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%39 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 0
%40 = call i8* @strcpy(i8* %39, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %98
41: ; preds = %2
%42 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%43 = call i8* @strcpy(i8* %42, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0))
%44 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%45 = call i8* @strcpy(i8* %44, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%46 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 0
%47 = call i8* @strcpy(i8* %46, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %98
48: ; preds = %2
%49 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%50 = call i8* @strcpy(i8* %49, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0))
%51 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%52 = call i8* @strcpy(i8* %51, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%53 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 0
%54 = call i8* @strcpy(i8* %53, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %98
55: ; preds = %2
%56 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%57 = call i8* @strcpy(i8* %56, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0))
%58 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%59 = call i8* @strcpy(i8* %58, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%60 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 0
%61 = call i8* @strcpy(i8* %60, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %98
62: ; preds = %2
%63 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%64 = call i8* @strcpy(i8* %63, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0))
%65 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%66 = call i8* @strcpy(i8* %65, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%67 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 0
%68 = call i8* @strcpy(i8* %67, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %98
69: ; preds = %2
%70 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%71 = call i8* @strcpy(i8* %70, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0))
%72 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%73 = call i8* @strcpy(i8* %72, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%74 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 0
%75 = call i8* @strcpy(i8* %74, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %98
76: ; preds = %2
%77 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%78 = call i8* @strcpy(i8* %77, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.12, i64 0, i64 0))
%79 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%80 = call i8* @strcpy(i8* %79, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%81 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 0
%82 = call i8* @strcpy(i8* %81, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
br label %98
83: ; preds = %2
%84 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%85 = call i8* @strcpy(i8* %84, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.13, i64 0, i64 0))
%86 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%87 = call i8* @strcpy(i8* %86, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%88 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 0
%89 = call i8* @strcpy(i8* %88, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
br label %98
90: ; preds = %2
%91 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%92 = call i8* @strcpy(i8* %91, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.14, i64 0, i64 0))
%93 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%94 = call i8* @strcpy(i8* %93, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%95 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 0
%96 = call i8* @strcpy(i8* %95, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
br label %98
97: ; preds = %2
br label %98
98: ; preds = %97, %90, %83, %76, %69, %62, %55, %48, %41, %34, %27, %20, %13
%99 = load i32, i32* %4
%100 = sdiv i32 %99, 4
%101 = add nsw i32 %100, 1
store i32 %101, i32* %8
%102 = load i32, i32* %4
%103 = srem i32 %102, 4
%104 = add nsw i32 %103, 1
store i32 %104, i32* %9
%105 = load i32, i32* %8
%106 = sub nsw i32 %105, 1
%107 = mul nsw i32 %106, 6
%108 = add nsw i32 %107, 1
store i32 %108, i32* %10
%109 = load i32, i32* %9
%110 = sub nsw i32 %109, 1
%111 = mul nsw i32 %110, 11
%112 = add nsw i32 %111, 1
store i32 %112, i32* %11
%113 = load i32, i32* %3
%114 = icmp eq i32 %113, 0
br i1 %114, label %115, label %137
115: ; preds = %98
%116 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0))
%117 = load i32, i32* %10
%118 = load i32, i32* %11
%119 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.16, i64 0, i64 0), i32 %117, i32 %118)
%120 = load i32, i32* %10
%121 = add nsw i32 %120, 1
%122 = load i32, i32* %11
%123 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.16, i64 0, i64 0), i32 %121, i32 %122)
%124 = load i32, i32* %10
%125 = add nsw i32 %124, 2
%126 = load i32, i32* %11
%127 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.16, i64 0, i64 0), i32 %125, i32 %126)
%128 = load i32, i32* %10
%129 = add nsw i32 %128, 3
%130 = load i32, i32* %11
%131 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.16, i64 0, i64 0), i32 %129, i32 %130)
%132 = load i32, i32* %10
%133 = add nsw i32 %132, 4
%134 = load i32, i32* %11
%135 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.16, i64 0, i64 0), i32 %133, i32 %134)
%136 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0))
br label %163
137: ; preds = %98
%138 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%139 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i64 0, i64 0), i8* %138)
%140 = load i32, i32* %10
%141 = load i32, i32* %11
%142 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.16, i64 0, i64 0), i32 %140, i32 %141)
%143 = load i32, i32* %10
%144 = add nsw i32 %143, 1
%145 = load i32, i32* %11
%146 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.16, i64 0, i64 0), i32 %144, i32 %145)
%147 = load i32, i32* %10
%148 = add nsw i32 %147, 2
%149 = load i32, i32* %11
%150 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%151 = load i32, i32* %3
%152 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 0
%153 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.18, i64 0, i64 0), i32 %148, i32 %149, i8* %150, i32 %151, i8* %152)
%154 = load i32, i32* %10
%155 = add nsw i32 %154, 3
%156 = load i32, i32* %11
%157 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.16, i64 0, i64 0), i32 %155, i32 %156)
%158 = load i32, i32* %10
%159 = add nsw i32 %158, 4
%160 = load i32, i32* %11
%161 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.16, i64 0, i64 0), i32 %159, i32 %160)
%162 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0))
br label %163
163: ; preds = %137, %115
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"\1B[48;2;134;222;132m\00"
@.str.1 = [5 x i8] c" \00"
@.str.2 = [6 x i8] c" \00"
@.str.3 = [20 x i8] c"\1B[48;2;103;204;252m\00"
@.str.4 = [19 x i8] c"\1B[48;2;153;51;255m\00"
@.str.5 = [20 x i8] c"\1B[48;2;255;154;154m\00"
@.str.6 = [20 x i8] c"\1B[48;2;255;227;153m\00"
@.str.7 = [19 x i8] c"\1B[48;2;163;205;73m\00"
@.str.8 = [19 x i8] c"\1B[48;2;13;169;175m\00"
@.str.10 = [19 x i8] c"\1B[48;2;108;56;153m\00"
@.str.11 = [20 x i8] c"\1B[48;2;238;197;221m\00"
@.str.12 = [18 x i8] c"\1B[48;2;148;24;24m\00"
@.str.13 = [14 x i8] c"\1B[48;2;0;0;0m\00"
@.str.14 = [20 x i8] c"\1B[48;2;200;200;200m\00"
@.str.15 = [5 x i8] c"\1B[0m\00"
@.str.16 = [19 x i8] c"\1B[%d;%dH \00"
@.str.17 = [3 x i8] c"%s\00"
@.str.18 = [15 x i8] c"\1B[%d;%dH%s%d%s\00"
define void @print_tile(i32 %0, i32 %1) {
%3 = alloca [20 x i8]
%4 = alloca [8 x i8]
%5 = alloca [8 x i8]
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [8 x i8], [8 x i8]* %4, i64 0, i64 0
%8 = getelementptr inbounds [8 x i8], [8 x i8]* %5, i64 0, i64 0
switch i32 %0, label %30 [
i32 2, label %9
i32 4, label %10
i32 8, label %11
i32 16, label %12
i32 32, label %13
i32 64, label %14
i32 128, label %15
i32 256, label %17
i32 512, label %19
i32 1024, label %21
i32 2048, label %24
i32 4096, label %27
]
9: ; preds = %2
br label %30
10: ; preds = %2
br label %30
11: ; preds = %2
br label %30
12: ; preds = %2
br label %30
13: ; preds = %2
br label %30
14: ; preds = %2
br label %30
15: ; preds = %2
%16 = bitcast [8 x i8]* %4 to i32*
store i32 2105376, i32* %16
br label %30
17: ; preds = %2
%18 = bitcast [8 x i8]* %4 to i32*
store i32 2105376, i32* %18
br label %30
19: ; preds = %2
%20 = bitcast [8 x i8]* %4 to i32*
store i32 2105376, i32* %20
br label %30
21: ; preds = %2
%22 = bitcast [8 x i8]* %4 to i32*
store i32 2105376, i32* %22
%23 = bitcast [8 x i8]* %5 to i32*
store i32 2105376, i32* %23
br label %30
24: ; preds = %2
%25 = bitcast [8 x i8]* %4 to i32*
store i32 2105376, i32* %25
%26 = bitcast [8 x i8]* %5 to i32*
store i32 2105376, i32* %26
br label %30
27: ; preds = %2
%28 = bitcast [8 x i8]* %4 to i32*
store i32 2105376, i32* %28
%29 = bitcast [8 x i8]* %5 to i32*
store i32 2105376, i32* %29
br label %30
30: ; preds = %2, %27, %24, %21, %19, %17, %15, %14, %13, %12, %11, %10, %9
%31 = sdiv i32 %1, 4
%32 = srem i32 %1, 4
%33 = mul nsw i32 %31, 6
%34 = or i32 %33, 1
%35 = mul nsw i32 %32, 11
%36 = add nsw i32 %35, 1
%37 = icmp eq i32 %0, 0
br i1 %37, label %38, label %50
38: ; preds = %30
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0))
%40 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.16, i64 0, i64 0), i32 %34, i32 %36)
%41 = add i32 %33, 2
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.16, i64 0, i64 0), i32 %41, i32 %36)
%43 = add i32 %33, 3
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.16, i64 0, i64 0), i32 %43, i32 %36)
%45 = add i32 %33, 4
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.16, i64 0, i64 0), i32 %45, i32 %36)
%47 = add i32 %33, 5
%48 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.16, i64 0, i64 0), i32 %47, i32 %36)
%49 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0))
br label %62
50: ; preds = %30
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i64 0, i64 0), i8* %6)
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.16, i64 0, i64 0), i32 %34, i32 %36)
%53 = add i32 %33, 2
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.16, i64 0, i64 0), i32 %53, i32 %36)
%55 = add i32 %33, 3
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.18, i64 0, i64 0), i32 %55, i32 %36, i8* %7, i32 %0, i8* %8)
%57 = add i32 %33, 4
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.16, i64 0, i64 0), i32 %57, i32 %36)
%59 = add i32 %33, 5
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.16, i64 0, i64 0), i32 %59, i32 %36)
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0))
br label %62
62: ; preds = %50, %38
ret void
}