#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*/ calculateSubgridError_ADR_tau_1_sd(
    int, int, int, int *, int *, double *, double *, double *, double *,
    double *, double *, double *, double *, double *, double *, double *);
int /*<<< orphan*/ calculateSubgridError_ADR_tau_2_sd(
    int, int, int, int *, int *, double *, double *, double *, double *,
    double *, double *, double *, double *, double *, double *, double *);
int /*<<< orphan*/ calculateSubgridError_ADR_tau_p_sd(
    int, int, int, int *, int *, double *, double *, double *, double *,
    double *, double *, double *, double *, double *, double *, double *);
void calculateSubgridError_ADR_tau_sd(
    int nElements_global, int nQuadraturePoints_element, int nSpace,
    int *rowptr, int *colind, char stabilization, double *elementDiameter,
    double *dmt, double *df, double *a, double *da, double *grad_phi,
    double *dphi, double *dr, double *pe, double *cfl, double *tau) {
  if (stabilization == '2')
    calculateSubgridError_ADR_tau_2_sd(
        nElements_global, nQuadraturePoints_element, nSpace, rowptr, colind,
        elementDiameter, dmt, df, a, da, grad_phi, dphi, dr, pe, cfl, tau);
  else if (stabilization == '1')
    calculateSubgridError_ADR_tau_1_sd(
        nElements_global, nQuadraturePoints_element, nSpace, rowptr, colind,
        elementDiameter, dmt, df, a, da, grad_phi, dphi, dr, pe, cfl, tau);
  else if (stabilization == 'p')
    calculateSubgridError_ADR_tau_p_sd(
        nElements_global, nQuadraturePoints_element, nSpace, rowptr, colind,
        elementDiameter, dmt, df, a, da, grad_phi, dphi, dr, pe, cfl, tau);
}


x86 assembly (clang, -O0):
<calculateSubgridError_ADR_tau_sd>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc8,%rsp
mov    %r9b,%al
mov    0x60(%rbp),%r9
mov    0x58(%rbp),%r9
mov    0x50(%rbp),%r9
mov    0x48(%rbp),%r9
mov    0x40(%rbp),%r9
mov    0x38(%rbp),%r9
mov    0x30(%rbp),%r9
mov    0x28(%rbp),%r9
mov    0x20(%rbp),%r9
mov    0x18(%rbp),%r9
mov    0x10(%rbp),%r9
mov    %edi,-0x2c(%rbp)
mov    %esi,-0x30(%rbp)
mov    %edx,-0x34(%rbp)
mov    %rcx,-0x40(%rbp)
mov    %r8,-0x48(%rbp)
mov    %al,-0x49(%rbp)
movsbl -0x49(%rbp),%eax
cmp    $0x32,%eax
jne    1224 <calculateSubgridError_ADR_tau_sd+0xf4>
mov    -0x2c(%rbp),%edi
mov    -0x30(%rbp),%esi
mov    -0x34(%rbp),%edx
mov    -0x40(%rbp),%rcx
mov    -0x48(%rbp),%r8
mov    0x10(%rbp),%r9
mov    0x18(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    0x20(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    0x28(%rbp),%r13
mov    0x30(%rbp),%r12
mov    0x38(%rbp),%r15
mov    0x40(%rbp),%r14
mov    0x48(%rbp),%rbx
mov    0x50(%rbp),%r11
mov    0x58(%rbp),%r10
mov    0x60(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x68(%rbp),%rax
mov    %rax,(%rsp)
mov    -0x60(%rbp),%rax
mov    %rax,0x8(%rsp)
mov    -0x58(%rbp),%rax
mov    %r13,0x10(%rsp)
mov    %r12,0x18(%rsp)
mov    %r15,0x20(%rsp)
mov    %r14,0x28(%rsp)
mov    %rbx,0x30(%rsp)
mov    %r11,0x38(%rsp)
mov    %r10,0x40(%rsp)
mov    %rax,0x48(%rsp)
call   1050 <calculateSubgridError_ADR_tau_2_sd@plt>
jmp    1375 <calculateSubgridError_ADR_tau_sd+0x245>
movsbl -0x49(%rbp),%eax
cmp    $0x31,%eax
jne    12c1 <calculateSubgridError_ADR_tau_sd+0x191>
mov    -0x2c(%rbp),%edi
mov    -0x30(%rbp),%esi
mov    -0x34(%rbp),%edx
mov    -0x40(%rbp),%rcx
mov    -0x48(%rbp),%r8
mov    0x10(%rbp),%r9
mov    0x18(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    0x20(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    0x28(%rbp),%r13
mov    0x30(%rbp),%r12
mov    0x38(%rbp),%r15
mov    0x40(%rbp),%r14
mov    0x48(%rbp),%rbx
mov    0x50(%rbp),%r11
mov    0x58(%rbp),%r10
mov    0x60(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x80(%rbp),%rax
mov    %rax,(%rsp)
mov    -0x78(%rbp),%rax
mov    %rax,0x8(%rsp)
mov    -0x70(%rbp),%rax
mov    %r13,0x10(%rsp)
mov    %r12,0x18(%rsp)
mov    %r15,0x20(%rsp)
mov    %r14,0x28(%rsp)
mov    %rbx,0x30(%rsp)
mov    %r11,0x38(%rsp)
mov    %r10,0x40(%rsp)
mov    %rax,0x48(%rsp)
call   1040 <calculateSubgridError_ADR_tau_1_sd@plt>
jmp    1370 <calculateSubgridError_ADR_tau_sd+0x240>
movsbl -0x49(%rbp),%eax
cmp    $0x70,%eax
jne    136b <calculateSubgridError_ADR_tau_sd+0x23b>
mov    -0x2c(%rbp),%edi
mov    -0x30(%rbp),%esi
mov    -0x34(%rbp),%edx
mov    -0x40(%rbp),%rcx
mov    -0x48(%rbp),%r8
mov    0x10(%rbp),%r9
mov    0x18(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    0x20(%rbp),%rax
mov    %rax,-0x90(%rbp)
mov    0x28(%rbp),%r13
mov    0x30(%rbp),%r12
mov    0x38(%rbp),%r15
mov    0x40(%rbp),%r14
mov    0x48(%rbp),%rbx
mov    0x50(%rbp),%r11
mov    0x58(%rbp),%r10
mov    0x60(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    -0x98(%rbp),%rax
mov    %rax,(%rsp)
mov    -0x90(%rbp),%rax
mov    %rax,0x8(%rsp)
mov    -0x88(%rbp),%rax
mov    %r13,0x10(%rsp)
mov    %r12,0x18(%rsp)
mov    %r15,0x20(%rsp)
mov    %r14,0x28(%rsp)
mov    %rbx,0x30(%rsp)
mov    %r11,0x38(%rsp)
mov    %r10,0x40(%rsp)
mov    %rax,0x48(%rsp)
call   1030 <calculateSubgridError_ADR_tau_p_sd@plt>
jmp    1370 <calculateSubgridError_ADR_tau_sd+0x240>
jmp    1375 <calculateSubgridError_ADR_tau_sd+0x245>
add    $0xc8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculateSubgridError_ADR_tau_sd>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9d,%eax
mov    0x90(%rsp),%r11
mov    0x88(%rsp),%r10
mov    0x80(%rsp),%rbp
mov    0x78(%rsp),%rbx
mov    0x70(%rsp),%r13
mov    0x68(%rsp),%r12
mov    0x60(%rsp),%r15
mov    0x58(%rsp),%r14
mov    0x40(%rsp),%r9
cmp    $0x31,%al
je     11a3 <calculateSubgridError_ADR_tau_sd+0x73>
cmp    $0x70,%al
je     11c6 <calculateSubgridError_ADR_tau_sd+0x96>
cmp    $0x32,%al
jne    11ed <calculateSubgridError_ADR_tau_sd+0xbd>
push   %r11
push   %r10
push   %rbp
push   %rbx
push   %r13
push   %r12
push   %r15
push   %r14
push   0x90(%rsp)
push   0x90(%rsp)
call   1050 <calculateSubgridError_ADR_tau_2_sd@plt>
jmp    11e7 <calculateSubgridError_ADR_tau_sd+0xb7>
push   %r11
push   %r10
push   %rbp
push   %rbx
push   %r13
push   %r12
push   %r15
push   %r14
push   0x90(%rsp)
push   0x90(%rsp)
call   1040 <calculateSubgridError_ADR_tau_1_sd@plt>
jmp    11e7 <calculateSubgridError_ADR_tau_sd+0xb7>
push   %r11
push   %r10
push   %rbp
push   %rbx
push   %r13
push   %r12
push   %r15
push   %r14
push   0x90(%rsp)
push   0x90(%rsp)
call   1030 <calculateSubgridError_ADR_tau_p_sd@plt>
add    $0x58,%rsp
jmp    11f1 <calculateSubgridError_ADR_tau_sd+0xc1>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @calculateSubgridError_ADR_tau_sd(i32 %0, i32 %1, i32 %2, i32* %3, i32* %4, i8 signext %5, double* %6, double* %7, double* %8, double* %9, double* %10, double* %11, double* %12, double* %13, double* %14, double* %15, double* %16) {
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32*
%22 = alloca i32*
%23 = alloca i8
%24 = alloca double*
%25 = alloca double*
%26 = alloca double*
%27 = alloca double*
%28 = alloca double*
%29 = alloca double*
%30 = alloca double*
%31 = alloca double*
%32 = alloca double*
%33 = alloca double*
%34 = alloca double*
store i32 %0, i32* %18
store i32 %1, i32* %19
store i32 %2, i32* %20
store i32* %3, i32** %21
store i32* %4, i32** %22
store i8 %5, i8* %23
store double* %6, double** %24
store double* %7, double** %25
store double* %8, double** %26
store double* %9, double** %27
store double* %10, double** %28
store double* %11, double** %29
store double* %12, double** %30
store double* %13, double** %31
store double* %14, double** %32
store double* %15, double** %33
store double* %16, double** %34
%35 = load i8, i8* %23
%36 = sext i8 %35 to i32
%37 = icmp eq i32 %36, 50
br i1 %37, label %38, label %56
38: ; preds = %17
%39 = load i32, i32* %18
%40 = load i32, i32* %19
%41 = load i32, i32* %20
%42 = load i32*, i32** %21
%43 = load i32*, i32** %22
%44 = load double*, double** %24
%45 = load double*, double** %25
%46 = load double*, double** %26
%47 = load double*, double** %27
%48 = load double*, double** %28
%49 = load double*, double** %29
%50 = load double*, double** %30
%51 = load double*, double** %31
%52 = load double*, double** %32
%53 = load double*, double** %33
%54 = load double*, double** %34
%55 = call i32 @calculateSubgridError_ADR_tau_2_sd(i32 %39, i32 %40, i32 %41, i32* %42, i32* %43, double* %44, double* %45, double* %46, double* %47, double* %48, double* %49, double* %50, double* %51, double* %52, double* %53, double* %54)
br label %102
56: ; preds = %17
%57 = load i8, i8* %23
%58 = sext i8 %57 to i32
%59 = icmp eq i32 %58, 49
br i1 %59, label %60, label %78
60: ; preds = %56
%61 = load i32, i32* %18
%62 = load i32, i32* %19
%63 = load i32, i32* %20
%64 = load i32*, i32** %21
%65 = load i32*, i32** %22
%66 = load double*, double** %24
%67 = load double*, double** %25
%68 = load double*, double** %26
%69 = load double*, double** %27
%70 = load double*, double** %28
%71 = load double*, double** %29
%72 = load double*, double** %30
%73 = load double*, double** %31
%74 = load double*, double** %32
%75 = load double*, double** %33
%76 = load double*, double** %34
%77 = call i32 @calculateSubgridError_ADR_tau_1_sd(i32 %61, i32 %62, i32 %63, i32* %64, i32* %65, double* %66, double* %67, double* %68, double* %69, double* %70, double* %71, double* %72, double* %73, double* %74, double* %75, double* %76)
br label %101
78: ; preds = %56
%79 = load i8, i8* %23
%80 = sext i8 %79 to i32
%81 = icmp eq i32 %80, 112
br i1 %81, label %82, label %100
82: ; preds = %78
%83 = load i32, i32* %18
%84 = load i32, i32* %19
%85 = load i32, i32* %20
%86 = load i32*, i32** %21
%87 = load i32*, i32** %22
%88 = load double*, double** %24
%89 = load double*, double** %25
%90 = load double*, double** %26
%91 = load double*, double** %27
%92 = load double*, double** %28
%93 = load double*, double** %29
%94 = load double*, double** %30
%95 = load double*, double** %31
%96 = load double*, double** %32
%97 = load double*, double** %33
%98 = load double*, double** %34
%99 = call i32 @calculateSubgridError_ADR_tau_p_sd(i32 %83, i32 %84, i32 %85, i32* %86, i32* %87, double* %88, double* %89, double* %90, double* %91, double* %92, double* %93, double* %94, double* %95, double* %96, double* %97, double* %98)
br label %100
100: ; preds = %82, %78
br label %101
101: ; preds = %100, %60
br label %102
102: ; preds = %101, %38
ret void
}

LLVM IR (-O2):
define void @calculateSubgridError_ADR_tau_sd(i32 %0, i32 %1, i32 %2, i32* %3, i32* %4, i8 signext %5, double* %6, double* %7, double* %8, double* %9, double* %10, double* %11, double* %12, double* %13, double* %14, double* %15, double* %16) {
switch i8 %5, label %24 [
i8 50, label %18
i8 49, label %20
i8 112, label %22
]
18: ; preds = %17
%19 = tail call i32 @calculateSubgridError_ADR_tau_2_sd(i32 %0, i32 %1, i32 %2, i32* %3, i32* %4, double* %6, double* %7, double* %8, double* %9, double* %10, double* %11, double* %12, double* %13, double* %14, double* %15, double* %16)
br label %24
20: ; preds = %17
%21 = tail call i32 @calculateSubgridError_ADR_tau_1_sd(i32 %0, i32 %1, i32 %2, i32* %3, i32* %4, double* %6, double* %7, double* %8, double* %9, double* %10, double* %11, double* %12, double* %13, double* %14, double* %15, double* %16)
br label %24
22: ; preds = %17
%23 = tail call i32 @calculateSubgridError_ADR_tau_p_sd(i32 %0, i32 %1, i32 %2, i32* %3, i32* %4, double* %6, double* %7, double* %8, double* %9, double* %10, double* %11, double* %12, double* %13, double* %14, double* %15, double* %16)
br label %24
24: ; preds = %17, %20, %22, %18
ret void
}