#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 imprimirSprite(int valor) {
  char sprites[10] = {'@', '#', '?', '0', '&', '*', '$', '|', 'o', '/'};
  switch (valor) {
  case 0:
    printf("\x1b[34m"
           "%c"
           "\x1b[0m",
           sprites[0]);
    break;
  case 1:
  case 6:
    printf("\x1b[32m"
           "%c"
           "\x1b[0m",
           sprites[0]);
    break;
  case 4:
    printf("\x1b[33m"
           "%c"
           "\x1b[0m",
           sprites[1]);
    break;
  case 5:
  case 7:
    printf("\x1b[32m"
           "%c"
           "\x1b[0m",
           sprites[1]);
    break;
  case 8:
    printf("\x1b[33m"
           "%c"
           "\x1b[0m",
           sprites[1]);
    break;
  case 9:
    printf("%c", sprites[7]);
    break;
  case 10:
    printf("%c", sprites[9]);
    break;
  case 11:
    printf("\x1b[33m"
           "%c"
           "\x1b[0m",
           sprites[1]);
    break;
  case 12:
    printf(" ");
    break;
  case 13:
    printf("\x1b[33m"
           "%c"
           "\x1b[0m",
           sprites[2]);
    break;
  case 15:
    printf("%c", sprites[0]);
    break;
  case 16:
    printf("\x1b[32m"
           "%c"
           "\x1b[0m",
           sprites[8]);
    break;
  }
}


x86 assembly (clang, -O0):
<imprimirSprite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movabs $0x7c242a26303f2340,%rax
2a 24 7c
mov    %rax,-0x10(%rbp)
movw   $0x2f6f,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0x10,%rax
ja     125f <imprimirSprite+0x14f>
mov    -0x18(%rbp),%rax
lea    0xeb5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movsbl -0x10(%rbp),%esi
lea    0xeef(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    125f <imprimirSprite+0x14f>
movsbl -0x10(%rbp),%esi
lea    0xee4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    125f <imprimirSprite+0x14f>
movsbl -0xf(%rbp),%esi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    125f <imprimirSprite+0x14f>
movsbl -0xf(%rbp),%esi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    125f <imprimirSprite+0x14f>
movsbl -0xf(%rbp),%esi
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    125f <imprimirSprite+0x14f>
movsbl -0x9(%rbp),%esi
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    125f <imprimirSprite+0x14f>
movsbl -0x7(%rbp),%esi
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    125f <imprimirSprite+0x14f>
movsbl -0xf(%rbp),%esi
lea    0xe66(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    125f <imprimirSprite+0x14f>
lea    0xe62(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    125f <imprimirSprite+0x14f>
movsbl -0xe(%rbp),%esi
lea    0xe3c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    125f <imprimirSprite+0x14f>
movsbl -0x10(%rbp),%esi
lea    0xe31(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    125f <imprimirSprite+0x14f>
movsbl -0x8(%rbp),%esi
lea    0xe02(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprimirSprite>:
cmp    $0x10,%edi
ja     116f <imprimirSprite+0x4f>
mov    %edi,%eax
lea    0xed2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf1e(%rip),%rdi
jmp    1150 <imprimirSprite+0x30>
lea    0xf09(%rip),%rdi
jmp    1163 <imprimirSprite+0x43>
lea    0xf00(%rip),%rdi
mov    $0x23,%esi
xor    %eax,%eax
jmp    1040 <printf@plt>
lea    0xee1(%rip),%rdi
mov    $0x40,%esi
xor    %eax,%eax
jmp    1040 <printf@plt>
ret
mov    $0x7c,%edi
jmp    1030 <putchar@plt>
mov    $0x2f,%edi
jmp    1030 <putchar@plt>
mov    $0x20,%edi
jmp    1030 <putchar@plt>
lea    0xec7(%rip),%rdi
mov    $0x3f,%esi
xor    %eax,%eax
jmp    1040 <printf@plt>
mov    $0x40,%edi
jmp    1030 <putchar@plt>
lea    0xe9e(%rip),%rdi
mov    $0x6f,%esi
xor    %eax,%eax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@__const.imprimirSprite.sprites = [10 x i8] c"@#?0&*$|o/"
@.str = [12 x i8] c"\1B[34m%c\1B[0m\00"
@.str.1 = [12 x i8] c"\1B[32m%c\1B[0m\00"
@.str.2 = [12 x i8] c"\1B[33m%c\1B[0m\00"
@.str.3 = [3 x i8] c"%c\00"
@.str.4 = [2 x i8] c" \00"
define void @imprimirSprite(i32 %0) {
%2 = alloca i32
%3 = alloca [10 x i8]
store i32 %0, i32* %2
%4 = bitcast [10 x i8]* %3 to i8*
%5 = load i32, i32* %2
switch i32 %5, label %63 [
i32 0, label %6
i32 1, label %11
i32 6, label %11
i32 4, label %16
i32 5, label %21
i32 7, label %21
i32 8, label %26
i32 9, label %31
i32 10, label %36
i32 11, label %41
i32 12, label %46
i32 13, label %48
i32 15, label %53
i32 16, label %58
]
6: ; preds = %1
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %63
11: ; preds = %1, %1
%12 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %14)
br label %63
16: ; preds = %1
%17 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 1
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %19)
br label %63
21: ; preds = %1, %1
%22 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 1
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %24)
br label %63
26: ; preds = %1
%27 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 1
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %29)
br label %63
31: ; preds = %1
%32 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 7
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %34)
br label %63
36: ; preds = %1
%37 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 9
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %39)
br label %63
41: ; preds = %1
%42 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 1
%43 = load i8, i8* %42
%44 = sext i8 %43 to i32
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %44)
br label %63
46: ; preds = %1
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %63
48: ; preds = %1
%49 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 2
%50 = load i8, i8* %49
%51 = sext i8 %50 to i32
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %51)
br label %63
53: ; preds = %1
%54 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%55 = load i8, i8* %54
%56 = sext i8 %55 to i32
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %56)
br label %63
58: ; preds = %1
%59 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 8
%60 = load i8, i8* %59
%61 = sext i8 %60 to i32
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %61)
br label %63
63: ; preds = %1, %58, %53, %48, %46, %41, %36, %31, %26, %21, %16, %11, %6
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"\1B[34m%c\1B[0m\00"
@.str.1 = [12 x i8] c"\1B[32m%c\1B[0m\00"
@.str.2 = [12 x i8] c"\1B[33m%c\1B[0m\00"
define void @imprimirSprite(i32 %0) {
switch i32 %0, label %26 [
i32 0, label %2
i32 1, label %4
i32 6, label %4
i32 4, label %6
i32 5, label %8
i32 7, label %8
i32 8, label %10
i32 9, label %12
i32 10, label %14
i32 11, label %16
i32 12, label %18
i32 13, label %20
i32 15, label %22
i32 16, label %24
]
2: ; preds = %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 64)
br label %26
4: ; preds = %1, %1
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 64)
br label %26
6: ; preds = %1
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 35)
br label %26
8: ; preds = %1, %1
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 35)
br label %26
10: ; preds = %1
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 35)
br label %26
12: ; preds = %1
%13 = tail call i32 @putchar(i32 124)
br label %26
14: ; preds = %1
%15 = tail call i32 @putchar(i32 47)
br label %26
16: ; preds = %1
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 35)
br label %26
18: ; preds = %1
%19 = tail call i32 @putchar(i32 32)
br label %26
20: ; preds = %1
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 63)
br label %26
22: ; preds = %1
%23 = tail call i32 @putchar(i32 64)
br label %26
24: ; preds = %1
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 111)
br label %26
26: ; preds = %1, %24, %22, %20, %18, %16, %14, %12, %10, %8, %6, %4, %2
ret void
}