int grib2ltypeToZaxisType(int grib_ltype) {
  int zaxistype = 1;
  switch (grib_ltype) {
  case 1: {
    zaxistype = 0;
    break;
  }
  case 2: {
    zaxistype = 16;
    break;
  }
  case 3: {
    zaxistype = 17;
    break;
  }
  case 4: {
    zaxistype = 18;
    break;
  }
  case 8: {
    zaxistype = 13;
    break;
  }
  case 9: {
    zaxistype = 14;
    break;
  }
  case 10: {
    zaxistype = 15;
    break;
  }
  case 101: {
    zaxistype = 12;
    break;
  }
  case 100: {
    zaxistype = 4;
    break;
  }
  case 103: {
    zaxistype = 5;
    break;
  }
  case 102: {
    zaxistype = 10;
    break;
  }
  case 104: {
    zaxistype = 11;
    break;
  }
  case 105: {
    zaxistype = 2;
    break;
  }
  case 106: {
    zaxistype = 7;
    break;
  }
  case 107: {
    zaxistype = 8;
    break;
  }
  case 114: {
    zaxistype = 19;
    break;
  }
  case 160: {
    zaxistype = 6;
    break;
  }
  case 162: {
    zaxistype = 20;
    break;
  }
  case 163: {
    zaxistype = 21;
    break;
  }
  case 164: {
    zaxistype = 22;
    break;
  }
  case 165: {
    zaxistype = 23;
    break;
  }
  case 166: {
    zaxistype = 24;
    break;
  }
  case 150: {
    zaxistype = 25;
    break;
  }
  }
  return (zaxistype);
}


x86 assembly (clang, -O0):
<grib2ltypeToZaxisType>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0xa5,%eax
ja     1248 <grib2ltypeToZaxisType+0x148>
mov    -0x10(%rbp),%rax
lea    0xed0(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x8(%rbp)
jmp    1248 <grib2ltypeToZaxisType+0x148>
movl   $0x10,-0x8(%rbp)
jmp    1248 <grib2ltypeToZaxisType+0x148>
movl   $0x11,-0x8(%rbp)
jmp    1248 <grib2ltypeToZaxisType+0x148>
movl   $0x12,-0x8(%rbp)
jmp    1248 <grib2ltypeToZaxisType+0x148>
movl   $0xd,-0x8(%rbp)
jmp    1248 <grib2ltypeToZaxisType+0x148>
movl   $0xe,-0x8(%rbp)
jmp    1248 <grib2ltypeToZaxisType+0x148>
movl   $0xf,-0x8(%rbp)
jmp    1248 <grib2ltypeToZaxisType+0x148>
movl   $0xc,-0x8(%rbp)
jmp    1248 <grib2ltypeToZaxisType+0x148>
movl   $0x4,-0x8(%rbp)
jmp    1248 <grib2ltypeToZaxisType+0x148>
movl   $0x5,-0x8(%rbp)
jmp    1248 <grib2ltypeToZaxisType+0x148>
movl   $0xa,-0x8(%rbp)
jmp    1248 <grib2ltypeToZaxisType+0x148>
movl   $0xb,-0x8(%rbp)
jmp    1248 <grib2ltypeToZaxisType+0x148>
movl   $0x2,-0x8(%rbp)
jmp    1248 <grib2ltypeToZaxisType+0x148>
movl   $0x7,-0x8(%rbp)
jmp    1248 <grib2ltypeToZaxisType+0x148>
movl   $0x8,-0x8(%rbp)
jmp    1248 <grib2ltypeToZaxisType+0x148>
movl   $0x13,-0x8(%rbp)
jmp    1248 <grib2ltypeToZaxisType+0x148>
movl   $0x6,-0x8(%rbp)
jmp    1248 <grib2ltypeToZaxisType+0x148>
movl   $0x14,-0x8(%rbp)
jmp    1248 <grib2ltypeToZaxisType+0x148>
movl   $0x15,-0x8(%rbp)
jmp    1248 <grib2ltypeToZaxisType+0x148>
movl   $0x16,-0x8(%rbp)
jmp    1248 <grib2ltypeToZaxisType+0x148>
movl   $0x17,-0x8(%rbp)
jmp    1248 <grib2ltypeToZaxisType+0x148>
movl   $0x18,-0x8(%rbp)
jmp    1248 <grib2ltypeToZaxisType+0x148>
movl   $0x19,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<grib2ltypeToZaxisType>:
mov    $0x1,%eax
add    $0xffffffff,%edi
cmp    $0xa5,%edi
ja     1182 <grib2ltypeToZaxisType+0x82>
lea    0xee9(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
xor    %eax,%eax
ret
mov    $0x10,%eax
ret
mov    $0x11,%eax
ret
mov    $0x12,%eax
ret
mov    $0xd,%eax
ret
mov    $0xe,%eax
ret
mov    $0xf,%eax
ret
mov    $0x4,%eax
ret
mov    $0xc,%eax
ret
mov    $0xa,%eax
ret
mov    $0x5,%eax
ret
mov    $0xb,%eax
ret
mov    $0x2,%eax
ret
mov    $0x7,%eax
ret
mov    $0x8,%eax
ret
mov    $0x13,%eax
ret
mov    $0x19,%eax
ret
mov    $0x6,%eax
ret
mov    $0x14,%eax
ret
mov    $0x15,%eax
ret
mov    $0x16,%eax
ret
mov    $0x17,%eax
ret
mov    $0x18,%eax
ret

LLVM IR (-O0):
define i32 @grib2ltypeToZaxisType(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 %28 [
i32 1, label %5
i32 2, label %6
i32 3, label %7
i32 4, label %8
i32 8, label %9
i32 9, label %10
i32 10, label %11
i32 101, label %12
i32 100, label %13
i32 103, label %14
i32 102, label %15
i32 104, label %16
i32 105, label %17
i32 106, label %18
i32 107, label %19
i32 114, label %20
i32 160, label %21
i32 162, label %22
i32 163, label %23
i32 164, label %24
i32 165, label %25
i32 166, label %26
i32 150, label %27
]
5: ; preds = %1
store i32 0, i32* %3
br label %28
6: ; preds = %1
store i32 16, i32* %3
br label %28
7: ; preds = %1
store i32 17, i32* %3
br label %28
8: ; preds = %1
store i32 18, i32* %3
br label %28
9: ; preds = %1
store i32 13, i32* %3
br label %28
10: ; preds = %1
store i32 14, i32* %3
br label %28
11: ; preds = %1
store i32 15, i32* %3
br label %28
12: ; preds = %1
store i32 12, i32* %3
br label %28
13: ; preds = %1
store i32 4, i32* %3
br label %28
14: ; preds = %1
store i32 5, i32* %3
br label %28
15: ; preds = %1
store i32 10, i32* %3
br label %28
16: ; preds = %1
store i32 11, i32* %3
br label %28
17: ; preds = %1
store i32 2, i32* %3
br label %28
18: ; preds = %1
store i32 7, i32* %3
br label %28
19: ; preds = %1
store i32 8, i32* %3
br label %28
20: ; preds = %1
store i32 19, i32* %3
br label %28
21: ; preds = %1
store i32 6, i32* %3
br label %28
22: ; preds = %1
store i32 20, i32* %3
br label %28
23: ; preds = %1
store i32 21, i32* %3
br label %28
24: ; preds = %1
store i32 22, i32* %3
br label %28
25: ; preds = %1
store i32 23, i32* %3
br label %28
26: ; preds = %1
store i32 24, i32* %3
br label %28
27: ; preds = %1
store i32 25, i32* %3
br label %28
28: ; preds = %1, %27, %26, %25, %24, %23, %22, %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @grib2ltypeToZaxisType(i32 %0) {
switch i32 %0, label %25 [
i32 1, label %2
i32 2, label %3
i32 3, label %4
i32 4, label %5
i32 8, label %6
i32 9, label %7
i32 10, label %8
i32 101, label %9
i32 100, label %10
i32 103, label %11
i32 102, label %12
i32 104, label %13
i32 105, label %14
i32 106, label %15
i32 107, label %16
i32 114, label %17
i32 160, label %18
i32 162, label %19
i32 163, label %20
i32 164, label %21
i32 165, label %22
i32 166, label %23
i32 150, label %24
]
2: ; preds = %1
br label %25
3: ; preds = %1
br label %25
4: ; preds = %1
br label %25
5: ; preds = %1
br label %25
6: ; preds = %1
br label %25
7: ; preds = %1
br label %25
8: ; preds = %1
br label %25
9: ; preds = %1
br label %25
10: ; preds = %1
br label %25
11: ; preds = %1
br label %25
12: ; preds = %1
br label %25
13: ; preds = %1
br label %25
14: ; preds = %1
br label %25
15: ; preds = %1
br label %25
16: ; preds = %1
br label %25
17: ; preds = %1
br label %25
18: ; preds = %1
br label %25
19: ; preds = %1
br label %25
20: ; preds = %1
br label %25
21: ; preds = %1
br label %25
22: ; preds = %1
br label %25
23: ; preds = %1
br label %25
24: ; preds = %1
br label %25
25: ; preds = %1, %24, %23, %22, %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5, %4, %3, %2
%26 = phi i32 [ 1, %1 ], [ 25, %24 ], [ 24, %23 ], [ 23, %22 ], [ 22, %21 ], [ 21, %20 ], [ 20, %19 ], [ 6, %18 ], [ 19, %17 ], [ 8, %16 ], [ 7, %15 ], [ 2, %14 ], [ 11, %13 ], [ 10, %12 ], [ 5, %11 ], [ 4, %10 ], [ 12, %9 ], [ 15, %8 ], [ 14, %7 ], [ 13, %6 ], [ 18, %5 ], [ 17, %4 ], [ 16, %3 ], [ 0, %2 ]
ret i32 %26
}