char const *ioctl_cmd_to_ascii(int cmd) {
  {
    switch (cmd) {
    case (int)((unsigned int)(171 << 8)):
      return ("set-sock");
    case (int)((unsigned int)(171 << 8) | 1U):
      return ("set-blksize");
    case (int)((unsigned int)(171 << 8) | 2U):
      return ("set-size");
    case (int)((unsigned int)(171 << 8) | 3U):
      return ("do-it");
    case (int)((unsigned int)(171 << 8) | 4U):
      return ("clear-sock");
    case (int)((unsigned int)(171 << 8) | 5U):
      return ("clear-que");
    case (int)((unsigned int)(171 << 8) | 6U):
      return ("print-debug");
    case (int)((unsigned int)(171 << 8) | 7U):
      return ("set-size-blocks");
    case (int)((unsigned int)(171 << 8) | 8U):
      return ("disconnect");
    case (int)((unsigned int)(18 << 8) | 93U):
      return ("set-read-only");
    case (int)((unsigned int)(18 << 8) | 97U):
      return ("flush-buffer-cache");
    }
    return ("unknown");
  }
}


x86 assembly (clang, -O0):
<ioctl_cmd_to_ascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x125d,%eax
je     126b <ioctl_cmd_to_ascii+0x16b>
jmp    111d <ioctl_cmd_to_ascii+0x1d>
mov    -0x10(%rbp),%eax
sub    $0x1261,%eax
je     127b <ioctl_cmd_to_ascii+0x17b>
jmp    1130 <ioctl_cmd_to_ascii+0x30>
mov    -0x10(%rbp),%eax
sub    $0xab00,%eax
je     11db <ioctl_cmd_to_ascii+0xdb>
jmp    1143 <ioctl_cmd_to_ascii+0x43>
mov    -0x10(%rbp),%eax
sub    $0xab01,%eax
je     11eb <ioctl_cmd_to_ascii+0xeb>
jmp    1156 <ioctl_cmd_to_ascii+0x56>
mov    -0x10(%rbp),%eax
sub    $0xab02,%eax
je     11fb <ioctl_cmd_to_ascii+0xfb>
jmp    1169 <ioctl_cmd_to_ascii+0x69>
mov    -0x10(%rbp),%eax
sub    $0xab03,%eax
je     120b <ioctl_cmd_to_ascii+0x10b>
jmp    117c <ioctl_cmd_to_ascii+0x7c>
mov    -0x10(%rbp),%eax
sub    $0xab04,%eax
je     121b <ioctl_cmd_to_ascii+0x11b>
jmp    118f <ioctl_cmd_to_ascii+0x8f>
mov    -0x10(%rbp),%eax
sub    $0xab05,%eax
je     122b <ioctl_cmd_to_ascii+0x12b>
jmp    11a2 <ioctl_cmd_to_ascii+0xa2>
mov    -0x10(%rbp),%eax
sub    $0xab06,%eax
je     123b <ioctl_cmd_to_ascii+0x13b>
jmp    11b5 <ioctl_cmd_to_ascii+0xb5>
mov    -0x10(%rbp),%eax
sub    $0xab07,%eax
je     124b <ioctl_cmd_to_ascii+0x14b>
jmp    11c8 <ioctl_cmd_to_ascii+0xc8>
mov    -0x10(%rbp),%eax
sub    $0xab08,%eax
je     125b <ioctl_cmd_to_ascii+0x15b>
jmp    128b <ioctl_cmd_to_ascii+0x18b>
lea    0xe1e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1296 <ioctl_cmd_to_ascii+0x196>
lea    0xe17(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1296 <ioctl_cmd_to_ascii+0x196>
lea    0xe13(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1296 <ioctl_cmd_to_ascii+0x196>
lea    0xe0c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1296 <ioctl_cmd_to_ascii+0x196>
lea    0xe02(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1296 <ioctl_cmd_to_ascii+0x196>
lea    0xdfd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1296 <ioctl_cmd_to_ascii+0x196>
lea    0xdf7(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1296 <ioctl_cmd_to_ascii+0x196>
lea    0xdf3(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1296 <ioctl_cmd_to_ascii+0x196>
lea    0xdf3(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1296 <ioctl_cmd_to_ascii+0x196>
lea    0xdee(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1296 <ioctl_cmd_to_ascii+0x196>
lea    0xdec(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1296 <ioctl_cmd_to_ascii+0x196>
lea    0xdef(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ioctl_cmd_to_ascii>:
lea    -0xab00(%rdi),%ecx
cmp    $0x8,%ecx
ja     112a <ioctl_cmd_to_ascii+0x2a>
lea    0xf12(%rip),%rax
lea    0xee7(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
lea    0xf04(%rip),%rax
ret
cmp    $0x125d,%edi
je     117a <ioctl_cmd_to_ascii+0x7a>
cmp    $0x1261,%edi
jne    1182 <ioctl_cmd_to_ascii+0x82>
lea    0xf51(%rip),%rax
ret
lea    0xef0(%rip),%rax
ret
lea    0xef1(%rip),%rax
ret
lea    0xeef(%rip),%rax
ret
lea    0xef2(%rip),%rax
ret
lea    0xef4(%rip),%rax
ret
lea    0xef8(%rip),%rax
ret
lea    0xf00(%rip),%rax
ret
lea    0xf03(%rip),%rax
ret
lea    0xf1c(%rip),%rax
ret

LLVM IR (-O0):
@.str = [9 x i8] c"set-sock\00"
@.str.1 = [12 x i8] c"set-blksize\00"
@.str.2 = [9 x i8] c"set-size\00"
@.str.3 = [6 x i8] c"do-it\00"
@.str.4 = [11 x i8] c"clear-sock\00"
@.str.5 = [10 x i8] c"clear-que\00"
@.str.6 = [12 x i8] c"print-debug\00"
@.str.7 = [16 x i8] c"set-size-blocks\00"
@.str.8 = [11 x i8] c"disconnect\00"
@.str.9 = [14 x i8] c"set-read-only\00"
@.str.10 = [19 x i8] c"flush-buffer-cache\00"
@.str.11 = [8 x i8] c"unknown\00"
define i8* @ioctl_cmd_to_ascii(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %16 [
i32 43776, label %5
i32 43777, label %6
i32 43778, label %7
i32 43779, label %8
i32 43780, label %9
i32 43781, label %10
i32 43782, label %11
i32 43783, label %12
i32 43784, label %13
i32 4701, label %14
i32 4705, label %15
]
5: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %2
br label %17
6: ; preds = %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %17
7: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %17
8: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %17
9: ; preds = %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %17
10: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %17
11: ; preds = %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %17
12: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %17
13: ; preds = %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %17
14: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0), i8** %2
br label %17
15: ; preds = %1
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0), i8** %2
br label %17
16: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0), i8** %2
br label %17
17: ; preds = %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%18 = load i8*, i8** %2
ret i8* %18
}

LLVM IR (-O2):
@.str = [9 x i8] c"set-sock\00"
@.str.1 = [12 x i8] c"set-blksize\00"
@.str.2 = [9 x i8] c"set-size\00"
@.str.3 = [6 x i8] c"do-it\00"
@.str.4 = [11 x i8] c"clear-sock\00"
@.str.5 = [10 x i8] c"clear-que\00"
@.str.6 = [12 x i8] c"print-debug\00"
@.str.7 = [16 x i8] c"set-size-blocks\00"
@.str.8 = [11 x i8] c"disconnect\00"
@.str.9 = [14 x i8] c"set-read-only\00"
@.str.10 = [19 x i8] c"flush-buffer-cache\00"
@.str.11 = [8 x i8] c"unknown\00"
define i8* @ioctl_cmd_to_ascii(i32 %0) {
switch i32 %0, label %12 [
i32 43776, label %13
i32 43777, label %2
i32 43778, label %3
i32 43779, label %4
i32 43780, label %5
i32 43781, label %6
i32 43782, label %7
i32 43783, label %8
i32 43784, label %9
i32 4701, label %10
i32 4705, label %11
]
2: ; preds = %1
br label %13
3: ; preds = %1
br label %13
4: ; preds = %1
br label %13
5: ; preds = %1
br label %13
6: ; preds = %1
br label %13
7: ; preds = %1
br label %13
8: ; preds = %1
br label %13
9: ; preds = %1
br label %13
10: ; preds = %1
br label %13
11: ; preds = %1
br label %13
12: ; preds = %1
br label %13
13: ; preds = %1, %12, %11, %10, %9, %8, %7, %6, %5, %4, %3, %2
%14 = phi i8* [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0), %12 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0), %11 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0), %10 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), %9 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0), %8 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), %7 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %14
}