#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*/ cgau1(double *, int, double *, double *, int, double);
int /*<<< orphan*/ cgau2(double *, int, double *, double *, int, double);
int /*<<< orphan*/ cgau3(double *, int, double *, double *, int, double);
int /*<<< orphan*/ cgau4(double *, int, double *, double *, int, double);
int /*<<< orphan*/ cgau5(double *, int, double *, double *, int, double);
int /*<<< orphan*/ cgau6(double *, int, double *, double *, int, double);
int /*<<< orphan*/ cgau7(double *, int, double *, double *, int, double);
int /*<<< orphan*/ cgau8(double *, int, double *, double *, int, double);
void cgauss(double *x, int sigInLength, int p, double *psir, double *psii,
            int sigOutLength, double ys) {
  switch (p) {
  case 1:
    cgau1(x, sigInLength, psir, psii, sigOutLength, ys);
    break;
  case 2:
    cgau2(x, sigInLength, psir, psii, sigOutLength, ys);
    break;
  case 3:
    cgau3(x, sigInLength, psir, psii, sigOutLength, ys);
    break;
  case 4:
    cgau4(x, sigInLength, psir, psii, sigOutLength, ys);
    break;
  case 5:
    cgau5(x, sigInLength, psir, psii, sigOutLength, ys);
    break;
  case 6:
    cgau6(x, sigInLength, psir, psii, sigOutLength, ys);
    break;
  case 7:
    cgau7(x, sigInLength, psir, psii, sigOutLength, ys);
    break;
  case 8:
    cgau8(x, sigInLength, psir, psii, sigOutLength, ys);
    break;
  default:
    break;
  }
  return;
}


x86 assembly (clang, -O0):
<cgauss>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x38(%rbp)
sub    $0x7,%eax
ja     12dc <cgauss+0x15c>
mov    -0x38(%rbp),%rax
lea    0xe3d(%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    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
movsd  -0x30(%rbp),%xmm0
call   1060 <cgau1@plt>
jmp    12e1 <cgauss+0x161>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
movsd  -0x30(%rbp),%xmm0
call   10a0 <cgau2@plt>
jmp    12e1 <cgauss+0x161>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
movsd  -0x30(%rbp),%xmm0
call   1040 <cgau3@plt>
jmp    12e1 <cgauss+0x161>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
movsd  -0x30(%rbp),%xmm0
call   1090 <cgau4@plt>
jmp    12e1 <cgauss+0x161>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
movsd  -0x30(%rbp),%xmm0
call   1050 <cgau5@plt>
jmp    12e1 <cgauss+0x161>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
movsd  -0x30(%rbp),%xmm0
call   1080 <cgau6@plt>
jmp    12e1 <cgauss+0x161>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
movsd  -0x30(%rbp),%xmm0
call   1030 <cgau7@plt>
jmp    12e1 <cgauss+0x161>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
movsd  -0x30(%rbp),%xmm0
call   1070 <cgau8@plt>
jmp    12e1 <cgauss+0x161>
jmp    12e1 <cgauss+0x161>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgauss>:
add    $0xffffffff,%edx
cmp    $0x7,%edx
ja     11a6 <cgauss+0x26>
lea    0xe71(%rip),%rax
movslq (%rax,%rdx,4),%rdx
add    %rax,%rdx
jmp    *%rdx
mov    %rcx,%rdx
mov    %r8,%rcx
mov    %r9d,%r8d
jmp    1060 <cgau1@plt>
ret
mov    %rcx,%rdx
mov    %r8,%rcx
mov    %r9d,%r8d
jmp    10a0 <cgau2@plt>
mov    %rcx,%rdx
mov    %r8,%rcx
mov    %r9d,%r8d
jmp    1040 <cgau3@plt>
mov    %rcx,%rdx
mov    %r8,%rcx
mov    %r9d,%r8d
jmp    1090 <cgau4@plt>
mov    %rcx,%rdx
mov    %r8,%rcx
mov    %r9d,%r8d
jmp    1050 <cgau5@plt>
mov    %rcx,%rdx
mov    %r8,%rcx
mov    %r9d,%r8d
jmp    1080 <cgau6@plt>
mov    %rcx,%rdx
mov    %r8,%rcx
mov    %r9d,%r8d
jmp    1030 <cgau7@plt>
mov    %rcx,%rdx
mov    %r8,%rcx
mov    %r9d,%r8d
jmp    1070 <cgau8@plt>

LLVM IR (-O0):
define void @cgauss(double* %0, i32 %1, i32 %2, double* %3, double* %4, i32 %5, double %6) {
%8 = alloca double*
%9 = alloca i32
%10 = alloca i32
%11 = alloca double*
%12 = alloca double*
%13 = alloca i32
%14 = alloca double
store double* %0, double** %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store double* %3, double** %11
store double* %4, double** %12
store i32 %5, i32* %13
store double %6, double* %14
%15 = load i32, i32* %10
switch i32 %15, label %80 [
i32 1, label %16
i32 2, label %24
i32 3, label %32
i32 4, label %40
i32 5, label %48
i32 6, label %56
i32 7, label %64
i32 8, label %72
]
16: ; preds = %7
%17 = load double*, double** %8
%18 = load i32, i32* %9
%19 = load double*, double** %11
%20 = load double*, double** %12
%21 = load i32, i32* %13
%22 = load double, double* %14
%23 = call i32 @cgau1(double* %17, i32 %18, double* %19, double* %20, i32 %21, double %22)
br label %81
24: ; preds = %7
%25 = load double*, double** %8
%26 = load i32, i32* %9
%27 = load double*, double** %11
%28 = load double*, double** %12
%29 = load i32, i32* %13
%30 = load double, double* %14
%31 = call i32 @cgau2(double* %25, i32 %26, double* %27, double* %28, i32 %29, double %30)
br label %81
32: ; preds = %7
%33 = load double*, double** %8
%34 = load i32, i32* %9
%35 = load double*, double** %11
%36 = load double*, double** %12
%37 = load i32, i32* %13
%38 = load double, double* %14
%39 = call i32 @cgau3(double* %33, i32 %34, double* %35, double* %36, i32 %37, double %38)
br label %81
40: ; preds = %7
%41 = load double*, double** %8
%42 = load i32, i32* %9
%43 = load double*, double** %11
%44 = load double*, double** %12
%45 = load i32, i32* %13
%46 = load double, double* %14
%47 = call i32 @cgau4(double* %41, i32 %42, double* %43, double* %44, i32 %45, double %46)
br label %81
48: ; preds = %7
%49 = load double*, double** %8
%50 = load i32, i32* %9
%51 = load double*, double** %11
%52 = load double*, double** %12
%53 = load i32, i32* %13
%54 = load double, double* %14
%55 = call i32 @cgau5(double* %49, i32 %50, double* %51, double* %52, i32 %53, double %54)
br label %81
56: ; preds = %7
%57 = load double*, double** %8
%58 = load i32, i32* %9
%59 = load double*, double** %11
%60 = load double*, double** %12
%61 = load i32, i32* %13
%62 = load double, double* %14
%63 = call i32 @cgau6(double* %57, i32 %58, double* %59, double* %60, i32 %61, double %62)
br label %81
64: ; preds = %7
%65 = load double*, double** %8
%66 = load i32, i32* %9
%67 = load double*, double** %11
%68 = load double*, double** %12
%69 = load i32, i32* %13
%70 = load double, double* %14
%71 = call i32 @cgau7(double* %65, i32 %66, double* %67, double* %68, i32 %69, double %70)
br label %81
72: ; preds = %7
%73 = load double*, double** %8
%74 = load i32, i32* %9
%75 = load double*, double** %11
%76 = load double*, double** %12
%77 = load i32, i32* %13
%78 = load double, double* %14
%79 = call i32 @cgau8(double* %73, i32 %74, double* %75, double* %76, i32 %77, double %78)
br label %81
80: ; preds = %7
br label %81
81: ; preds = %80, %72, %64, %56, %48, %40, %32, %24, %16
ret void
}

LLVM IR (-O2):
define void @cgauss(double* %0, i32 %1, i32 %2, double* %3, double* %4, i32 %5, double %6) {
switch i32 %2, label %24 [
i32 1, label %8
i32 2, label %10
i32 3, label %12
i32 4, label %14
i32 5, label %16
i32 6, label %18
i32 7, label %20
i32 8, label %22
]
8: ; preds = %7
%9 = tail call i32 @cgau1(double* %0, i32 %1, double* %3, double* %4, i32 %5, double %6)
br label %24
10: ; preds = %7
%11 = tail call i32 @cgau2(double* %0, i32 %1, double* %3, double* %4, i32 %5, double %6)
br label %24
12: ; preds = %7
%13 = tail call i32 @cgau3(double* %0, i32 %1, double* %3, double* %4, i32 %5, double %6)
br label %24
14: ; preds = %7
%15 = tail call i32 @cgau4(double* %0, i32 %1, double* %3, double* %4, i32 %5, double %6)
br label %24
16: ; preds = %7
%17 = tail call i32 @cgau5(double* %0, i32 %1, double* %3, double* %4, i32 %5, double %6)
br label %24
18: ; preds = %7
%19 = tail call i32 @cgau6(double* %0, i32 %1, double* %3, double* %4, i32 %5, double %6)
br label %24
20: ; preds = %7
%21 = tail call i32 @cgau7(double* %0, i32 %1, double* %3, double* %4, i32 %5, double %6)
br label %24
22: ; preds = %7
%23 = tail call i32 @cgau8(double* %0, i32 %1, double* %3, double* %4, i32 %5, double %6)
br label %24
24: ; preds = %7, %22, %20, %18, %16, %14, %12, %10, %8
ret void
}