#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*/
applyVankaFacesColor_FP64_INT64(long long *, double *, long long *, long long *,
                                long long *, long long, double *, double *,
                                float *, long long, long long, long long,
                                long long, long long);
int /*<<< orphan*/ omp_set_num_threads(long long);
int /*<<< orphan*/ printf(char *);
void RelaxVankaFacesColor_FP64_INT64(long long *rowptr, double *valA,
                                     long long *colA, long long *n,
                                     long long *nf, long long dim, double *x,
                                     double *b, float *D, long long numit,
                                     long long includePressure,
                                     long long VankaType, long long numCores) {
  long long num_cells, blockSize;
  if (dim == 2) {
    blockSize = includePressure ? 5 : 4;
    num_cells = n[0] * n[1];
  } else {
    blockSize = includePressure ? 7 : 6;
    num_cells = n[0] * n[1] * n[2];
  }
  omp_set_num_threads(numCores);
  switch (VankaType) {
  case 1:
  case 3:
    applyVankaFacesColor_FP64_INT64(rowptr, valA, colA, n, nf, dim, x, b, D,
                                    numit, includePressure, blockSize,
                                    num_cells, VankaType);
    break;
  default:
    printf("ERROR Vanka.h: Unknown VankaType");
    break;
  }
  return;
}


x86 assembly (clang, -O0):
<RelaxVankaFacesColor_FP64_INT64>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
mov    0x40(%rbp),%rax
mov    0x38(%rbp),%rax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x30(%rbp)
mov    %rsi,-0x38(%rbp)
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x48(%rbp)
mov    %r8,-0x50(%rbp)
mov    %r9,-0x58(%rbp)
cmpq   $0x2,-0x58(%rbp)
jne    11b7 <RelaxVankaFacesColor_FP64_INT64+0x87>
mov    0x30(%rbp),%rdx
mov    $0x4,%eax
mov    $0x5,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
cltq
mov    %rax,-0x68(%rbp)
mov    -0x48(%rbp),%rax
mov    (%rax),%rax
mov    -0x48(%rbp),%rcx
imul   0x8(%rcx),%rax
mov    %rax,-0x60(%rbp)
jmp    11ef <RelaxVankaFacesColor_FP64_INT64+0xbf>
mov    0x30(%rbp),%rdx
mov    $0x6,%eax
mov    $0x7,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
cltq
mov    %rax,-0x68(%rbp)
mov    -0x48(%rbp),%rax
mov    (%rax),%rax
mov    -0x48(%rbp),%rcx
imul   0x8(%rcx),%rax
mov    -0x48(%rbp),%rcx
imul   0x10(%rcx),%rax
mov    %rax,-0x60(%rbp)
mov    0x40(%rbp),%rdi
call   1050 <omp_set_num_threads@plt>
mov    0x38(%rbp),%rax
or     $0x2,%rax
sub    $0x3,%rax
je     120f <RelaxVankaFacesColor_FP64_INT64+0xdf>
jmp    1278 <RelaxVankaFacesColor_FP64_INT64+0x148>
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x40(%rbp),%rdx
mov    -0x48(%rbp),%rcx
mov    -0x50(%rbp),%r8
mov    -0x58(%rbp),%r9
mov    0x10(%rbp),%r13
mov    0x18(%rbp),%r12
mov    0x20(%rbp),%r15
mov    0x28(%rbp),%r14
mov    0x30(%rbp),%rbx
mov    -0x68(%rbp),%r11
mov    -0x60(%rbp),%r10
mov    0x38(%rbp),%rax
mov    %r13,(%rsp)
mov    %r12,0x8(%rsp)
mov    %r15,0x10(%rsp)
mov    %r14,0x18(%rsp)
mov    %rbx,0x20(%rsp)
mov    %r11,0x28(%rsp)
mov    %r10,0x30(%rsp)
mov    %rax,0x38(%rsp)
call   1040 <applyVankaFacesColor_FP64_INT64@plt>
jmp    1284 <RelaxVankaFacesColor_FP64_INT64+0x154>
lea    0xd81(%rip),%rdi
call   1030 <printf@plt>
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<RelaxVankaFacesColor_FP64_INT64>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %r9,%r15
mov    %rcx,%rbx
mov    %rdi,%rcx
mov    0xb0(%rsp),%rdi
mov    0xa8(%rsp),%r12
mov    0xa0(%rsp),%rax
cmp    $0x2,%r9
mov    %rax,0x40(%rsp)
mov    %r8,0x38(%rsp)
mov    %rdx,0x30(%rsp)
mov    %rsi,0x28(%rsp)
mov    %rcx,0x20(%rsp)
jne    1195 <RelaxVankaFacesColor_FP64_INT64+0x65>
cmp    $0x1,%rax
mov    $0x5,%r13d
sbb    $0x0,%r13
mov    0x8(%rbx),%rbp
mov    %rbx,%rax
jmp    11af <RelaxVankaFacesColor_FP64_INT64+0x7f>
cmp    $0x1,%rax
mov    $0x7,%r13d
sbb    $0x0,%r13
mov    0x8(%rbx),%rbp
imul   (%rbx),%rbp
lea    0x10(%rbx),%rax
mov    0x98(%rsp),%rcx
mov    %rcx,(%rsp)
mov    0x90(%rsp),%rcx
mov    %rcx,0x8(%rsp)
mov    0x88(%rsp),%rcx
mov    %rcx,0x10(%rsp)
mov    0x80(%rsp),%rcx
mov    %rcx,0x18(%rsp)
mov    (%rax),%r14
call   1050 <omp_set_num_threads@plt>
mov    %r12,%rax
or     $0x2,%rax
cmp    $0x3,%rax
jne    1245 <RelaxVankaFacesColor_FP64_INT64+0x115>
imul   %r14,%rbp
mov    0x20(%rsp),%rdi
mov    0x28(%rsp),%rsi
mov    0x30(%rsp),%rdx
mov    %rbx,%rcx
mov    0x38(%rsp),%r8
mov    %r15,%r9
push   %r12
push   %rbp
push   %r13
push   0x58(%rsp)
push   0x20(%rsp)
push   0x30(%rsp)
push   0x40(%rsp)
push   0x50(%rsp)
call   1040 <applyVankaFacesColor_FP64_INT64@plt>
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xdb4(%rip),%rdi
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"ERROR Vanka.h: Unknown VankaType\00"
define void @RelaxVankaFacesColor_FP64_INT64(i64* %0, double* %1, i64* %2, i64* %3, i64* %4, i64 %5, double* %6, double* %7, float* %8, i64 %9, i64 %10, i64 %11, i64 %12) {
%14 = alloca i64*
%15 = alloca double*
%16 = alloca i64*
%17 = alloca i64*
%18 = alloca i64*
%19 = alloca i64
%20 = alloca double*
%21 = alloca double*
%22 = alloca float*
%23 = alloca i64
%24 = alloca i64
%25 = alloca i64
%26 = alloca i64
%27 = alloca i64
%28 = alloca i64
store i64* %0, i64** %14
store double* %1, double** %15
store i64* %2, i64** %16
store i64* %3, i64** %17
store i64* %4, i64** %18
store i64 %5, i64* %19
store double* %6, double** %20
store double* %7, double** %21
store float* %8, float** %22
store i64 %9, i64* %23
store i64 %10, i64* %24
store i64 %11, i64* %25
store i64 %12, i64* %26
%29 = load i64, i64* %19
%30 = icmp eq i64 %29, 2
br i1 %30, label %31, label %44
31: ; preds = %13
%32 = load i64, i64* %24
%33 = icmp ne i64 %32, 0
%34 = zext i1 %33 to i64
%35 = select i1 %33, i32 5, i32 4
%36 = sext i32 %35 to i64
store i64 %36, i64* %28
%37 = load i64*, i64** %17
%38 = getelementptr inbounds i64, i64* %37, i64 0
%39 = load i64, i64* %38
%40 = load i64*, i64** %17
%41 = getelementptr inbounds i64, i64* %40, i64 1
%42 = load i64, i64* %41
%43 = mul nsw i64 %39, %42
store i64 %43, i64* %27
br label %61
44: ; preds = %13
%45 = load i64, i64* %24
%46 = icmp ne i64 %45, 0
%47 = zext i1 %46 to i64
%48 = select i1 %46, i32 7, i32 6
%49 = sext i32 %48 to i64
store i64 %49, i64* %28
%50 = load i64*, i64** %17
%51 = getelementptr inbounds i64, i64* %50, i64 0
%52 = load i64, i64* %51
%53 = load i64*, i64** %17
%54 = getelementptr inbounds i64, i64* %53, i64 1
%55 = load i64, i64* %54
%56 = mul nsw i64 %52, %55
%57 = load i64*, i64** %17
%58 = getelementptr inbounds i64, i64* %57, i64 2
%59 = load i64, i64* %58
%60 = mul nsw i64 %56, %59
store i64 %60, i64* %27
br label %61
61: ; preds = %44, %31
%62 = load i64, i64* %26
%63 = call i32 @omp_set_num_threads(i64 %62)
%64 = load i64, i64* %25
switch i64 %64, label %81 [
i64 1, label %65
i64 3, label %65
]
65: ; preds = %61, %61
%66 = load i64*, i64** %14
%67 = load double*, double** %15
%68 = load i64*, i64** %16
%69 = load i64*, i64** %17
%70 = load i64*, i64** %18
%71 = load i64, i64* %19
%72 = load double*, double** %20
%73 = load double*, double** %21
%74 = load float*, float** %22
%75 = load i64, i64* %23
%76 = load i64, i64* %24
%77 = load i64, i64* %28
%78 = load i64, i64* %27
%79 = load i64, i64* %25
%80 = call i32 @applyVankaFacesColor_FP64_INT64(i64* %66, double* %67, i64* %68, i64* %69, i64* %70, i64 %71, double* %72, double* %73, float* %74, i64 %75, i64 %76, i64 %77, i64 %78, i64 %79)
br label %83
81: ; preds = %61
%82 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %83
83: ; preds = %81, %65
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"ERROR Vanka.h: Unknown VankaType\00"
define void @RelaxVankaFacesColor_FP64_INT64(i64* %0, double* %1, i64* %2, i64* %3, i64* %4, i64 %5, double* %6, double* %7, float* %8, i64 %9, i64 %10, i64 %11, i64 %12) {
%14 = icmp eq i64 %5, 2
%15 = icmp eq i64 %10, 0
br i1 %14, label %16, label %20
16: ; preds = %13
%17 = select i1 %15, i64 4, i64 5
%18 = getelementptr inbounds i64, i64* %3, i64 1
%19 = load i64, i64* %18
br label %27
20: ; preds = %13
%21 = select i1 %15, i64 6, i64 7
%22 = load i64, i64* %3
%23 = getelementptr inbounds i64, i64* %3, i64 1
%24 = load i64, i64* %23
%25 = mul nsw i64 %24, %22
%26 = getelementptr inbounds i64, i64* %3, i64 2
br label %27
27: ; preds = %20, %16
%28 = phi i64* [ %26, %20 ], [ %3, %16 ]
%29 = phi i64 [ %25, %20 ], [ %19, %16 ]
%30 = phi i64 [ %21, %20 ], [ %17, %16 ]
%31 = load i64, i64* %28
%32 = tail call i32 @omp_set_num_threads(i64 %12)
switch i64 %11, label %36 [
i64 1, label %33
i64 3, label %33
]
33: ; preds = %27, %27
%34 = mul nsw i64 %29, %31
%35 = tail call i32 @applyVankaFacesColor_FP64_INT64(i64* %0, double* %1, i64* %2, i64* %3, i64* %4, i64 %5, double* %6, double* %7, float* %8, i64 %9, i64 %10, i64 %30, i64 %34, i64 %11)
br label %38
36: ; preds = %27
%37 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %38
38: ; preds = %36, %33
ret void
}