long dta_file_format_version(long format_code) {
  long version = -1;
  if (format_code == 0x000001) {
    version = 104;
  } else if (format_code == 0x000002) {
    version = 105;
  } else if (format_code == 0x000004) {
    version = 108;
  } else if (format_code == 0x000008) {
    version = 110;
  } else if (format_code == 0x000010) {
    version = 111;
  } else if (format_code == 0x000020) {
    version = 114;
  } else if (format_code == 0x000040) {
    version = 117;
  } else if (format_code == 0x000080) {
    version = 118;
  } else if (format_code == 0x000100) {
    version = 119;
  }
  return version;
}


x86 assembly (clang, -O0):
<dta_file_format_version>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0xffffffffffffffff,-0x10(%rbp)
ff
cmpq   $0x1,-0x8(%rbp)
jne    1128 <dta_file_format_version+0x28>
movq   $0x68,-0x10(%rbp)
jmp    1211 <dta_file_format_version+0x111>
cmpq   $0x2,-0x8(%rbp)
jne    1140 <dta_file_format_version+0x40>
movq   $0x69,-0x10(%rbp)
jmp    120c <dta_file_format_version+0x10c>
cmpq   $0x4,-0x8(%rbp)
jne    1158 <dta_file_format_version+0x58>
movq   $0x6c,-0x10(%rbp)
jmp    1207 <dta_file_format_version+0x107>
cmpq   $0x8,-0x8(%rbp)
jne    1170 <dta_file_format_version+0x70>
movq   $0x6e,-0x10(%rbp)
jmp    1202 <dta_file_format_version+0x102>
cmpq   $0x10,-0x8(%rbp)
jne    1188 <dta_file_format_version+0x88>
movq   $0x6f,-0x10(%rbp)
jmp    11fd <dta_file_format_version+0xfd>
cmpq   $0x20,-0x8(%rbp)
jne    11a0 <dta_file_format_version+0xa0>
movq   $0x72,-0x10(%rbp)
jmp    11f8 <dta_file_format_version+0xf8>
cmpq   $0x40,-0x8(%rbp)
jne    11b8 <dta_file_format_version+0xb8>
movq   $0x75,-0x10(%rbp)
jmp    11f3 <dta_file_format_version+0xf3>
cmpq   $0x80,-0x8(%rbp)
jne    11d3 <dta_file_format_version+0xd3>
movq   $0x76,-0x10(%rbp)
jmp    11ee <dta_file_format_version+0xee>
cmpq   $0x100,-0x8(%rbp)
jne    11e9 <dta_file_format_version+0xe9>
movq   $0x77,-0x10(%rbp)
jmp    11ee <dta_file_format_version+0xee>
jmp    11f3 <dta_file_format_version+0xf3>
jmp    11f8 <dta_file_format_version+0xf8>
jmp    11fd <dta_file_format_version+0xfd>
jmp    1202 <dta_file_format_version+0x102>
jmp    1207 <dta_file_format_version+0x107>
jmp    120c <dta_file_format_version+0x10c>
jmp    1211 <dta_file_format_version+0x111>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dta_file_format_version>:
lea    -0x1(%rdi),%rcx
cmp    $0x3f,%rcx
ja     1125 <dta_file_format_version+0x25>
mov    $0x68,%eax
lea    0xeea(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x69,%eax
ret
cmp    $0x80,%rdi
je     1163 <dta_file_format_version+0x63>
cmp    $0x100,%rdi
jne    113d <dta_file_format_version+0x3d>
mov    $0x77,%eax
ret
mov    $0xffffffffffffffff,%rax
ret
mov    $0x6c,%eax
ret
mov    $0x6e,%eax
ret
mov    $0x6f,%eax
ret
mov    $0x72,%eax
ret
mov    $0x75,%eax
ret
mov    $0x76,%eax
ret

LLVM IR (-O0):
define i64 @dta_file_format_version(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 -1, i64* %3
%4 = load i64, i64* %2
%5 = icmp eq i64 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %1
store i64 104, i64* %3
br label %47
7: ; preds = %1
%8 = load i64, i64* %2
%9 = icmp eq i64 %8, 2
br i1 %9, label %10, label %11
10: ; preds = %7
store i64 105, i64* %3
br label %46
11: ; preds = %7
%12 = load i64, i64* %2
%13 = icmp eq i64 %12, 4
br i1 %13, label %14, label %15
14: ; preds = %11
store i64 108, i64* %3
br label %45
15: ; preds = %11
%16 = load i64, i64* %2
%17 = icmp eq i64 %16, 8
br i1 %17, label %18, label %19
18: ; preds = %15
store i64 110, i64* %3
br label %44
19: ; preds = %15
%20 = load i64, i64* %2
%21 = icmp eq i64 %20, 16
br i1 %21, label %22, label %23
22: ; preds = %19
store i64 111, i64* %3
br label %43
23: ; preds = %19
%24 = load i64, i64* %2
%25 = icmp eq i64 %24, 32
br i1 %25, label %26, label %27
26: ; preds = %23
store i64 114, i64* %3
br label %42
27: ; preds = %23
%28 = load i64, i64* %2
%29 = icmp eq i64 %28, 64
br i1 %29, label %30, label %31
30: ; preds = %27
store i64 117, i64* %3
br label %41
31: ; preds = %27
%32 = load i64, i64* %2
%33 = icmp eq i64 %32, 128
br i1 %33, label %34, label %35
34: ; preds = %31
store i64 118, i64* %3
br label %40
35: ; preds = %31
%36 = load i64, i64* %2
%37 = icmp eq i64 %36, 256
br i1 %37, label %38, label %39
38: ; preds = %35
store i64 119, i64* %3
br label %39
39: ; preds = %38, %35
br label %40
40: ; preds = %39, %34
br label %41
41: ; preds = %40, %30
br label %42
42: ; preds = %41, %26
br label %43
43: ; preds = %42, %22
br label %44
44: ; preds = %43, %18
br label %45
45: ; preds = %44, %14
br label %46
46: ; preds = %45, %10
br label %47
47: ; preds = %46, %6
%48 = load i64, i64* %3
ret i64 %48
}

LLVM IR (-O2):
define i64 @dta_file_format_version(i64 %0) {
switch i64 %0, label %10 [
i64 1, label %11
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
]
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, %2, %4, %6, %8, %9, %7, %5, %3
%12 = phi i64 [ 105, %2 ], [ 108, %3 ], [ 110, %4 ], [ 111, %5 ], [ 114, %6 ], [ 117, %7 ], [ 118, %8 ], [ 119, %9 ], [ 104, %1 ], [ -1, %10 ]
ret i64 %12
}