char *str_TVStandard(unsigned long dwTVStandard) {
  switch (dwTVStandard) {
  case 0x0001:
    return "NTSC";
  case 0x0002:
    return "NTSC_EIAJ";
  case 0x0004:
    return "PAL_B";
  case 0x0008:
    return "PAL_D";
  case 0x0100:
    return "PAL_G";
  case 0x0010:
    return "PAL_H";
  case 0x0020:
    return "PAL_I";
  case 0x0040:
    return "PAL_M";
  case 0x0080:
    return "PAL_N";
  default:
    return "???";
  }
}


x86 assembly (clang, -O0):
<str_TVStandard>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
sub    $0x1,%rax
je     11bb <str_TVStandard+0xbb>
jmp    111f <str_TVStandard+0x1f>
mov    -0x18(%rbp),%rax
sub    $0x2,%rax
je     11cb <str_TVStandard+0xcb>
jmp    1132 <str_TVStandard+0x32>
mov    -0x18(%rbp),%rax
sub    $0x4,%rax
je     11db <str_TVStandard+0xdb>
jmp    1145 <str_TVStandard+0x45>
mov    -0x18(%rbp),%rax
sub    $0x8,%rax
je     11eb <str_TVStandard+0xeb>
jmp    1158 <str_TVStandard+0x58>
mov    -0x18(%rbp),%rax
sub    $0x10,%rax
je     120b <str_TVStandard+0x10b>
jmp    116b <str_TVStandard+0x6b>
mov    -0x18(%rbp),%rax
sub    $0x20,%rax
je     121b <str_TVStandard+0x11b>
jmp    117e <str_TVStandard+0x7e>
mov    -0x18(%rbp),%rax
sub    $0x40,%rax
je     122b <str_TVStandard+0x12b>
jmp    1191 <str_TVStandard+0x91>
mov    -0x18(%rbp),%rax
sub    $0x80,%rax
je     123b <str_TVStandard+0x13b>
jmp    11a6 <str_TVStandard+0xa6>
mov    -0x18(%rbp),%rax
sub    $0x100,%rax
je     11fb <str_TVStandard+0xfb>
jmp    124b <str_TVStandard+0x14b>
lea    0xe3e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1256 <str_TVStandard+0x156>
lea    0xe33(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1256 <str_TVStandard+0x156>
lea    0xe2d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1256 <str_TVStandard+0x156>
lea    0xe23(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1256 <str_TVStandard+0x156>
lea    0xe19(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1256 <str_TVStandard+0x156>
lea    0xe0f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1256 <str_TVStandard+0x156>
lea    0xe05(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1256 <str_TVStandard+0x156>
lea    0xdfb(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1256 <str_TVStandard+0x156>
lea    0xdf1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1256 <str_TVStandard+0x156>
lea    0xde7(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_TVStandard>:
lea    -0x1(%rdi),%rcx
cmp    $0x3f,%rcx
ja     1129 <str_TVStandard+0x29>
lea    0xfef(%rip),%rax
lea    0xee8(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
lea    0xfdd(%rip),%rax
ret
cmp    $0x80,%rdi
je     1173 <str_TVStandard+0x73>
cmp    $0x100,%rdi
jne    1143 <str_TVStandard+0x43>
lea    0xfd9(%rip),%rax
ret
lea    0xfef(%rip),%rax
ret
lea    0xfbd(%rip),%rax
ret
lea    0xfbb(%rip),%rax
ret
lea    0xfbf(%rip),%rax
ret
lea    0xfbd(%rip),%rax
ret
lea    0xfbb(%rip),%rax
ret
lea    0xfb9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"NTSC\00"
@.str.1 = [10 x i8] c"NTSC_EIAJ\00"
@.str.2 = [6 x i8] c"PAL_B\00"
@.str.3 = [6 x i8] c"PAL_D\00"
@.str.4 = [6 x i8] c"PAL_G\00"
@.str.5 = [6 x i8] c"PAL_H\00"
@.str.6 = [6 x i8] c"PAL_I\00"
@.str.7 = [6 x i8] c"PAL_M\00"
@.str.8 = [6 x i8] c"PAL_N\00"
@.str.9 = [4 x i8] c"???\00"
define i8* @str_TVStandard(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
switch i64 %4, label %14 [
i64 1, label %5
i64 2, label %6
i64 4, label %7
i64 8, label %8
i64 256, label %9
i64 16, label %10
i64 32, label %11
i64 64, label %12
i64 128, label %13
]
5: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2
br label %15
6: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %15
7: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %15
8: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %15
9: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %15
10: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %15
11: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %15
12: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %15
13: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %15
14: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8** %2
br label %15
15: ; preds = %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
@.str = [5 x i8] c"NTSC\00"
@.str.1 = [10 x i8] c"NTSC_EIAJ\00"
@.str.2 = [6 x i8] c"PAL_B\00"
@.str.3 = [6 x i8] c"PAL_D\00"
@.str.4 = [6 x i8] c"PAL_G\00"
@.str.5 = [6 x i8] c"PAL_H\00"
@.str.6 = [6 x i8] c"PAL_I\00"
@.str.7 = [6 x i8] c"PAL_M\00"
@.str.8 = [6 x i8] c"PAL_N\00"
@.str.9 = [4 x i8] c"???\00"
define i8* @str_TVStandard(i64 %0) {
switch i64 %0, label %10 [
i64 1, label %11
i64 2, label %2
i64 4, label %3
i64 8, label %4
i64 256, label %5
i64 16, label %6
i64 32, label %7
i64 64, label %8
i64 128, label %9
]
2: ; preds = %1
br label %11
3: ; preds = %1
br label %11
4: ; preds = %1
br label %11
5: ; preds = %1
br label %11
6: ; preds = %1
br label %11
7: ; preds = %1
br label %11
8: ; preds = %1
br label %11
9: ; preds = %1
br label %11
10: ; preds = %1
br label %11
11: ; preds = %1, %10, %9, %8, %7, %6, %5, %4, %3, %2
%12 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), %10 ], [ getelementptr inbounds ([6 x i8], [6 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 ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), %7 ], [ getelementptr inbounds ([6 x i8], [6 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 ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %12
}