#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*/ assert(int);
char character_representation(int c) {
  assert(c == 1 || c == 2 || c == 0);
  switch (c) {
  case 0:
    return ' ';
  case 1:
    return 'X';
  case 2:
    return 'O';
  }
  return ' ';
}


x86 assembly (clang, -O0):
<character_representation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x1,%al
cmpl   $0x1,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1143 <character_representation+0x33>
mov    $0x1,%al
cmpl   $0x2,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1143 <character_representation+0x33>
cmpl   $0x0,-0x8(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
movzbl %al,%edi
and    $0x1,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     1186 <character_representation+0x76>
jmp    1164 <character_representation+0x54>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     118f <character_representation+0x7f>
jmp    1175 <character_representation+0x65>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     1198 <character_representation+0x88>
jmp    11a1 <character_representation+0x91>
movb   $0x20,-0x1(%rbp)
jmp    11a5 <character_representation+0x95>
movb   $0x58,-0x1(%rbp)
jmp    11a5 <character_representation+0x95>
movb   $0x4f,-0x1(%rbp)
jmp    11a5 <character_representation+0x95>
movb   $0x20,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<character_representation>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x3,%ebx
setb   %dil
call   1030 <assert@plt>
cmp    $0x1,%ebx
mov    $0x58,%eax
mov    $0x20,%ecx
cmove  %eax,%ecx
cmp    $0x2,%ebx
mov    $0x4f,%eax
cmovne %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @character_representation(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 1
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 2
br i1 %8, label %12, label %9
9: ; preds = %6
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, 0
br label %12
12: ; preds = %9, %6, %1
%13 = phi i1 [ true, %6 ], [ true, %1 ], [ %11, %9 ]
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = load i32, i32* %3
switch i32 %16, label %20 [
i32 0, label %17
i32 1, label %18
i32 2, label %19
]
17: ; preds = %12
store i8 32, i8* %2
br label %21
18: ; preds = %12
store i8 88, i8* %2
br label %21
19: ; preds = %12
store i8 79, i8* %2
br label %21
20: ; preds = %12
store i8 32, i8* %2
br label %21
21: ; preds = %20, %19, %18, %17
%22 = load i8, i8* %2
ret i8 %22
}

LLVM IR (-O2):
define signext i8 @character_representation(i32 %0) {
%2 = icmp ult i32 %0, 3
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = icmp eq i32 %0, 1
%6 = select i1 %5, i8 88, i8 32
%7 = icmp eq i32 %0, 2
%8 = select i1 %7, i8 79, i8 %6
ret i8 %8
}