int zaxisTypeToGrib1ltype(int zaxistype) {
  int grib_ltype = -1;
  switch (zaxistype) {
  case 0: {
    grib_ltype = 1;
    break;
  }
  case 12: {
    grib_ltype = 102;
    break;
  }
  case 5: {
    grib_ltype = 105;
    break;
  }
  case 10: {
    grib_ltype = 103;
    break;
  }
  case 11: {
    grib_ltype = 107;
    break;
  }
  case 6: {
    grib_ltype = 160;
    break;
  }
  case 8: {
    grib_ltype = 113;
    break;
  }
  case 16: {
    grib_ltype = 2;
    break;
  }
  case 17: {
    grib_ltype = 3;
    break;
  }
  case 18: {
    grib_ltype = 4;
    break;
  }
  case 13: {
    grib_ltype = 8;
    break;
  }
  case 14: {
    grib_ltype = 9;
    break;
  }
  case 20: {
    grib_ltype = 162;
    break;
  }
  case 21: {
    grib_ltype = 163;
    break;
  }
  case 22: {
    grib_ltype = 164;
    break;
  }
  case 23: {
    grib_ltype = 165;
    break;
  }
  case 24: {
    grib_ltype = 166;
    break;
  }
  case 15: {
    grib_ltype = 10;
    break;
  }
  }
  return (grib_ltype);
}


x86 assembly (clang, -O0):
<zaxisTypeToGrib1ltype>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x18,%rax
ja     1206 <zaxisTypeToGrib1ltype+0x106>
mov    -0x10(%rbp),%rax
lea    0xed6(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x8(%rbp)
jmp    1206 <zaxisTypeToGrib1ltype+0x106>
movl   $0x66,-0x8(%rbp)
jmp    1206 <zaxisTypeToGrib1ltype+0x106>
movl   $0x69,-0x8(%rbp)
jmp    1206 <zaxisTypeToGrib1ltype+0x106>
movl   $0x67,-0x8(%rbp)
jmp    1206 <zaxisTypeToGrib1ltype+0x106>
movl   $0x6b,-0x8(%rbp)
jmp    1206 <zaxisTypeToGrib1ltype+0x106>
movl   $0xa0,-0x8(%rbp)
jmp    1206 <zaxisTypeToGrib1ltype+0x106>
movl   $0x71,-0x8(%rbp)
jmp    1206 <zaxisTypeToGrib1ltype+0x106>
movl   $0x2,-0x8(%rbp)
jmp    1206 <zaxisTypeToGrib1ltype+0x106>
movl   $0x3,-0x8(%rbp)
jmp    1206 <zaxisTypeToGrib1ltype+0x106>
movl   $0x4,-0x8(%rbp)
jmp    1206 <zaxisTypeToGrib1ltype+0x106>
movl   $0x8,-0x8(%rbp)
jmp    1206 <zaxisTypeToGrib1ltype+0x106>
movl   $0x9,-0x8(%rbp)
jmp    1206 <zaxisTypeToGrib1ltype+0x106>
movl   $0xa2,-0x8(%rbp)
jmp    1206 <zaxisTypeToGrib1ltype+0x106>
movl   $0xa3,-0x8(%rbp)
jmp    1206 <zaxisTypeToGrib1ltype+0x106>
movl   $0xa4,-0x8(%rbp)
jmp    1206 <zaxisTypeToGrib1ltype+0x106>
movl   $0xa5,-0x8(%rbp)
jmp    1206 <zaxisTypeToGrib1ltype+0x106>
movl   $0xa6,-0x8(%rbp)
jmp    1206 <zaxisTypeToGrib1ltype+0x106>
movl   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zaxisTypeToGrib1ltype>:
mov    $0xffffffff,%eax
cmp    $0x18,%edi
ja     1117 <zaxisTypeToGrib1ltype+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @zaxisTypeToGrib1ltype(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 -1, i32* %3
%4 = load i32, i32* %2
switch i32 %4, label %23 [
i32 0, label %5
i32 12, label %6
i32 5, label %7
i32 10, label %8
i32 11, label %9
i32 6, label %10
i32 8, label %11
i32 16, label %12
i32 17, label %13
i32 18, label %14
i32 13, label %15
i32 14, label %16
i32 20, label %17
i32 21, label %18
i32 22, label %19
i32 23, label %20
i32 24, label %21
i32 15, label %22
]
5: ; preds = %1
store i32 1, i32* %3
br label %23
6: ; preds = %1
store i32 102, i32* %3
br label %23
7: ; preds = %1
store i32 105, i32* %3
br label %23
8: ; preds = %1
store i32 103, i32* %3
br label %23
9: ; preds = %1
store i32 107, i32* %3
br label %23
10: ; preds = %1
store i32 160, i32* %3
br label %23
11: ; preds = %1
store i32 113, i32* %3
br label %23
12: ; preds = %1
store i32 2, i32* %3
br label %23
13: ; preds = %1
store i32 3, i32* %3
br label %23
14: ; preds = %1
store i32 4, i32* %3
br label %23
15: ; preds = %1
store i32 8, i32* %3
br label %23
16: ; preds = %1
store i32 9, i32* %3
br label %23
17: ; preds = %1
store i32 162, i32* %3
br label %23
18: ; preds = %1
store i32 163, i32* %3
br label %23
19: ; preds = %1
store i32 164, i32* %3
br label %23
20: ; preds = %1
store i32 165, i32* %3
br label %23
21: ; preds = %1
store i32 166, i32* %3
br label %23
22: ; preds = %1
store i32 10, i32* %3
br label %23
23: ; preds = %1, %22, %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
@switch.table.zaxisTypeToGrib1ltype = [25 x i32] [i32 1, i32 -1, i32 -1, i32 -1, i32 -1, i32 105, i32 160, i32 -1, i32 113, i32 -1, i32 103, i32 107, i32 102, i32 8, i32 9, i32 10, i32 2, i32 3, i32 4, i32 -1, i32 162, i32 163, i32 164, i32 165, i32 166]
define i32 @zaxisTypeToGrib1ltype(i32 %0) {
%2 = icmp ult i32 %0, 25
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [25 x i32], [25 x i32]* @switch.table.zaxisTypeToGrib1ltype, i64 0, i64 %4
%6 = load i32, i32* %5
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ -1, %1 ], [ %6, %3 ]
ret i32 %8
}