#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*/ printf(char *, ...);
void print_cell(int cell) {
  char c;
  if (cell == 2) {
    c = 'o';
    printf("\033[1m\033[%sm%c\033[0m", "31", c);
  } else if (cell == 1) {
    c = 'o';
    printf("\033[1m\033[%sm%c\033[0m", "33", c);
  } else {
    c = ' ';
    printf("%c", c);
  }
}


x86 assembly (clang, -O0):
<print_cell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jne    1147 <print_cell+0x37>
movb   $0x6f,-0x5(%rbp)
movsbl -0x5(%rbp),%edx
lea    0xecc(%rip),%rdi
lea    0xed5(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    118e <print_cell+0x7e>
cmpl   $0x1,-0x4(%rbp)
jne    1173 <print_cell+0x63>
movb   $0x6f,-0x5(%rbp)
movsbl -0x5(%rbp),%edx
lea    0xea0(%rip),%rdi
lea    0xeac(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1189 <print_cell+0x79>
movb   $0x20,-0x5(%rbp)
movsbl -0x5(%rbp),%esi
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    118e <print_cell+0x7e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_cell>:
cmp    $0x1,%edi
je     113a <print_cell+0x1a>
cmp    $0x2,%edi
jne    1154 <print_cell+0x34>
lea    0xecf(%rip),%rdi
lea    0xed8(%rip),%rsi
jmp    1148 <print_cell+0x28>
lea    0xebf(%rip),%rdi
lea    0xecb(%rip),%rsi
mov    $0x6f,%edx
xor    %eax,%eax
jmp    1040 <printf@plt>
mov    $0x20,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"\1B[1m\1B[%sm%c\1B[0m\00"
@.str.1 = [3 x i8] c"31\00"
@.str.2 = [3 x i8] c"33\00"
@.str.3 = [3 x i8] c"%c\00"
define void @print_cell(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 2
br i1 %5, label %6, label %10
6: ; preds = %1
store i8 111, i8* %3
%7 = load i8, i8* %3
%8 = sext i8 %7 to i32
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %8)
br label %22
10: ; preds = %1
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %17
13: ; preds = %10
store i8 111, i8* %3
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %15)
br label %21
17: ; preds = %10
store i8 32, i8* %3
%18 = load i8, i8* %3
%19 = sext i8 %18 to i32
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %19)
br label %21
21: ; preds = %17, %13
br label %22
22: ; preds = %21, %6
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"\1B[1m\1B[%sm%c\1B[0m\00"
@.str.1 = [3 x i8] c"31\00"
@.str.2 = [3 x i8] c"33\00"
define void @print_cell(i32 %0) {
switch i32 %0, label %6 [
i32 2, label %2
i32 1, label %4
]
2: ; preds = %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 111)
br label %8
4: ; preds = %1
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 111)
br label %8
6: ; preds = %1
%7 = tail call i32 @putchar(i32 32)
br label %8
8: ; preds = %4, %6, %2
ret void
}