#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 *, int, int);
void uxmi_color_fg(int uxmi_color) {
  int sel_opt = 1;
  int sel_color = 37;
  switch (uxmi_color) {
  case 0:
    sel_opt = 0;
    sel_color = 30;
    break;
  case 1:
    sel_opt = 0;
    sel_color = 34;
    break;
  case 2:
    sel_opt = 0;
    sel_color = 32;
    break;
  case 3:
    sel_opt = 0;
    sel_color = 36;
    break;
  case 4:
    sel_opt = 0;
    sel_color = 31;
    break;
  case 5:
    sel_opt = 0;
    sel_color = 35;
    break;
  case 6:
    sel_opt = 0;
    sel_color = 33;
    break;
  case 7:
    sel_opt = 0;
    sel_color = 37;
    break;
  case 8:
    sel_opt = 1;
    sel_color = 30;
    break;
  case 9:
    sel_opt = 1;
    sel_color = 34;
    break;
  case 10:
    sel_opt = 1;
    sel_color = 32;
    break;
  case 11:
    sel_opt = 1;
    sel_color = 36;
    break;
  case 12:
    sel_opt = 1;
    sel_color = 31;
    break;
  case 13:
    sel_opt = 1;
    sel_color = 35;
    break;
  case 14:
    sel_opt = 1;
    sel_color = 33;
    break;
  default:
    sel_opt = 1;
    sel_color = 37;
    break;
  }
  printf("\033[%d;%dm", sel_opt, sel_color);
  return;
}


x86 assembly (clang, -O0):
<uxmi_color_fg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x25,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0xe,%rax
ja     126b <uxmi_color_fg+0x15b>
mov    -0x18(%rbp),%rax
lea    0xebb(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x8(%rbp)
movl   $0x1e,-0xc(%rbp)
jmp    1279 <uxmi_color_fg+0x169>
movl   $0x0,-0x8(%rbp)
movl   $0x22,-0xc(%rbp)
jmp    1279 <uxmi_color_fg+0x169>
movl   $0x0,-0x8(%rbp)
movl   $0x20,-0xc(%rbp)
jmp    1279 <uxmi_color_fg+0x169>
movl   $0x0,-0x8(%rbp)
movl   $0x24,-0xc(%rbp)
jmp    1279 <uxmi_color_fg+0x169>
movl   $0x0,-0x8(%rbp)
movl   $0x1f,-0xc(%rbp)
jmp    1279 <uxmi_color_fg+0x169>
movl   $0x0,-0x8(%rbp)
movl   $0x23,-0xc(%rbp)
jmp    1279 <uxmi_color_fg+0x169>
movl   $0x0,-0x8(%rbp)
movl   $0x21,-0xc(%rbp)
jmp    1279 <uxmi_color_fg+0x169>
movl   $0x0,-0x8(%rbp)
movl   $0x25,-0xc(%rbp)
jmp    1279 <uxmi_color_fg+0x169>
movl   $0x1,-0x8(%rbp)
movl   $0x1e,-0xc(%rbp)
jmp    1279 <uxmi_color_fg+0x169>
movl   $0x1,-0x8(%rbp)
movl   $0x22,-0xc(%rbp)
jmp    1279 <uxmi_color_fg+0x169>
movl   $0x1,-0x8(%rbp)
movl   $0x20,-0xc(%rbp)
jmp    1279 <uxmi_color_fg+0x169>
movl   $0x1,-0x8(%rbp)
movl   $0x24,-0xc(%rbp)
jmp    1279 <uxmi_color_fg+0x169>
movl   $0x1,-0x8(%rbp)
movl   $0x1f,-0xc(%rbp)
jmp    1279 <uxmi_color_fg+0x169>
movl   $0x1,-0x8(%rbp)
movl   $0x23,-0xc(%rbp)
jmp    1279 <uxmi_color_fg+0x169>
movl   $0x1,-0x8(%rbp)
movl   $0x21,-0xc(%rbp)
jmp    1279 <uxmi_color_fg+0x169>
movl   $0x1,-0x8(%rbp)
movl   $0x25,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xdb6(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uxmi_color_fg>:
cmp    $0xe,%edi
ja     1138 <uxmi_color_fg+0x28>
movslq %edi,%rax
lea    0xeed(%rip),%rcx
mov    (%rcx,%rax,4),%esi
lea    0xf1f(%rip),%rcx
mov    (%rcx,%rax,4),%edx
lea    0xecd(%rip),%rdi
jmp    1030 <printf@plt>
mov    $0x25,%edx
mov    $0x1,%esi
lea    0xeb7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"\1B[%d;%dm\00"
define void @uxmi_color_fg(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
store i32 37, i32* %4
%5 = load i32, i32* %2
switch i32 %5, label %21 [
i32 0, label %6
i32 1, label %7
i32 2, label %8
i32 3, label %9
i32 4, label %10
i32 5, label %11
i32 6, label %12
i32 7, label %13
i32 8, label %14
i32 9, label %15
i32 10, label %16
i32 11, label %17
i32 12, label %18
i32 13, label %19
i32 14, label %20
]
6: ; preds = %1
store i32 0, i32* %3
store i32 30, i32* %4
br label %22
7: ; preds = %1
store i32 0, i32* %3
store i32 34, i32* %4
br label %22
8: ; preds = %1
store i32 0, i32* %3
store i32 32, i32* %4
br label %22
9: ; preds = %1
store i32 0, i32* %3
store i32 36, i32* %4
br label %22
10: ; preds = %1
store i32 0, i32* %3
store i32 31, i32* %4
br label %22
11: ; preds = %1
store i32 0, i32* %3
store i32 35, i32* %4
br label %22
12: ; preds = %1
store i32 0, i32* %3
store i32 33, i32* %4
br label %22
13: ; preds = %1
store i32 0, i32* %3
store i32 37, i32* %4
br label %22
14: ; preds = %1
store i32 1, i32* %3
store i32 30, i32* %4
br label %22
15: ; preds = %1
store i32 1, i32* %3
store i32 34, i32* %4
br label %22
16: ; preds = %1
store i32 1, i32* %3
store i32 32, i32* %4
br label %22
17: ; preds = %1
store i32 1, i32* %3
store i32 36, i32* %4
br label %22
18: ; preds = %1
store i32 1, i32* %3
store i32 31, i32* %4
br label %22
19: ; preds = %1
store i32 1, i32* %3
store i32 35, i32* %4
br label %22
20: ; preds = %1
store i32 1, i32* %3
store i32 33, i32* %4
br label %22
21: ; preds = %1
store i32 1, i32* %3
store i32 37, i32* %4
br label %22
22: ; preds = %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6
%23 = load i32, i32* %3
%24 = load i32, i32* %4
%25 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %23, i32 %24)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"\1B[%d;%dm\00"
@switch.table.uxmi_color_fg = [15 x i32] [i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1]
@switch.table.uxmi_color_fg.1 = [15 x i32] [i32 30, i32 34, i32 32, i32 36, i32 31, i32 35, i32 33, i32 37, i32 30, i32 34, i32 32, i32 36, i32 31, i32 35, i32 33]
define void @uxmi_color_fg(i32 %0) {
%2 = icmp ult i32 %0, 15
br i1 %2, label %3, label %10
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [15 x i32], [15 x i32]* @switch.table.uxmi_color_fg, i64 0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %0 to i64
%8 = getelementptr inbounds [15 x i32], [15 x i32]* @switch.table.uxmi_color_fg.1, i64 0, i64 %7
%9 = load i32, i32* %8
br label %10
10: ; preds = %1, %3
%11 = phi i32 [ %6, %3 ], [ 1, %1 ]
%12 = phi i32 [ %9, %3 ], [ 37, %1 ]
%13 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12)
ret void
}