#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 A_BOLD;
int COLOR_PAIR(int);
int /*<<< orphan*/ attroff(int);
int /*<<< orphan*/ attron(int);
int /*<<< orphan*/ printw(char *, ...);
void print_tile(int tile) {
  if (tile) {
    if (tile < 6)
      attron(A_BOLD);
    int pair = COLOR_PAIR(1 + (tile % 6));
    attron(pair);
    printw("%4d", 1 << tile);
    attroff(pair);
    attroff(A_BOLD);
  } else {
    printw("   .");
  }
}


x86 assembly (clang, -O0):
<print_tile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     11c0 <print_tile+0x80>
cmpl   $0x6,-0x4(%rbp)
jge    116d <print_tile+0x2d>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
call   1040 <attron@plt>
mov    -0x4(%rbp),%eax
mov    $0x6,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x1,%edi
call   1060 <COLOR_PAIR@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <attron@plt>
mov    -0x4(%rbp),%ecx
mov    $0x1,%esi
shl    %cl,%esi
lea    0xe62(%rip),%rdi
mov    $0x0,%al
call   1050 <printw@plt>
mov    -0x8(%rbp),%edi
call   1030 <attroff@plt>
mov    0x2e2c(%rip),%rax
mov    (%rax),%edi
call   1030 <attroff@plt>
jmp    11ce <print_tile+0x8e>
lea    0xe3d(%rip),%rdi
mov    $0x0,%al
call   1050 <printw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_tile>:
test   %edi,%edi
je     11c0 <print_tile+0x80>
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
cmp    $0x5,%edi
jg     115c <print_tile+0x1c>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1040 <attron@plt>
movslq %ebx,%rax
imul   $0x2aaaaaab,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,2),%eax
neg    %eax
lea    (%rbx,%rax,1),%edi
add    $0x1,%edi
call   1060 <COLOR_PAIR@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1040 <attron@plt>
mov    $0x1,%esi
mov    %ebx,%ecx
shl    %cl,%esi
lea    0xe62(%rip),%rdi
xor    %eax,%eax
call   1050 <printw@plt>
mov    %ebp,%edi
call   1030 <attroff@plt>
mov    0x2e2d(%rip),%rax
mov    (%rax),%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <attroff@plt>
lea    0xe3d(%rip),%rdi
xor    %eax,%eax
jmp    1050 <printw@plt>

LLVM IR (-O0):
@A_BOLD = global i32 0
@.str = [4 x i8] c"%4d\00"
@.str.1 = [5 x i8] c" .\00"
define void @print_tile(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %26
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 6
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* @A_BOLD
%11 = call i32 @attron(i32 %10)
br label %12
12: ; preds = %9, %6
%13 = load i32, i32* %2
%14 = srem i32 %13, 6
%15 = add nsw i32 1, %14
%16 = call i32 @COLOR_PAIR(i32 %15)
store i32 %16, i32* %3
%17 = load i32, i32* %3
%18 = call i32 @attron(i32 %17)
%19 = load i32, i32* %2
%20 = shl i32 1, %19
%21 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %3
%23 = call i32 @attroff(i32 %22)
%24 = load i32, i32* @A_BOLD
%25 = call i32 @attroff(i32 %24)
br label %28
26: ; preds = %1
%27 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %28
28: ; preds = %26, %12
ret void
}

LLVM IR (-O2):
@A_BOLD = global i32 0
@.str = [4 x i8] c"%4d\00"
@.str.1 = [5 x i8] c" .\00"
define void @print_tile(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %18, label %3
3: ; preds = %1
%4 = icmp slt i32 %0, 6
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = load i32, i32* @A_BOLD
%7 = tail call i32 @attron(i32 %6)
br label %8
8: ; preds = %5, %3
%9 = srem i32 %0, 6
%10 = add nsw i32 %9, 1
%11 = tail call i32 @COLOR_PAIR(i32 %10)
%12 = tail call i32 @attron(i32 %11)
%13 = shl nuw i32 1, %0
%14 = tail call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = tail call i32 @attroff(i32 %11)
%16 = load i32, i32* @A_BOLD
%17 = tail call i32 @attroff(i32 %16)
br label %20
18: ; preds = %1
%19 = tail call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %20
20: ; preds = %18, %8
ret void
}