const char *_qtype2str(int qtype) {
  const char *str;
  switch (qtype) {
  case 1:
    str = "A";
    break;
  case 28:
    str = "AAAA";
    break;
  case 15:
    str = "MX";
    break;
  case 33:
    str = "SRV";
    break;
  case 5:
    str = "CNAME";
    break;
  case 12:
    str = "PTR";
    break;
  case 16:
    str = "TXT";
    break;
  case 13:
    str = "HINFO";
    break;
  case 2:
    str = "NS";
    break;
  case 255:
    str = "ANY";
    break;
  default:
    str = "";
    break;
  }
  return str;
}


x86 assembly (clang, -O0):
<_qtype2str>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
sub    $0x1,%eax
je     11b6 <_qtype2str+0xb6>
jmp    111b <_qtype2str+0x1b>
mov    -0x14(%rbp),%eax
sub    $0x2,%eax
je     1236 <_qtype2str+0x136>
jmp    112c <_qtype2str+0x2c>
mov    -0x14(%rbp),%eax
sub    $0x5,%eax
je     11f6 <_qtype2str+0xf6>
jmp    113d <_qtype2str+0x3d>
mov    -0x14(%rbp),%eax
sub    $0xc,%eax
je     1206 <_qtype2str+0x106>
jmp    114e <_qtype2str+0x4e>
mov    -0x14(%rbp),%eax
sub    $0xd,%eax
je     1226 <_qtype2str+0x126>
jmp    115f <_qtype2str+0x5f>
mov    -0x14(%rbp),%eax
sub    $0xf,%eax
je     11d6 <_qtype2str+0xd6>
jmp    1170 <_qtype2str+0x70>
mov    -0x14(%rbp),%eax
sub    $0x10,%eax
je     1216 <_qtype2str+0x116>
jmp    1181 <_qtype2str+0x81>
mov    -0x14(%rbp),%eax
sub    $0x1c,%eax
je     11c6 <_qtype2str+0xc6>
jmp    1192 <_qtype2str+0x92>
mov    -0x14(%rbp),%eax
sub    $0x21,%eax
je     11e6 <_qtype2str+0xe6>
jmp    11a3 <_qtype2str+0xa3>
mov    -0x14(%rbp),%eax
sub    $0xff,%eax
je     1246 <_qtype2str+0x146>
jmp    1256 <_qtype2str+0x156>
lea    0xe46(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1261 <_qtype2str+0x161>
lea    0xe33(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1261 <_qtype2str+0x161>
lea    0xe28(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1261 <_qtype2str+0x161>
lea    0xe1b(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1261 <_qtype2str+0x161>
lea    0xe0f(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1261 <_qtype2str+0x161>
lea    0xe05(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1261 <_qtype2str+0x161>
lea    0xdf9(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1261 <_qtype2str+0x161>
lea    0xded(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1261 <_qtype2str+0x161>
lea    0xde3(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1261 <_qtype2str+0x161>
lea    0xdd6(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1261 <_qtype2str+0x161>
lea    0xda7(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_qtype2str>:
lea    -0x1(%rdi),%ecx
cmp    $0x20,%ecx
ja     1127 <_qtype2str+0x27>
lea    0xf78(%rip),%rax
lea    0xeea(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
lea    0xf7e(%rip),%rax
ret
cmp    $0xff,%edi
jne    1137 <_qtype2str+0x37>
lea    0xf71(%rip),%rax
ret
lea    0xf4a(%rip),%rax
ret
lea    0xf4a(%rip),%rax
ret
lea    0xf48(%rip),%rax
ret
lea    0xf48(%rip),%rax
ret
lea    0xf2b(%rip),%rax
ret
lea    0xf34(%rip),%rax
ret
lea    0xf16(%rip),%rax
ret
lea    0xf16(%rip),%rax
ret

LLVM IR (-O0):
@.str = [2 x i8] c"A\00"
@.str.1 = [5 x i8] c"AAAA\00"
@.str.2 = [3 x i8] c"MX\00"
@.str.3 = [4 x i8] c"SRV\00"
@.str.4 = [6 x i8] c"CNAME\00"
@.str.5 = [4 x i8] c"PTR\00"
@.str.6 = [4 x i8] c"TXT\00"
@.str.7 = [6 x i8] c"HINFO\00"
@.str.8 = [3 x i8] c"NS\00"
@.str.9 = [4 x i8] c"ANY\00"
@.str.10 = [1 x i8] zeroinitializer
define i8* @_qtype2str(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
switch i32 %4, label %15 [
i32 1, label %5
i32 28, label %6
i32 15, label %7
i32 33, label %8
i32 5, label %9
i32 12, label %10
i32 16, label %11
i32 13, label %12
i32 2, label %13
i32 255, label %14
]
5: ; preds = %1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %3
br label %16
6: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %16
7: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8** %3
br label %16
8: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8** %3
br label %16
9: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8** %3
br label %16
10: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8** %3
br label %16
11: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8** %3
br label %16
12: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8** %3
br label %16
13: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8** %3
br label %16
14: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8** %3
br label %16
15: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.10, i64 0, i64 0), i8** %3
br label %16
16: ; preds = %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
@.str = [2 x i8] c"A\00"
@.str.1 = [5 x i8] c"AAAA\00"
@.str.2 = [3 x i8] c"MX\00"
@.str.3 = [4 x i8] c"SRV\00"
@.str.4 = [6 x i8] c"CNAME\00"
@.str.5 = [4 x i8] c"PTR\00"
@.str.6 = [4 x i8] c"TXT\00"
@.str.7 = [6 x i8] c"HINFO\00"
@.str.8 = [3 x i8] c"NS\00"
@.str.9 = [4 x i8] c"ANY\00"
@.str.10 = [1 x i8] zeroinitializer
define i8* @_qtype2str(i32 %0) {
switch i32 %0, label %11 [
i32 1, label %12
i32 28, label %2
i32 15, label %3
i32 33, label %4
i32 5, label %5
i32 12, label %6
i32 16, label %7
i32 13, label %8
i32 2, label %9
i32 255, 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 ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), %10 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), %9 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), %8 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), %7 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %13
}