#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 */
double _g_0();
double _g_1(double const, double const *);
double _g_2(double const, double const *);
double _g_3(double const, double const *);
double _g_4();
double _g(const long i, const double omega, const double vertices_omegas[4]) {
  switch (i) {
  case 0:
    return _g_0();
  case 1:
    return _g_1(omega, vertices_omegas);
  case 2:
    return _g_2(omega, vertices_omegas);
  case 3:
    return _g_3(omega, vertices_omegas);
  case 4:
    return _g_4();
  };
  ;
  ;
  ;
  return 0;
}


x86 assembly (clang, -O0):
<_g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
sub    $0x4,%rax
ja     11f5 <_g+0xa5>
mov    -0x28(%rbp),%rax
lea    0xe7e(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1050 <_g_0@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    11fd <_g+0xad>
movsd  -0x18(%rbp),%xmm0
mov    -0x20(%rbp),%rdi
call   1070 <_g_1@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    11fd <_g+0xad>
movsd  -0x18(%rbp),%xmm0
mov    -0x20(%rbp),%rdi
call   1040 <_g_2@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    11fd <_g+0xad>
movsd  -0x18(%rbp),%xmm0
mov    -0x20(%rbp),%rdi
call   1060 <_g_3@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    11fd <_g+0xad>
mov    $0x0,%al
call   1030 <_g_4@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    11fd <_g+0xad>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_g>:
cmp    $0x4,%rdi
ja     116d <_g+0x1d>
lea    0xea3(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
xor    %eax,%eax
jmp    1050 <_g_0@plt>
xorps  %xmm0,%xmm0
ret
mov    %rsi,%rdi
jmp    1070 <_g_1@plt>
mov    %rsi,%rdi
jmp    1040 <_g_2@plt>
mov    %rsi,%rdi
jmp    1060 <_g_3@plt>
xor    %eax,%eax
jmp    1030 <_g_4@plt>

LLVM IR (-O0):
define double @_g(i64 %0, double %1, double* %2) {
%4 = alloca double
%5 = alloca i64
%6 = alloca double
%7 = alloca double*
store i64 %0, i64* %5
store double %1, double* %6
store double* %2, double** %7
%8 = load i64, i64* %5
switch i64 %8, label %25 [
i64 0, label %9
i64 1, label %11
i64 2, label %15
i64 3, label %19
i64 4, label %23
]
9: ; preds = %3
%10 = call double (...) @_g_0()
store double %10, double* %4
br label %26
11: ; preds = %3
%12 = load double, double* %6
%13 = load double*, double** %7
%14 = call double @_g_1(double %12, double* %13)
store double %14, double* %4
br label %26
15: ; preds = %3
%16 = load double, double* %6
%17 = load double*, double** %7
%18 = call double @_g_2(double %16, double* %17)
store double %18, double* %4
br label %26
19: ; preds = %3
%20 = load double, double* %6
%21 = load double*, double** %7
%22 = call double @_g_3(double %20, double* %21)
store double %22, double* %4
br label %26
23: ; preds = %3
%24 = call double (...) @_g_4()
store double %24, double* %4
br label %26
25: ; preds = %3
store double 0.000000e+00, double* %4
br label %26
26: ; preds = %25, %23, %19, %15, %11, %9
%27 = load double, double* %4
ret double %27
}

LLVM IR (-O2):
define double @_g(i64 %0, double %1, double* %2) {
switch i64 %0, label %14 [
i64 0, label %4
i64 1, label %6
i64 2, label %8
i64 3, label %10
i64 4, label %12
]
4: ; preds = %3
%5 = tail call double (...) @_g_0()
br label %14
6: ; preds = %3
%7 = tail call double @_g_1(double %1, double* %2)
br label %14
8: ; preds = %3
%9 = tail call double @_g_2(double %1, double* %2)
br label %14
10: ; preds = %3
%11 = tail call double @_g_3(double %1, double* %2)
br label %14
12: ; preds = %3
%13 = tail call double (...) @_g_4()
br label %14
14: ; preds = %3, %12, %10, %8, %6, %4
%15 = phi double [ %13, %12 ], [ %11, %10 ], [ %9, %8 ], [ %7, %6 ], [ %5, %4 ], [ 0.000000e+00, %3 ]
ret double %15
}