int get_modelnum(int version) {
  switch (version >> 8) {
  case 0x01:
    return 19;
    break;
  case 0x02:
    return 7;
    break;
  case 0x40:
    return 9;
    break;
  case 0x50:
    return 8;
    break;
  case 0x60:
    return 3;
    break;
  case 0x70:
    return 11;
    break;
  case 0xc0:
    return 4;
    break;
  case 0xb0:
    return 5;
    break;
  }
  return -1;
}


x86 assembly (clang, -O0):
<get_modelnum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     1199 <get_modelnum+0x99>
jmp    111e <get_modelnum+0x1e>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     11a5 <get_modelnum+0xa5>
jmp    112f <get_modelnum+0x2f>
mov    -0xc(%rbp),%eax
sub    $0x40,%eax
je     11b1 <get_modelnum+0xb1>
jmp    1140 <get_modelnum+0x40>
mov    -0xc(%rbp),%eax
sub    $0x50,%eax
je     11bd <get_modelnum+0xbd>
jmp    1151 <get_modelnum+0x51>
mov    -0xc(%rbp),%eax
sub    $0x60,%eax
je     11c9 <get_modelnum+0xc9>
jmp    1162 <get_modelnum+0x62>
mov    -0xc(%rbp),%eax
sub    $0x70,%eax
je     11d5 <get_modelnum+0xd5>
jmp    1173 <get_modelnum+0x73>
mov    -0xc(%rbp),%eax
sub    $0xb0,%eax
je     11ed <get_modelnum+0xed>
jmp    1186 <get_modelnum+0x86>
mov    -0xc(%rbp),%eax
sub    $0xc0,%eax
je     11e1 <get_modelnum+0xe1>
jmp    11f9 <get_modelnum+0xf9>
movl   $0x13,-0x4(%rbp)
jmp    1200 <get_modelnum+0x100>
movl   $0x7,-0x4(%rbp)
jmp    1200 <get_modelnum+0x100>
movl   $0x9,-0x4(%rbp)
jmp    1200 <get_modelnum+0x100>
movl   $0x8,-0x4(%rbp)
jmp    1200 <get_modelnum+0x100>
movl   $0x3,-0x4(%rbp)
jmp    1200 <get_modelnum+0x100>
movl   $0xb,-0x4(%rbp)
jmp    1200 <get_modelnum+0x100>
movl   $0x4,-0x4(%rbp)
jmp    1200 <get_modelnum+0x100>
movl   $0x5,-0x4(%rbp)
jmp    1200 <get_modelnum+0x100>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_modelnum>:
sar    $0x8,%edi
cmp    $0x5f,%edi
jg     1122 <get_modelnum+0x22>
cmp    $0x3f,%edi
jg     113a <get_modelnum+0x3a>
mov    $0x13,%eax
cmp    $0x1,%edi
je     1177 <get_modelnum+0x77>
cmp    $0x2,%edi
jne    1172 <get_modelnum+0x72>
mov    $0x7,%eax
ret
cmp    $0xaf,%edi
jg     114a <get_modelnum+0x4a>
cmp    $0x60,%edi
je     1160 <get_modelnum+0x60>
cmp    $0x70,%edi
jne    1172 <get_modelnum+0x72>
mov    $0xb,%eax
ret
cmp    $0x40,%edi
je     1166 <get_modelnum+0x66>
cmp    $0x50,%edi
jne    1172 <get_modelnum+0x72>
mov    $0x8,%eax
ret
cmp    $0xb0,%edi
je     116c <get_modelnum+0x6c>
cmp    $0xc0,%edi
jne    1172 <get_modelnum+0x72>
mov    $0x4,%eax
ret
mov    $0x3,%eax
ret
mov    $0x9,%eax
ret
mov    $0x5,%eax
ret
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @get_modelnum(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = ashr i32 %4, 8
switch i32 %5, label %14 [
i32 1, label %6
i32 2, label %7
i32 64, label %8
i32 80, label %9
i32 96, label %10
i32 112, label %11
i32 192, label %12
i32 176, label %13
]
6: ; preds = %1
store i32 19, i32* %2
br label %15
7: ; preds = %1
store i32 7, i32* %2
br label %15
8: ; preds = %1
store i32 9, i32* %2
br label %15
9: ; preds = %1
store i32 8, i32* %2
br label %15
10: ; preds = %1
store i32 3, i32* %2
br label %15
11: ; preds = %1
store i32 11, i32* %2
br label %15
12: ; preds = %1
store i32 4, i32* %2
br label %15
13: ; preds = %1
store i32 5, i32* %2
br label %15
14: ; preds = %1
store i32 -1, i32* %2
br label %15
15: ; preds = %14, %13, %12, %11, %10, %9, %8, %7, %6
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @get_modelnum(i32 %0) {
%2 = ashr i32 %0, 8
switch i32 %2, label %10 [
i32 1, label %11
i32 2, label %3
i32 64, label %4
i32 80, label %5
i32 96, label %6
i32 112, label %7
i32 192, label %8
i32 176, label %9
]
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
%12 = phi i32 [ -1, %10 ], [ 5, %9 ], [ 4, %8 ], [ 11, %7 ], [ 3, %6 ], [ 8, %5 ], [ 9, %4 ], [ 7, %3 ], [ 19, %1 ]
ret i32 %12
}