const char *log_type_to_string(int log_type) {
  switch (log_type) {
  case 100:
    return "[INFO] ";
  case 102:
    return "[WAIT] ";
  case 103:
    return "[WARNING] ";
  case 104:
    return "[ERROR] ";
  case 105:
    return "[ERROR_CRITICAL] ";
  case 106:
    return "[ERROR_FATAL] ";
  case 10:
    return "[COMMAND] ";
  case 11:
    return "[EXTRA] ";
  case 12:
    return "[DEBUG] ";
  case 13:
    return "[DATA] ";
  case 15:
  case 14:
  default:
    return "";
  }
  return "";
}


x86 assembly (clang, -O0):
<log_type_to_string>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xfffffff6,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x60,%eax
ja     11d5 <log_type_to_string+0xd5>
mov    -0x18(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0x104d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11e0 <log_type_to_string+0xe0>
lea    0x1045(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11e0 <log_type_to_string+0xe0>
lea    0x103d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11e0 <log_type_to_string+0xe0>
lea    0x1038(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11e0 <log_type_to_string+0xe0>
lea    0x1031(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11e0 <log_type_to_string+0xe0>
lea    0x1033(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11e0 <log_type_to_string+0xe0>
lea    0x1032(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11e0 <log_type_to_string+0xe0>
lea    0x102d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11e0 <log_type_to_string+0xe0>
lea    0x1026(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11e0 <log_type_to_string+0xe0>
lea    0x101f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11e0 <log_type_to_string+0xe0>
jmp    11d5 <log_type_to_string+0xd5>
lea    0x1000(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_type_to_string>:
add    $0xfffffff6,%edi
cmp    $0x60,%edi
ja     113f <log_type_to_string+0x3f>
lea    0x1075(%rip),%rax
lea    0xeea(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
lea    0x10a3(%rip),%rax
ret
lea    0x10a6(%rip),%rax
ret
lea    0x10a7(%rip),%rax
ret
lea    0x10a8(%rip),%rax
ret
lea    0x1096(%rip),%rax
ret
lea    0x103e(%rip),%rax
ret
lea    0x103e(%rip),%rax
ret
lea    0x1041(%rip),%rax
ret
lea    0x1042(%rip),%rax
ret
lea    0x104c(%rip),%rax
ret

LLVM IR (-O0):
@.str = [8 x i8] c"[INFO] \00"
@.str.1 = [8 x i8] c"[WAIT] \00"
@.str.2 = [11 x i8] c"[WARNING] \00"
@.str.3 = [9 x i8] c"[ERROR] \00"
@.str.4 = [18 x i8] c"[ERROR_CRITICAL] \00"
@.str.5 = [15 x i8] c"[ERROR_FATAL] \00"
@.str.6 = [11 x i8] c"[COMMAND] \00"
@.str.7 = [9 x i8] c"[EXTRA] \00"
@.str.8 = [9 x i8] c"[DEBUG] \00"
@.str.9 = [8 x i8] c"[DATA] \00"
@.str.10 = [1 x i8] zeroinitializer
define i8* @log_type_to_string(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %16 [
i32 100, label %5
i32 102, label %6
i32 103, label %7
i32 104, label %8
i32 105, label %9
i32 106, label %10
i32 10, label %11
i32 11, label %12
i32 12, label %13
i32 13, label %14
i32 15, label %15
i32 14, label %15
]
5: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %2
br label %17
6: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %17
7: ; preds = %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %17
8: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %17
9: ; preds = %1
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %17
10: ; preds = %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %17
11: ; preds = %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %17
12: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %17
13: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %17
14: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i8** %2
br label %17
15: ; preds = %1, %1
br label %16
16: ; preds = %1, %15
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.10, i64 0, i64 0), i8** %2
br label %17
17: ; preds = %16, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%18 = load i8*, i8** %2
ret i8* %18
}

LLVM IR (-O2):
@.str = [8 x i8] c"[INFO] \00"
@.str.1 = [8 x i8] c"[WAIT] \00"
@.str.2 = [11 x i8] c"[WARNING] \00"
@.str.3 = [9 x i8] c"[ERROR] \00"
@.str.4 = [18 x i8] c"[ERROR_CRITICAL] \00"
@.str.5 = [15 x i8] c"[ERROR_FATAL] \00"
@.str.6 = [11 x i8] c"[COMMAND] \00"
@.str.7 = [9 x i8] c"[EXTRA] \00"
@.str.8 = [9 x i8] c"[DEBUG] \00"
@.str.9 = [8 x i8] c"[DATA] \00"
@.str.10 = [1 x i8] zeroinitializer
define i8* @log_type_to_string(i32 %0) {
switch i32 %0, label %11 [
i32 100, label %12
i32 102, label %2
i32 103, label %3
i32 104, label %4
i32 105, label %5
i32 106, label %6
i32 10, label %7
i32 11, label %8
i32 12, label %9
i32 13, label %10
]
2: ; preds = %1
br label %12
3: ; preds = %1
br label %12
4: ; preds = %1
br label %12
5: ; preds = %1
br label %12
6: ; preds = %1
br label %12
7: ; preds = %1
br label %12
8: ; preds = %1
br label %12
9: ; preds = %1
br label %12
10: ; preds = %1
br label %12
11: ; preds = %1
br label %12
12: ; preds = %1, %11, %10, %9, %8, %7, %6, %5, %4, %3, %2
%13 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.10, i64 0, i64 0), %11 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), %10 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), %9 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), %8 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), %7 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %13
}