#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int map_parameter_oceanographic_currents(int, int, int, int);
int map_parameter_oceanographic_ice(int, int, int, int);
int map_parameter_oceanographic_subsurface(int, int, int, int);
int map_parameter_oceanographic_surface(int, int, int, int);
int map_parameter_oceanographic_waves(int, int, int, int);
int map_parameter_oceanographic(int center, int disc, int param_cat,
                                int param_num) {
  (void)(disc);
  (void)(center);
  switch (param_cat) {
  case 0:
    return map_parameter_oceanographic_waves(center, disc, param_cat,
                                             param_num);
  case 1:
    return map_parameter_oceanographic_currents(center, disc, param_cat,
                                                param_num);
  case 2:
    return map_parameter_oceanographic_ice(center, disc, param_cat, param_num);
  case 3:
    return map_parameter_oceanographic_surface(center, disc, param_cat,
                                               param_num);
  case 4:
    return map_parameter_oceanographic_subsurface(center, disc, param_cat,
                                                  param_num);
  default:
    break;
  }
  return -1;
}


x86 assembly (clang, -O0):
<map_parameter_oceanographic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    %rax,-0x20(%rbp)
sub    $0x4,%rax
ja     1206 <map_parameter_oceanographic+0xb6>
mov    -0x20(%rbp),%rax
lea    0xe80(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1060 <map_parameter_oceanographic_waves@plt>
mov    %eax,-0x4(%rbp)
jmp    1212 <map_parameter_oceanographic+0xc2>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1070 <map_parameter_oceanographic_currents@plt>
mov    %eax,-0x4(%rbp)
jmp    1212 <map_parameter_oceanographic+0xc2>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1030 <map_parameter_oceanographic_ice@plt>
mov    %eax,-0x4(%rbp)
jmp    1212 <map_parameter_oceanographic+0xc2>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1050 <map_parameter_oceanographic_surface@plt>
mov    %eax,-0x4(%rbp)
jmp    1212 <map_parameter_oceanographic+0xc2>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1040 <map_parameter_oceanographic_subsurface@plt>
mov    %eax,-0x4(%rbp)
jmp    1212 <map_parameter_oceanographic+0xc2>
jmp    120b <map_parameter_oceanographic+0xbb>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<map_parameter_oceanographic>:
cmp    $0x4,%edx
ja     116e <map_parameter_oceanographic+0x1e>
mov    %edx,%eax
lea    0xea2(%rip),%rdx
movslq (%rdx,%rax,4),%rax
add    %rdx,%rax
jmp    *%rax
xor    %edx,%edx
jmp    1060 <map_parameter_oceanographic_waves@plt>
mov    $0xffffffff,%eax
ret
mov    $0x1,%edx
jmp    1070 <map_parameter_oceanographic_currents@plt>
mov    $0x2,%edx
jmp    1030 <map_parameter_oceanographic_ice@plt>
mov    $0x3,%edx
jmp    1050 <map_parameter_oceanographic_surface@plt>
mov    $0x4,%edx
jmp    1040 <map_parameter_oceanographic_subsurface@plt>

LLVM IR (-O0):
define i32 @map_parameter_oceanographic(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%10 = load i32, i32* %7
%11 = load i32, i32* %6
%12 = load i32, i32* %8
switch i32 %12, label %43 [
i32 0, label %13
i32 1, label %19
i32 2, label %25
i32 3, label %31
i32 4, label %37
]
13: ; preds = %4
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = load i32, i32* %8
%17 = load i32, i32* %9
%18 = call i32 @map_parameter_oceanographic_waves(i32 %14, i32 %15, i32 %16, i32 %17)
store i32 %18, i32* %5
br label %45
19: ; preds = %4
%20 = load i32, i32* %6
%21 = load i32, i32* %7
%22 = load i32, i32* %8
%23 = load i32, i32* %9
%24 = call i32 @map_parameter_oceanographic_currents(i32 %20, i32 %21, i32 %22, i32 %23)
store i32 %24, i32* %5
br label %45
25: ; preds = %4
%26 = load i32, i32* %6
%27 = load i32, i32* %7
%28 = load i32, i32* %8
%29 = load i32, i32* %9
%30 = call i32 @map_parameter_oceanographic_ice(i32 %26, i32 %27, i32 %28, i32 %29)
store i32 %30, i32* %5
br label %45
31: ; preds = %4
%32 = load i32, i32* %6
%33 = load i32, i32* %7
%34 = load i32, i32* %8
%35 = load i32, i32* %9
%36 = call i32 @map_parameter_oceanographic_surface(i32 %32, i32 %33, i32 %34, i32 %35)
store i32 %36, i32* %5
br label %45
37: ; preds = %4
%38 = load i32, i32* %6
%39 = load i32, i32* %7
%40 = load i32, i32* %8
%41 = load i32, i32* %9
%42 = call i32 @map_parameter_oceanographic_subsurface(i32 %38, i32 %39, i32 %40, i32 %41)
store i32 %42, i32* %5
br label %45
43: ; preds = %4
br label %44
44: ; preds = %43
store i32 -1, i32* %5
br label %45
45: ; preds = %44, %37, %31, %25, %19, %13
%46 = load i32, i32* %5
ret i32 %46
}

LLVM IR (-O2):
define i32 @map_parameter_oceanographic(i32 %0, i32 %1, i32 %2, i32 %3) {
switch i32 %2, label %15 [
i32 0, label %5
i32 1, label %7
i32 2, label %9
i32 3, label %11
i32 4, label %13
]
5: ; preds = %4
%6 = tail call i32 @map_parameter_oceanographic_waves(i32 %0, i32 %1, i32 0, i32 %3)
br label %15
7: ; preds = %4
%8 = tail call i32 @map_parameter_oceanographic_currents(i32 %0, i32 %1, i32 1, i32 %3)
br label %15
9: ; preds = %4
%10 = tail call i32 @map_parameter_oceanographic_ice(i32 %0, i32 %1, i32 2, i32 %3)
br label %15
11: ; preds = %4
%12 = tail call i32 @map_parameter_oceanographic_surface(i32 %0, i32 %1, i32 3, i32 %3)
br label %15
13: ; preds = %4
%14 = tail call i32 @map_parameter_oceanographic_subsurface(i32 %0, i32 %1, i32 4, i32 %3)
br label %15
15: ; preds = %4, %13, %11, %9, %7, %5
%16 = phi i32 [ %14, %13 ], [ %12, %11 ], [ %10, %9 ], [ %8, %7 ], [ %6, %5 ], [ -1, %4 ]
ret i32 %16
}