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;
  }
  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    11f1 <dta_file_format_version+0xf1>
cmpq   $0x2,-0x8(%rbp)
jne    1140 <dta_file_format_version+0x40>
movq   $0x69,-0x10(%rbp)
jmp    11ec <dta_file_format_version+0xec>
cmpq   $0x4,-0x8(%rbp)
jne    1158 <dta_file_format_version+0x58>
movq   $0x6c,-0x10(%rbp)
jmp    11e7 <dta_file_format_version+0xe7>
cmpq   $0x8,-0x8(%rbp)
jne    1170 <dta_file_format_version+0x70>
movq   $0x6e,-0x10(%rbp)
jmp    11e2 <dta_file_format_version+0xe2>
cmpq   $0x10,-0x8(%rbp)
jne    1188 <dta_file_format_version+0x88>
movq   $0x6f,-0x10(%rbp)
jmp    11dd <dta_file_format_version+0xdd>
cmpq   $0x20,-0x8(%rbp)
jne    11a0 <dta_file_format_version+0xa0>
movq   $0x72,-0x10(%rbp)
jmp    11d8 <dta_file_format_version+0xd8>
cmpq   $0x40,-0x8(%rbp)
jne    11b8 <dta_file_format_version+0xb8>
movq   $0x75,-0x10(%rbp)
jmp    11d3 <dta_file_format_version+0xd3>
cmpq   $0x80,-0x8(%rbp)
jne    11ce <dta_file_format_version+0xce>
movq   $0x76,-0x10(%rbp)
jmp    11d3 <dta_file_format_version+0xd3>
jmp    11d8 <dta_file_format_version+0xd8>
jmp    11dd <dta_file_format_version+0xdd>
jmp    11e2 <dta_file_format_version+0xe2>
jmp    11e7 <dta_file_format_version+0xe7>
jmp    11ec <dta_file_format_version+0xec>
jmp    11f1 <dta_file_format_version+0xf1>
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
jne    1134 <dta_file_format_version+0x34>
mov    $0x76,%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

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 %42
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 %41
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 %40
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 %39
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 %38
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 %37
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 %36
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 %35
35: ; preds = %34, %31
br label %36
36: ; preds = %35, %30
br label %37
37: ; preds = %36, %26
br label %38
38: ; preds = %37, %22
br label %39
39: ; preds = %38, %18
br label %40
40: ; preds = %39, %14
br label %41
41: ; preds = %40, %10
br label %42
42: ; preds = %41, %6
%43 = load i64, i64* %3
ret i64 %43
}

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