int grib1ltypeToZaxisType(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 102: {
    zaxistype = 12;
    break;
  }
  case 99:
  case 100: {
    zaxistype = 4;
    break;
  }
  case 105: {
    zaxistype = 5;
    break;
  }
  case 103: {
    zaxistype = 10;
    break;
  }
  case 107:
  case 108: {
    zaxistype = 11;
    break;
  }
  case 109:
  case 110: {
    zaxistype = 2;
    break;
  }
  case 111:
  case 112: {
    zaxistype = 7;
    break;
  }
  case 113: {
    zaxistype = 8;
    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;
  }
  }
  return (zaxistype);
}


x86 assembly (clang, -O0):
<grib1ltypeToZaxisType>:
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     1230 <grib1ltypeToZaxisType+0x130>
mov    -0x10(%rbp),%rax
lea    0xed0(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x8(%rbp)
jmp    1230 <grib1ltypeToZaxisType+0x130>
movl   $0x10,-0x8(%rbp)
jmp    1230 <grib1ltypeToZaxisType+0x130>
movl   $0x11,-0x8(%rbp)
jmp    1230 <grib1ltypeToZaxisType+0x130>
movl   $0x12,-0x8(%rbp)
jmp    1230 <grib1ltypeToZaxisType+0x130>
movl   $0xd,-0x8(%rbp)
jmp    1230 <grib1ltypeToZaxisType+0x130>
movl   $0xe,-0x8(%rbp)
jmp    1230 <grib1ltypeToZaxisType+0x130>
movl   $0xf,-0x8(%rbp)
jmp    1230 <grib1ltypeToZaxisType+0x130>
movl   $0xc,-0x8(%rbp)
jmp    1230 <grib1ltypeToZaxisType+0x130>
movl   $0x4,-0x8(%rbp)
jmp    1230 <grib1ltypeToZaxisType+0x130>
movl   $0x5,-0x8(%rbp)
jmp    1230 <grib1ltypeToZaxisType+0x130>
movl   $0xa,-0x8(%rbp)
jmp    1230 <grib1ltypeToZaxisType+0x130>
movl   $0xb,-0x8(%rbp)
jmp    1230 <grib1ltypeToZaxisType+0x130>
movl   $0x2,-0x8(%rbp)
jmp    1230 <grib1ltypeToZaxisType+0x130>
movl   $0x7,-0x8(%rbp)
jmp    1230 <grib1ltypeToZaxisType+0x130>
movl   $0x8,-0x8(%rbp)
jmp    1230 <grib1ltypeToZaxisType+0x130>
movl   $0x6,-0x8(%rbp)
jmp    1230 <grib1ltypeToZaxisType+0x130>
movl   $0x14,-0x8(%rbp)
jmp    1230 <grib1ltypeToZaxisType+0x130>
movl   $0x15,-0x8(%rbp)
jmp    1230 <grib1ltypeToZaxisType+0x130>
movl   $0x16,-0x8(%rbp)
jmp    1230 <grib1ltypeToZaxisType+0x130>
movl   $0x17,-0x8(%rbp)
jmp    1230 <grib1ltypeToZaxisType+0x130>
movl   $0x18,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<grib1ltypeToZaxisType>:
mov    $0x1,%eax
add    $0xffffffff,%edi
cmp    $0xa5,%edi
ja     119e <grib1ltypeToZaxisType+0x9e>
lea    0xee5(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x4,%eax
ret
mov    $0xb,%eax
ret
mov    $0x2,%eax
ret
mov    $0x7,%eax
ret
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    $0xc,%eax
ret
mov    $0xa,%eax
ret
mov    $0x5,%eax
ret
mov    $0x8,%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 @grib1ltypeToZaxisType(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 %26 [
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 102, label %12
i32 99, label %13
i32 100, label %13
i32 105, label %14
i32 103, label %15
i32 107, label %16
i32 108, label %16
i32 109, label %17
i32 110, label %17
i32 111, label %18
i32 112, label %18
i32 113, label %19
i32 160, label %20
i32 162, label %21
i32 163, label %22
i32 164, label %23
i32 165, label %24
i32 166, label %25
]
5: ; preds = %1
store i32 0, i32* %3
br label %26
6: ; preds = %1
store i32 16, i32* %3
br label %26
7: ; preds = %1
store i32 17, i32* %3
br label %26
8: ; preds = %1
store i32 18, i32* %3
br label %26
9: ; preds = %1
store i32 13, i32* %3
br label %26
10: ; preds = %1
store i32 14, i32* %3
br label %26
11: ; preds = %1
store i32 15, i32* %3
br label %26
12: ; preds = %1
store i32 12, i32* %3
br label %26
13: ; preds = %1, %1
store i32 4, i32* %3
br label %26
14: ; preds = %1
store i32 5, i32* %3
br label %26
15: ; preds = %1
store i32 10, i32* %3
br label %26
16: ; preds = %1, %1
store i32 11, i32* %3
br label %26
17: ; preds = %1, %1
store i32 2, i32* %3
br label %26
18: ; preds = %1, %1
store i32 7, i32* %3
br label %26
19: ; preds = %1
store i32 8, i32* %3
br label %26
20: ; preds = %1
store i32 6, i32* %3
br label %26
21: ; preds = %1
store i32 20, i32* %3
br label %26
22: ; preds = %1
store i32 21, i32* %3
br label %26
23: ; preds = %1
store i32 22, i32* %3
br label %26
24: ; preds = %1
store i32 23, i32* %3
br label %26
25: ; preds = %1
store i32 24, i32* %3
br label %26
26: ; preds = %1, %25, %24, %23, %22, %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @grib1ltypeToZaxisType(i32 %0) {
switch i32 %0, label %23 [
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 102, label %9
i32 99, label %10
i32 100, label %10
i32 105, label %11
i32 103, label %12
i32 107, label %13
i32 108, label %13
i32 109, label %14
i32 110, label %14
i32 111, label %15
i32 112, label %15
i32 113, label %16
i32 160, label %17
i32 162, label %18
i32 163, label %19
i32 164, label %20
i32 165, label %21
i32 166, label %22
]
2: ; preds = %1
br label %23
3: ; preds = %1
br label %23
4: ; preds = %1
br label %23
5: ; preds = %1
br label %23
6: ; preds = %1
br label %23
7: ; preds = %1
br label %23
8: ; preds = %1
br label %23
9: ; preds = %1
br label %23
10: ; preds = %1, %1
br label %23
11: ; preds = %1
br label %23
12: ; preds = %1
br label %23
13: ; preds = %1, %1
br label %23
14: ; preds = %1, %1
br label %23
15: ; preds = %1, %1
br label %23
16: ; preds = %1
br label %23
17: ; preds = %1
br label %23
18: ; preds = %1
br label %23
19: ; preds = %1
br label %23
20: ; preds = %1
br label %23
21: ; preds = %1
br label %23
22: ; preds = %1
br label %23
23: ; preds = %1, %22, %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5, %4, %3, %2
%24 = phi i32 [ 1, %1 ], [ 24, %22 ], [ 23, %21 ], [ 22, %20 ], [ 21, %19 ], [ 20, %18 ], [ 6, %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 %24
}