char *file_extension(long format) {
  if (format == 0x000001)
    return "dta104";
  if (format == 0x000002)
    return "dta105";
  if (format == 0x000004)
    return "dta108";
  if (format == 0x000008)
    return "dta110";
  if (format == 0x000010)
    return "dta111";
  if (format == 0x000020)
    return "dta114";
  if (format == 0x000040)
    return "dta117";
  if (format == 0x000080)
    return "dta118";
  if (format == 0x000100)
    return "dta119";
  if (format == 0x001000)
    return "sav";
  if (format == 0x002000)
    return "savrow";
  if (format == 0x004000)
    return "zsav";
  if (format == 0x008000)
    return "por";
  if (format == 0x100000)
    return "sas7bcat";
  if (format == 0x010000)
    return "sas7bdat32";
  if (format == 0x020000)
    return "sas7bdat32row";
  if (format == 0x040000)
    return "sas7bdat64";
  if (format == 0x080000)
    return "sas7bdat64row";
  if (format == 0x200000)
    return "xpt5";
  if (format == 0x400000)
    return "xpt8";
  return "data";
}


x86 assembly (clang, -O0):
<file_extension>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x1,-0x10(%rbp)
jne    1123 <file_extension+0x23>
lea    0xee6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1356 <file_extension+0x256>
cmpq   $0x2,-0x10(%rbp)
jne    113e <file_extension+0x3e>
lea    0xed2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1356 <file_extension+0x256>
cmpq   $0x4,-0x10(%rbp)
jne    1159 <file_extension+0x59>
lea    0xebe(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1356 <file_extension+0x256>
cmpq   $0x8,-0x10(%rbp)
jne    1174 <file_extension+0x74>
lea    0xeaa(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1356 <file_extension+0x256>
cmpq   $0x10,-0x10(%rbp)
jne    118f <file_extension+0x8f>
lea    0xe96(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1356 <file_extension+0x256>
cmpq   $0x20,-0x10(%rbp)
jne    11aa <file_extension+0xaa>
lea    0xe82(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1356 <file_extension+0x256>
cmpq   $0x40,-0x10(%rbp)
jne    11c5 <file_extension+0xc5>
lea    0xe6e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1356 <file_extension+0x256>
cmpq   $0x80,-0x10(%rbp)
jne    11e3 <file_extension+0xe3>
lea    0xe57(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1356 <file_extension+0x256>
cmpq   $0x100,-0x10(%rbp)
jne    1201 <file_extension+0x101>
lea    0xe40(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1356 <file_extension+0x256>
cmpq   $0x1000,-0x10(%rbp)
jne    121f <file_extension+0x11f>
lea    0xe31(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1356 <file_extension+0x256>
cmpq   $0x2000,-0x10(%rbp)
jne    123d <file_extension+0x13d>
lea    0xe0b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1356 <file_extension+0x256>
cmpq   $0x4000,-0x10(%rbp)
jne    125b <file_extension+0x15b>
lea    0xdf4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1356 <file_extension+0x256>
cmpq   $0x8000,-0x10(%rbp)
jne    1279 <file_extension+0x179>
lea    0xddb(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1356 <file_extension+0x256>
cmpq   $0x100000,-0x10(%rbp)
jne    1297 <file_extension+0x197>
lea    0xdc1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1356 <file_extension+0x256>
cmpq   $0x10000,-0x10(%rbp)
jne    12b5 <file_extension+0x1b5>
lea    0xdac(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1356 <file_extension+0x256>
cmpq   $0x20000,-0x10(%rbp)
jne    12d3 <file_extension+0x1d3>
lea    0xd99(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1356 <file_extension+0x256>
cmpq   $0x40000,-0x10(%rbp)
jne    12f1 <file_extension+0x1f1>
lea    0xd89(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1356 <file_extension+0x256>
cmpq   $0x80000,-0x10(%rbp)
jne    130f <file_extension+0x20f>
lea    0xd76(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1356 <file_extension+0x256>
cmpq   $0x200000,-0x10(%rbp)
jne    132d <file_extension+0x22d>
lea    0xd66(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1356 <file_extension+0x256>
cmpq   $0x400000,-0x10(%rbp)
jne    134b <file_extension+0x24b>
lea    0xd4d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1356 <file_extension+0x256>
lea    0xd42(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_extension>:
cmp    $0x1fff,%rdi
jg     1140 <file_extension+0x40>
cmp    $0x7f,%rdi
jg     11c1 <file_extension+0xc1>
add    $0xffffffffffffffff,%rdi
cmp    $0x3f,%rdi
ja     1294 <file_extension+0x194>
lea    0xfd8(%rip),%rax
lea    0xed1(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
lea    0xfc8(%rip),%rax
ret
cmp    $0x3ffff,%rdi
jg     1185 <file_extension+0x85>
cmp    $0x7fff,%rdi
jle    11f0 <file_extension+0xf0>
cmp    $0x8000,%rdi
je     1254 <file_extension+0x154>
cmp    $0x10000,%rdi
je     125c <file_extension+0x15c>
cmp    $0x20000,%rdi
jne    1294 <file_extension+0x194>
lea    0xfdf(%rip),%rax
ret
cmp    $0xfffff,%rdi
jle    1212 <file_extension+0x112>
cmp    $0x100000,%rdi
je     1264 <file_extension+0x164>
cmp    $0x200000,%rdi
je     126c <file_extension+0x16c>
cmp    $0x400000,%rdi
jne    1294 <file_extension+0x194>
lea    0xfcf(%rip),%rax
ret
cmp    $0x80,%rdi
je     1274 <file_extension+0x174>
cmp    $0x100,%rdi
je     127c <file_extension+0x17c>
cmp    $0x1000,%rdi
jne    1294 <file_extension+0x194>
lea    0xf58(%rip),%rax
ret
cmp    $0x2000,%rdi
je     1284 <file_extension+0x184>
cmp    $0x4000,%rdi
jne    1294 <file_extension+0x194>
lea    0xf35(%rip),%rax
ret
cmp    $0x40000,%rdi
je     128c <file_extension+0x18c>
cmp    $0x80000,%rdi
jne    1294 <file_extension+0x194>
lea    0xf51(%rip),%rax
ret
lea    0xedb(%rip),%rax
ret
lea    0xeda(%rip),%rax
ret
lea    0xed9(%rip),%rax
ret
lea    0xed8(%rip),%rax
ret
lea    0xed7(%rip),%rax
ret
lea    0xef0(%rip),%rax
ret
lea    0xef5(%rip),%rax
ret
lea    0xee4(%rip),%rax
ret
lea    0xf17(%rip),%rax
ret
lea    0xeb6(%rip),%rax
ret
lea    0xeb5(%rip),%rax
ret
lea    0xeb4(%rip),%rax
ret
lea    0xede(%rip),%rax
ret
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"dta104\00"
@.str.1 = [7 x i8] c"dta105\00"
@.str.2 = [7 x i8] c"dta108\00"
@.str.3 = [7 x i8] c"dta110\00"
@.str.4 = [7 x i8] c"dta111\00"
@.str.5 = [7 x i8] c"dta114\00"
@.str.6 = [7 x i8] c"dta117\00"
@.str.7 = [7 x i8] c"dta118\00"
@.str.8 = [7 x i8] c"dta119\00"
@.str.9 = [4 x i8] c"sav\00"
@.str.10 = [7 x i8] c"savrow\00"
@.str.11 = [5 x i8] c"zsav\00"
@.str.12 = [4 x i8] c"por\00"
@.str.13 = [9 x i8] c"sas7bcat\00"
@.str.14 = [11 x i8] c"sas7bdat32\00"
@.str.15 = [14 x i8] c"sas7bdat32row\00"
@.str.16 = [11 x i8] c"sas7bdat64\00"
@.str.17 = [14 x i8] c"sas7bdat64row\00"
@.str.18 = [5 x i8] c"xpt5\00"
@.str.19 = [5 x i8] c"xpt8\00"
@.str.20 = [5 x i8] c"data\00"
define i8* @file_extension(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp eq i64 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %2
br label %84
7: ; preds = %1
%8 = load i64, i64* %3
%9 = icmp eq i64 %8, 2
br i1 %9, label %10, label %11
10: ; preds = %7
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %84
11: ; preds = %7
%12 = load i64, i64* %3
%13 = icmp eq i64 %12, 4
br i1 %13, label %14, label %15
14: ; preds = %11
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %84
15: ; preds = %11
%16 = load i64, i64* %3
%17 = icmp eq i64 %16, 8
br i1 %17, label %18, label %19
18: ; preds = %15
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %84
19: ; preds = %15
%20 = load i64, i64* %3
%21 = icmp eq i64 %20, 16
br i1 %21, label %22, label %23
22: ; preds = %19
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %84
23: ; preds = %19
%24 = load i64, i64* %3
%25 = icmp eq i64 %24, 32
br i1 %25, label %26, label %27
26: ; preds = %23
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %84
27: ; preds = %23
%28 = load i64, i64* %3
%29 = icmp eq i64 %28, 64
br i1 %29, label %30, label %31
30: ; preds = %27
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %84
31: ; preds = %27
%32 = load i64, i64* %3
%33 = icmp eq i64 %32, 128
br i1 %33, label %34, label %35
34: ; preds = %31
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %84
35: ; preds = %31
%36 = load i64, i64* %3
%37 = icmp eq i64 %36, 256
br i1 %37, label %38, label %39
38: ; preds = %35
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %84
39: ; preds = %35
%40 = load i64, i64* %3
%41 = icmp eq i64 %40, 4096
br i1 %41, label %42, label %43
42: ; preds = %39
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8** %2
br label %84
43: ; preds = %39
%44 = load i64, i64* %3
%45 = icmp eq i64 %44, 8192
br i1 %45, label %46, label %47
46: ; preds = %43
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0), i8** %2
br label %84
47: ; preds = %43
%48 = load i64, i64* %3
%49 = icmp eq i64 %48, 16384
br i1 %49, label %50, label %51
50: ; preds = %47
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i8** %2
br label %84
51: ; preds = %47
%52 = load i64, i64* %3
%53 = icmp eq i64 %52, 32768
br i1 %53, label %54, label %55
54: ; preds = %51
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i8** %2
br label %84
55: ; preds = %51
%56 = load i64, i64* %3
%57 = icmp eq i64 %56, 1048576
br i1 %57, label %58, label %59
58: ; preds = %55
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0), i8** %2
br label %84
59: ; preds = %55
%60 = load i64, i64* %3
%61 = icmp eq i64 %60, 65536
br i1 %61, label %62, label %63
62: ; preds = %59
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0), i8** %2
br label %84
63: ; preds = %59
%64 = load i64, i64* %3
%65 = icmp eq i64 %64, 131072
br i1 %65, label %66, label %67
66: ; preds = %63
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.15, i64 0, i64 0), i8** %2
br label %84
67: ; preds = %63
%68 = load i64, i64* %3
%69 = icmp eq i64 %68, 262144
br i1 %69, label %70, label %71
70: ; preds = %67
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.16, i64 0, i64 0), i8** %2
br label %84
71: ; preds = %67
%72 = load i64, i64* %3
%73 = icmp eq i64 %72, 524288
br i1 %73, label %74, label %75
74: ; preds = %71
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.17, i64 0, i64 0), i8** %2
br label %84
75: ; preds = %71
%76 = load i64, i64* %3
%77 = icmp eq i64 %76, 2097152
br i1 %77, label %78, label %79
78: ; preds = %75
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.18, i64 0, i64 0), i8** %2
br label %84
79: ; preds = %75
%80 = load i64, i64* %3
%81 = icmp eq i64 %80, 4194304
br i1 %81, label %82, label %83
82: ; preds = %79
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0), i8** %2
br label %84
83: ; preds = %79
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.20, i64 0, i64 0), i8** %2
br label %84
84: ; preds = %83, %82, %78, %74, %70, %66, %62, %58, %54, %50, %46, %42, %38, %34, %30, %26, %22, %18, %14, %10, %6
%85 = load i8*, i8** %2
ret i8* %85
}

LLVM IR (-O2):
@.str = [7 x i8] c"dta104\00"
@.str.1 = [7 x i8] c"dta105\00"
@.str.2 = [7 x i8] c"dta108\00"
@.str.3 = [7 x i8] c"dta110\00"
@.str.4 = [7 x i8] c"dta111\00"
@.str.5 = [7 x i8] c"dta114\00"
@.str.6 = [7 x i8] c"dta117\00"
@.str.7 = [7 x i8] c"dta118\00"
@.str.8 = [7 x i8] c"dta119\00"
@.str.9 = [4 x i8] c"sav\00"
@.str.10 = [7 x i8] c"savrow\00"
@.str.11 = [5 x i8] c"zsav\00"
@.str.12 = [4 x i8] c"por\00"
@.str.13 = [9 x i8] c"sas7bcat\00"
@.str.14 = [11 x i8] c"sas7bdat32\00"
@.str.15 = [14 x i8] c"sas7bdat32row\00"
@.str.16 = [11 x i8] c"sas7bdat64\00"
@.str.17 = [14 x i8] c"sas7bdat64row\00"
@.str.18 = [5 x i8] c"xpt5\00"
@.str.19 = [5 x i8] c"xpt8\00"
@.str.20 = [5 x i8] c"data\00"
define i8* @file_extension(i64 %0) {
switch i64 %0, label %21 [
i64 1, label %22
i64 2, label %2
i64 4, label %3
i64 8, label %4
i64 16, label %5
i64 32, label %6
i64 64, label %7
i64 128, label %8
i64 256, label %9
i64 4096, label %10
i64 8192, label %11
i64 16384, label %12
i64 32768, label %13
i64 1048576, label %14
i64 65536, label %15
i64 131072, label %16
i64 262144, label %17
i64 524288, label %18
i64 2097152, label %19
i64 4194304, label %20
]
2: ; preds = %1
br label %22
3: ; preds = %1
br label %22
4: ; preds = %1
br label %22
5: ; preds = %1
br label %22
6: ; preds = %1
br label %22
7: ; preds = %1
br label %22
8: ; preds = %1
br label %22
9: ; preds = %1
br label %22
10: ; preds = %1
br label %22
11: ; preds = %1
br label %22
12: ; preds = %1
br label %22
13: ; preds = %1
br label %22
14: ; preds = %1
br label %22
15: ; preds = %1
br label %22
16: ; preds = %1
br label %22
17: ; preds = %1
br label %22
18: ; preds = %1
br label %22
19: ; preds = %1
br label %22
20: ; preds = %1
br label %22
21: ; preds = %1
br label %22
22: ; preds = %1, %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5, %4, %3, %2
%23 = phi i8* [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), %7 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), %8 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), %9 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), %10 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0), %11 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), %12 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), %13 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0), %14 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0), %15 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.15, i64 0, i64 0), %16 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.16, i64 0, i64 0), %17 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.17, i64 0, i64 0), %18 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.18, i64 0, i64 0), %19 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0), %20 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.20, i64 0, i64 0), %21 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %23
}