void set_command_color(int c) {
  switch (c) {
  case 192:
    printf("\033[35m");
    break;
  case 194:
    printf("\033[35m");
    break;
  case 196:
    printf("\033[36m");
    break;
  case 208 ... 215:
    printf("\033[32m");
  case 216:
    printf("\033[33m");
    break;
  case 217:
    printf("\033[35m");
  case 218:
    printf("\033[37m");
    break;
  case 219:
    printf("\033[33m");
    break;
  case 221:
    printf("\033[36m");
    break;
  case 224 ... 239:
    printf("\033[31m");
    break;
  case 254:
    printf("\033[34m");
    break;
  }
}


x86 assembly (clang, -O0):
<set_command_color>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffff40,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x3e,%eax
ja     1208 <set_command_color+0xf8>
mov    -0x10(%rbp),%rax
lea    0xec3(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xfaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1208 <set_command_color+0xf8>
lea    0xf9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1208 <set_command_color+0xf8>
lea    0xf8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1208 <set_command_color+0xf8>
lea    0xf82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf7a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1208 <set_command_color+0xf8>
lea    0xf55(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf5f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1208 <set_command_color+0xf8>
lea    0xf46(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1208 <set_command_color+0xf8>
lea    0xf27(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1208 <set_command_color+0xf8>
lea    0xf2c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1208 <set_command_color+0xf8>
lea    0xf1f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_command_color>:
push   %rax
mov    %edi,%eax
add    $0xffffff40,%eax
cmp    $0x3e,%eax
ja     1163 <set_command_color+0x53>
lea    0xfd8(%rip),%rdi
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xfdf(%rip),%rdi
jmp    1152 <set_command_color+0x42>
lea    0xfc4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xfbc(%rip),%rdi
xor    %eax,%eax
pop    %rcx
jmp    1030 <printf@plt>
lea    0xfa1(%rip),%rdi
jmp    1152 <set_command_color+0x42>
pop    %rax
ret
lea    0xf90(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf9a(%rip),%rdi
jmp    1152 <set_command_color+0x42>
lea    0xf9d(%rip),%rdi
jmp    1152 <set_command_color+0x42>

LLVM IR (-O0):
@.str = [6 x i8] c"\1B[35m\00"
@.str.1 = [6 x i8] c"\1B[36m\00"
@.str.2 = [6 x i8] c"\1B[32m\00"
@.str.3 = [6 x i8] c"\1B[33m\00"
@.str.4 = [6 x i8] c"\1B[37m\00"
@.str.5 = [6 x i8] c"\1B[31m\00"
@.str.6 = [6 x i8] c"\1B[34m\00"
define void @set_command_color(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %26 [
i32 192, label %4
i32 194, label %6
i32 196, label %8
i32 208, label %10
i32 209, label %10
i32 210, label %10
i32 211, label %10
i32 212, label %10
i32 213, label %10
i32 214, label %10
i32 215, label %10
i32 216, label %12
i32 217, label %14
i32 218, label %16
i32 219, label %18
i32 221, label %20
i32 224, label %22
i32 225, label %22
i32 226, label %22
i32 227, label %22
i32 228, label %22
i32 229, label %22
i32 230, label %22
i32 231, label %22
i32 232, label %22
i32 233, label %22
i32 234, label %22
i32 235, label %22
i32 236, label %22
i32 237, label %22
i32 238, label %22
i32 239, label %22
i32 254, label %24
]
4: ; preds = %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %26
6: ; preds = %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %26
8: ; preds = %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %26
10: ; preds = %1, %1, %1, %1, %1, %1, %1, %1
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %12
12: ; preds = %1, %10
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %26
14: ; preds = %1
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %1, %14
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %26
18: ; preds = %1
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %26
20: ; preds = %1
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %26
22: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
br label %26
24: ; preds = %1
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
br label %26
26: ; preds = %1, %24, %22, %20, %18, %16, %12, %8, %6, %4
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[35m\00"
@.str.1 = [6 x i8] c"\1B[36m\00"
@.str.2 = [6 x i8] c"\1B[32m\00"
@.str.3 = [6 x i8] c"\1B[33m\00"
@.str.4 = [6 x i8] c"\1B[37m\00"
@.str.5 = [6 x i8] c"\1B[31m\00"
@.str.6 = [6 x i8] c"\1B[34m\00"
define void @set_command_color(i32 %0) {
switch i32 %0, label %16 [
i32 192, label %13
i32 194, label %13
i32 196, label %2
i32 208, label %3
i32 209, label %3
i32 210, label %3
i32 211, label %3
i32 212, label %3
i32 213, label %3
i32 214, label %3
i32 215, label %3
i32 216, label %5
i32 217, label %6
i32 218, label %8
i32 219, label %9
i32 221, label %10
i32 224, label %11
i32 225, label %11
i32 226, label %11
i32 227, label %11
i32 228, label %11
i32 229, label %11
i32 230, label %11
i32 231, label %11
i32 232, label %11
i32 233, label %11
i32 234, label %11
i32 235, label %11
i32 236, label %11
i32 237, label %11
i32 238, label %11
i32 239, label %11
i32 254, label %12
]
2: ; preds = %1
br label %13
3: ; preds = %1, %1, %1, %1, %1, %1, %1, %1
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %5
5: ; preds = %1, %3
br label %13
6: ; preds = %1
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %1, %6
br label %13
9: ; preds = %1
br label %13
10: ; preds = %1
br label %13
11: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
br label %13
12: ; preds = %1
br label %13
13: ; preds = %1, %1, %2, %5, %8, %9, %10, %11, %12
%14 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), %12 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), %11 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), %10 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), %9 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), %8 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), %5 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), %1 ]
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %14)
br label %16
16: ; preds = %13, %1
ret void
}