#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 /*<<< orphan*/ Gaus1(double *, int, double *, int, double);
int /*<<< orphan*/ Gaus2(double *, int, double *, int, double);
int /*<<< orphan*/ Gaus3(double *, int, double *, int, double);
int /*<<< orphan*/ Gaus4(double *, int, double *, int, double);
int /*<<< orphan*/ Gaus5(double *, int, double *, int, double);
int /*<<< orphan*/ Gaus6(double *, int, double *, int, double);
int /*<<< orphan*/ Gaus7(double *, int, double *, int, double);
int /*<<< orphan*/ Gaus8(double *, int, double *, int, double);
void Gauss(double *x, int sigInLength, double *psi, int sigOutLength, int n,
           double ys) {
  switch (n) {
  case 1:
    Gaus1(x, sigInLength, psi, sigOutLength, ys);
    break;
  case 2:
    Gaus2(x, sigInLength, psi, sigOutLength, ys);
    break;
  case 3:
    Gaus3(x, sigInLength, psi, sigOutLength, ys);
    break;
  case 4:
    Gaus4(x, sigInLength, psi, sigOutLength, ys);
    break;
  case 5:
    Gaus5(x, sigInLength, psi, sigOutLength, ys);
    break;
  case 6:
    Gaus6(x, sigInLength, psi, sigOutLength, ys);
    break;
  case 7:
    Gaus7(x, sigInLength, psi, sigOutLength, ys);
    break;
  case 8:
    Gaus8(x, sigInLength, psi, sigOutLength, ys);
    break;
  default:
    break;
  }
  return;
}


x86 assembly (clang, -O0):
<Gauss>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
movsd  %xmm0,-0x28(%rbp)
mov    -0x20(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x30(%rbp)
sub    $0x7,%eax
ja     12b0 <Gauss+0x130>
mov    -0x30(%rbp),%rax
lea    0xe41(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
movsd  -0x28(%rbp),%xmm0
call   1030 <Gaus1@plt>
jmp    12b5 <Gauss+0x135>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
movsd  -0x28(%rbp),%xmm0
call   1070 <Gaus2@plt>
jmp    12b5 <Gauss+0x135>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
movsd  -0x28(%rbp),%xmm0
call   1050 <Gaus3@plt>
jmp    12b5 <Gauss+0x135>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
movsd  -0x28(%rbp),%xmm0
call   1080 <Gaus4@plt>
jmp    12b5 <Gauss+0x135>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
movsd  -0x28(%rbp),%xmm0
call   1060 <Gaus5@plt>
jmp    12b5 <Gauss+0x135>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
movsd  -0x28(%rbp),%xmm0
call   10a0 <Gaus6@plt>
jmp    12b5 <Gauss+0x135>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
movsd  -0x28(%rbp),%xmm0
call   1040 <Gaus7@plt>
jmp    12b5 <Gauss+0x135>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
movsd  -0x28(%rbp),%xmm0
call   1090 <Gaus8@plt>
jmp    12b5 <Gauss+0x135>
jmp    12b5 <Gauss+0x135>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Gauss>:
add    $0xffffffff,%r8d
cmp    $0x7,%r8d
ja     119f <Gauss+0x1f>
lea    0xe6f(%rip),%r9
movslq (%r9,%r8,4),%rax
add    %r9,%rax
jmp    *%rax
jmp    1030 <Gaus1@plt>
ret
jmp    1070 <Gaus2@plt>
jmp    1050 <Gaus3@plt>
jmp    1080 <Gaus4@plt>
jmp    1060 <Gaus5@plt>
jmp    10a0 <Gaus6@plt>
jmp    1040 <Gaus7@plt>
jmp    1090 <Gaus8@plt>

LLVM IR (-O0):
define void @Gauss(double* %0, i32 %1, double* %2, i32 %3, i32 %4, double %5) {
%7 = alloca double*
%8 = alloca i32
%9 = alloca double*
%10 = alloca i32
%11 = alloca i32
%12 = alloca double
store double* %0, double** %7
store i32 %1, i32* %8
store double* %2, double** %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store double %5, double* %12
%13 = load i32, i32* %11
switch i32 %13, label %70 [
i32 1, label %14
i32 2, label %21
i32 3, label %28
i32 4, label %35
i32 5, label %42
i32 6, label %49
i32 7, label %56
i32 8, label %63
]
14: ; preds = %6
%15 = load double*, double** %7
%16 = load i32, i32* %8
%17 = load double*, double** %9
%18 = load i32, i32* %10
%19 = load double, double* %12
%20 = call i32 @Gaus1(double* %15, i32 %16, double* %17, i32 %18, double %19)
br label %71
21: ; preds = %6
%22 = load double*, double** %7
%23 = load i32, i32* %8
%24 = load double*, double** %9
%25 = load i32, i32* %10
%26 = load double, double* %12
%27 = call i32 @Gaus2(double* %22, i32 %23, double* %24, i32 %25, double %26)
br label %71
28: ; preds = %6
%29 = load double*, double** %7
%30 = load i32, i32* %8
%31 = load double*, double** %9
%32 = load i32, i32* %10
%33 = load double, double* %12
%34 = call i32 @Gaus3(double* %29, i32 %30, double* %31, i32 %32, double %33)
br label %71
35: ; preds = %6
%36 = load double*, double** %7
%37 = load i32, i32* %8
%38 = load double*, double** %9
%39 = load i32, i32* %10
%40 = load double, double* %12
%41 = call i32 @Gaus4(double* %36, i32 %37, double* %38, i32 %39, double %40)
br label %71
42: ; preds = %6
%43 = load double*, double** %7
%44 = load i32, i32* %8
%45 = load double*, double** %9
%46 = load i32, i32* %10
%47 = load double, double* %12
%48 = call i32 @Gaus5(double* %43, i32 %44, double* %45, i32 %46, double %47)
br label %71
49: ; preds = %6
%50 = load double*, double** %7
%51 = load i32, i32* %8
%52 = load double*, double** %9
%53 = load i32, i32* %10
%54 = load double, double* %12
%55 = call i32 @Gaus6(double* %50, i32 %51, double* %52, i32 %53, double %54)
br label %71
56: ; preds = %6
%57 = load double*, double** %7
%58 = load i32, i32* %8
%59 = load double*, double** %9
%60 = load i32, i32* %10
%61 = load double, double* %12
%62 = call i32 @Gaus7(double* %57, i32 %58, double* %59, i32 %60, double %61)
br label %71
63: ; preds = %6
%64 = load double*, double** %7
%65 = load i32, i32* %8
%66 = load double*, double** %9
%67 = load i32, i32* %10
%68 = load double, double* %12
%69 = call i32 @Gaus8(double* %64, i32 %65, double* %66, i32 %67, double %68)
br label %71
70: ; preds = %6
br label %71
71: ; preds = %70, %63, %56, %49, %42, %35, %28, %21, %14
ret void
}

LLVM IR (-O2):
define void @Gauss(double* %0, i32 %1, double* %2, i32 %3, i32 %4, double %5) {
switch i32 %4, label %23 [
i32 1, label %7
i32 2, label %9
i32 3, label %11
i32 4, label %13
i32 5, label %15
i32 6, label %17
i32 7, label %19
i32 8, label %21
]
7: ; preds = %6
%8 = tail call i32 @Gaus1(double* %0, i32 %1, double* %2, i32 %3, double %5)
br label %23
9: ; preds = %6
%10 = tail call i32 @Gaus2(double* %0, i32 %1, double* %2, i32 %3, double %5)
br label %23
11: ; preds = %6
%12 = tail call i32 @Gaus3(double* %0, i32 %1, double* %2, i32 %3, double %5)
br label %23
13: ; preds = %6
%14 = tail call i32 @Gaus4(double* %0, i32 %1, double* %2, i32 %3, double %5)
br label %23
15: ; preds = %6
%16 = tail call i32 @Gaus5(double* %0, i32 %1, double* %2, i32 %3, double %5)
br label %23
17: ; preds = %6
%18 = tail call i32 @Gaus6(double* %0, i32 %1, double* %2, i32 %3, double %5)
br label %23
19: ; preds = %6
%20 = tail call i32 @Gaus7(double* %0, i32 %1, double* %2, i32 %3, double %5)
br label %23
21: ; preds = %6
%22 = tail call i32 @Gaus8(double* %0, i32 %1, double* %2, i32 %3, double %5)
br label %23
23: ; preds = %6, %21, %19, %17, %15, %13, %11, %9, %7
ret void
}