#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*/ tce_sortacc_6_scalar(double *, double *, int, int, int, int,
                                        int, int, int, int, int, int, int, int,
                                        double);
int /*<<< orphan*/ tce_sortacc_6_simd(double *, double *, int, int, int, int,
                                      int, int, int, int, int, int, int, int,
                                      double);
void tce_sortacc_6_(double *unsorted, double *sorted, int *a_in, int *b_in,
                    int *c_in, int *d_in, int *e_in, int *f_in, int *i_in,
                    int *j_in, int *k_in, int *l_in, int *m_in, int *n_in,
                    double *factor_in) {
  int a = *a_in;
  int b = *b_in;
  int c = *c_in;
  int d = *d_in;
  int e = *e_in;
  int f = *f_in;
  int i = *i_in - 1;
  int j = *j_in - 1;
  int k = *k_in - 1;
  int l = *l_in - 1;
  int m = *m_in - 1;
  int n = *n_in - 1;
  double factor = *factor_in;
  int dim[6];
  dim[0] = a;
  dim[1] = b;
  dim[2] = c;
  dim[3] = d;
  dim[4] = e;
  dim[5] = f;
  if (dim[n] % 2 == 0 && dim[5] % 2 == 0)
    tce_sortacc_6_simd(unsorted, sorted, a, b, c, d, e, f, i, j, k, l, m, n,
                       factor);
  else
    tce_sortacc_6_scalar(unsorted, sorted, a, b, c, d, e, f, i, j, k, l, m, n,
                         factor);
}


x86 assembly (clang, -O0):
<tce_sortacc_6_>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc8,%rsp
mov    0x50(%rbp),%rax
mov    0x48(%rbp),%rax
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)
mov    -0x40(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x48(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x60(%rbp)
mov    -0x50(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x64(%rbp)
mov    -0x58(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x68(%rbp)
mov    0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x6c(%rbp)
mov    0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x70(%rbp)
mov    0x20(%rbp),%rax
mov    (%rax),%eax
sub    $0x1,%eax
mov    %eax,-0x74(%rbp)
mov    0x28(%rbp),%rax
mov    (%rax),%eax
sub    $0x1,%eax
mov    %eax,-0x78(%rbp)
mov    0x30(%rbp),%rax
mov    (%rax),%eax
sub    $0x1,%eax
mov    %eax,-0x7c(%rbp)
mov    0x38(%rbp),%rax
mov    (%rax),%eax
sub    $0x1,%eax
mov    %eax,-0x80(%rbp)
mov    0x40(%rbp),%rax
mov    (%rax),%eax
sub    $0x1,%eax
mov    %eax,-0x84(%rbp)
mov    0x48(%rbp),%rax
mov    (%rax),%eax
sub    $0x1,%eax
mov    %eax,-0x88(%rbp)
mov    0x50(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x5c(%rbp),%eax
mov    %eax,-0xb0(%rbp)
mov    -0x60(%rbp),%eax
mov    %eax,-0xac(%rbp)
mov    -0x64(%rbp),%eax
mov    %eax,-0xa8(%rbp)
mov    -0x68(%rbp),%eax
mov    %eax,-0xa4(%rbp)
mov    -0x6c(%rbp),%eax
mov    %eax,-0xa0(%rbp)
mov    -0x70(%rbp),%eax
mov    %eax,-0x9c(%rbp)
movslq -0x88(%rbp),%rax
mov    -0xb0(%rbp,%rax,4),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    12e1 <tce_sortacc_6_+0x1c1>
mov    -0x9c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    12e1 <tce_sortacc_6_+0x1c1>
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x5c(%rbp),%edx
mov    -0x60(%rbp),%ecx
mov    -0x64(%rbp),%r8d
mov    -0x68(%rbp),%r9d
mov    -0x6c(%rbp),%r13d
mov    -0x70(%rbp),%r12d
mov    -0x74(%rbp),%r15d
mov    -0x78(%rbp),%r14d
mov    -0x7c(%rbp),%ebx
mov    -0x80(%rbp),%r11d
mov    -0x84(%rbp),%r10d
mov    -0x88(%rbp),%eax
movsd  -0x90(%rbp),%xmm0
ff
mov    %r13d,(%rsp)
mov    %r12d,0x8(%rsp)
mov    %r15d,0x10(%rsp)
mov    %r14d,0x18(%rsp)
mov    %ebx,0x20(%rsp)
mov    %r11d,0x28(%rsp)
mov    %r10d,0x30(%rsp)
mov    %eax,0x38(%rsp)
call   1040 <tce_sortacc_6_simd@plt>
jmp    134d <tce_sortacc_6_+0x22d>
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x5c(%rbp),%edx
mov    -0x60(%rbp),%ecx
mov    -0x64(%rbp),%r8d
mov    -0x68(%rbp),%r9d
mov    -0x6c(%rbp),%r13d
mov    -0x70(%rbp),%r12d
mov    -0x74(%rbp),%r15d
mov    -0x78(%rbp),%r14d
mov    -0x7c(%rbp),%ebx
mov    -0x80(%rbp),%r11d
mov    -0x84(%rbp),%r10d
mov    -0x88(%rbp),%eax
movsd  -0x90(%rbp),%xmm0
ff
mov    %r13d,(%rsp)
mov    %r12d,0x8(%rsp)
mov    %r15d,0x10(%rsp)
mov    %r14d,0x18(%rsp)
mov    %ebx,0x20(%rsp)
mov    %r11d,0x28(%rsp)
mov    %r10d,0x30(%rsp)
mov    %eax,0x38(%rsp)
call   1030 <tce_sortacc_6_scalar@plt>
add    $0xc8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<tce_sortacc_6_>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    0x90(%rsp),%rbp
mov    0x88(%rsp),%rbx
mov    0x80(%rsp),%rax
mov    0x78(%rsp),%r13
mov    0x70(%rsp),%r12
mov    0x68(%rsp),%r15
mov    0x60(%rsp),%r14
mov    0x58(%rsp),%r11
mov    0x50(%rsp),%r10
mov    (%rdx),%edx
mov    (%rcx),%ecx
mov    (%r8),%r8d
mov    (%r9),%r9d
mov    (%r10),%r10d
mov    (%r11),%r11d
mov    (%r14),%r14d
add    $0xffffffff,%r14d
mov    (%r15),%r15d
add    $0xffffffff,%r15d
mov    (%r12),%r12d
add    $0xffffffff,%r12d
mov    0x0(%r13),%r13d
add    $0xffffffff,%r13d
mov    (%rax),%eax
add    $0xffffffff,%eax
movslq (%rbx),%rbx
movsd  0x0(%rbp),%xmm0
mov    %edx,(%rsp)
mov    %ecx,0x4(%rsp)
mov    %r8d,0x8(%rsp)
mov    %r9d,0xc(%rsp)
mov    %r10d,0x10(%rsp)
mov    %r11d,0x14(%rsp)
mov    -0x4(%rsp,%rbx,4),%ebp
or     %r11d,%ebp
add    $0xffffffffffffffff,%rbx
test   $0x1,%bpl
jne    11e0 <tce_sortacc_6_+0xc0>
push   %rbx
push   %rax
push   %r13
push   %r12
push   %r15
push   %r14
push   %r11
push   %r10
call   1040 <tce_sortacc_6_simd@plt>
jmp    11f3 <tce_sortacc_6_+0xd3>
push   %rbx
push   %rax
push   %r13
push   %r12
push   %r15
push   %r14
push   %r11
push   %r10
call   1030 <tce_sortacc_6_scalar@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @tce_sortacc_6_(double* %0, double* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7, i32* %8, i32* %9, i32* %10, i32* %11, i32* %12, i32* %13, double* %14) {
%16 = alloca double*
%17 = alloca double*
%18 = alloca i32*
%19 = alloca i32*
%20 = alloca i32*
%21 = alloca i32*
%22 = alloca i32*
%23 = alloca i32*
%24 = alloca i32*
%25 = alloca i32*
%26 = alloca i32*
%27 = alloca i32*
%28 = alloca i32*
%29 = alloca i32*
%30 = alloca double*
%31 = alloca i32
%32 = alloca i32
%33 = alloca i32
%34 = alloca i32
%35 = alloca i32
%36 = alloca i32
%37 = alloca i32
%38 = alloca i32
%39 = alloca i32
%40 = alloca i32
%41 = alloca i32
%42 = alloca i32
%43 = alloca double
%44 = alloca [6 x i32]
store double* %0, double** %16
store double* %1, double** %17
store i32* %2, i32** %18
store i32* %3, i32** %19
store i32* %4, i32** %20
store i32* %5, i32** %21
store i32* %6, i32** %22
store i32* %7, i32** %23
store i32* %8, i32** %24
store i32* %9, i32** %25
store i32* %10, i32** %26
store i32* %11, i32** %27
store i32* %12, i32** %28
store i32* %13, i32** %29
store double* %14, double** %30
%45 = load i32*, i32** %18
%46 = load i32, i32* %45
store i32 %46, i32* %31
%47 = load i32*, i32** %19
%48 = load i32, i32* %47
store i32 %48, i32* %32
%49 = load i32*, i32** %20
%50 = load i32, i32* %49
store i32 %50, i32* %33
%51 = load i32*, i32** %21
%52 = load i32, i32* %51
store i32 %52, i32* %34
%53 = load i32*, i32** %22
%54 = load i32, i32* %53
store i32 %54, i32* %35
%55 = load i32*, i32** %23
%56 = load i32, i32* %55
store i32 %56, i32* %36
%57 = load i32*, i32** %24
%58 = load i32, i32* %57
%59 = sub nsw i32 %58, 1
store i32 %59, i32* %37
%60 = load i32*, i32** %25
%61 = load i32, i32* %60
%62 = sub nsw i32 %61, 1
store i32 %62, i32* %38
%63 = load i32*, i32** %26
%64 = load i32, i32* %63
%65 = sub nsw i32 %64, 1
store i32 %65, i32* %39
%66 = load i32*, i32** %27
%67 = load i32, i32* %66
%68 = sub nsw i32 %67, 1
store i32 %68, i32* %40
%69 = load i32*, i32** %28
%70 = load i32, i32* %69
%71 = sub nsw i32 %70, 1
store i32 %71, i32* %41
%72 = load i32*, i32** %29
%73 = load i32, i32* %72
%74 = sub nsw i32 %73, 1
store i32 %74, i32* %42
%75 = load double*, double** %30
%76 = load double, double* %75
store double %76, double* %43
%77 = load i32, i32* %31
%78 = getelementptr inbounds [6 x i32], [6 x i32]* %44, i64 0, i64 0
store i32 %77, i32* %78
%79 = load i32, i32* %32
%80 = getelementptr inbounds [6 x i32], [6 x i32]* %44, i64 0, i64 1
store i32 %79, i32* %80
%81 = load i32, i32* %33
%82 = getelementptr inbounds [6 x i32], [6 x i32]* %44, i64 0, i64 2
store i32 %81, i32* %82
%83 = load i32, i32* %34
%84 = getelementptr inbounds [6 x i32], [6 x i32]* %44, i64 0, i64 3
store i32 %83, i32* %84
%85 = load i32, i32* %35
%86 = getelementptr inbounds [6 x i32], [6 x i32]* %44, i64 0, i64 4
store i32 %85, i32* %86
%87 = load i32, i32* %36
%88 = getelementptr inbounds [6 x i32], [6 x i32]* %44, i64 0, i64 5
store i32 %87, i32* %88
%89 = load i32, i32* %42
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds [6 x i32], [6 x i32]* %44, i64 0, i64 %90
%92 = load i32, i32* %91
%93 = srem i32 %92, 2
%94 = icmp eq i32 %93, 0
br i1 %94, label %95, label %117
95: ; preds = %15
%96 = getelementptr inbounds [6 x i32], [6 x i32]* %44, i64 0, i64 5
%97 = load i32, i32* %96
%98 = srem i32 %97, 2
%99 = icmp eq i32 %98, 0
br i1 %99, label %100, label %117
100: ; preds = %95
%101 = load double*, double** %16
%102 = load double*, double** %17
%103 = load i32, i32* %31
%104 = load i32, i32* %32
%105 = load i32, i32* %33
%106 = load i32, i32* %34
%107 = load i32, i32* %35
%108 = load i32, i32* %36
%109 = load i32, i32* %37
%110 = load i32, i32* %38
%111 = load i32, i32* %39
%112 = load i32, i32* %40
%113 = load i32, i32* %41
%114 = load i32, i32* %42
%115 = load double, double* %43
%116 = call i32 @tce_sortacc_6_simd(double* %101, double* %102, i32 %103, i32 %104, i32 %105, i32 %106, i32 %107, i32 %108, i32 %109, i32 %110, i32 %111, i32 %112, i32 %113, i32 %114, double %115)
br label %134
117: ; preds = %95, %15
%118 = load double*, double** %16
%119 = load double*, double** %17
%120 = load i32, i32* %31
%121 = load i32, i32* %32
%122 = load i32, i32* %33
%123 = load i32, i32* %34
%124 = load i32, i32* %35
%125 = load i32, i32* %36
%126 = load i32, i32* %37
%127 = load i32, i32* %38
%128 = load i32, i32* %39
%129 = load i32, i32* %40
%130 = load i32, i32* %41
%131 = load i32, i32* %42
%132 = load double, double* %43
%133 = call i32 @tce_sortacc_6_scalar(double* %118, double* %119, i32 %120, i32 %121, i32 %122, i32 %123, i32 %124, i32 %125, i32 %126, i32 %127, i32 %128, i32 %129, i32 %130, i32 %131, double %132)
br label %134
134: ; preds = %117, %100
ret void
}

LLVM IR (-O2):
define void @tce_sortacc_6_(double* %0, double* %1, i32* nocapture %2, i32* nocapture %3, i32* nocapture %4, i32* nocapture %5, i32* nocapture %6, i32* nocapture %7, i32* nocapture %8, i32* nocapture %9, i32* nocapture %10, i32* nocapture %11, i32* nocapture %12, i32* nocapture %13, double* nocapture %14) {
%16 = alloca [6 x i32]
%17 = load i32, i32* %2
%18 = load i32, i32* %3
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = load i32, i32* %6
%22 = load i32, i32* %7
%23 = load i32, i32* %8
%24 = add nsw i32 %23, -1
%25 = load i32, i32* %9
%26 = add nsw i32 %25, -1
%27 = load i32, i32* %10
%28 = add nsw i32 %27, -1
%29 = load i32, i32* %11
%30 = add nsw i32 %29, -1
%31 = load i32, i32* %12
%32 = add nsw i32 %31, -1
%33 = load i32, i32* %13
%34 = add nsw i32 %33, -1
%35 = load double, double* %14
%36 = bitcast [6 x i32]* %16 to i8*
%37 = getelementptr inbounds [6 x i32], [6 x i32]* %16, i64 0, i64 0
store i32 %17, i32* %37
%38 = getelementptr inbounds [6 x i32], [6 x i32]* %16, i64 0, i64 1
store i32 %18, i32* %38
%39 = getelementptr inbounds [6 x i32], [6 x i32]* %16, i64 0, i64 2
store i32 %19, i32* %39
%40 = getelementptr inbounds [6 x i32], [6 x i32]* %16, i64 0, i64 3
store i32 %20, i32* %40
%41 = getelementptr inbounds [6 x i32], [6 x i32]* %16, i64 0, i64 4
store i32 %21, i32* %41
%42 = getelementptr inbounds [6 x i32], [6 x i32]* %16, i64 0, i64 5
store i32 %22, i32* %42
%43 = sext i32 %34 to i64
%44 = getelementptr inbounds [6 x i32], [6 x i32]* %16, i64 0, i64 %43
%45 = load i32, i32* %44
%46 = and i32 %45, 1
%47 = icmp eq i32 %46, 0
%48 = and i32 %22, 1
%49 = icmp eq i32 %48, 0
%50 = select i1 %47, i1 %49, i1 false
br i1 %50, label %51, label %53
51: ; preds = %15
%52 = tail call i32 @tce_sortacc_6_simd(double* %0, double* %1, i32 %17, i32 %18, i32 %19, i32 %20, i32 %21, i32 %22, i32 %24, i32 %26, i32 %28, i32 %30, i32 %32, i32 %34, double %35)
br label %55
53: ; preds = %15
%54 = tail call i32 @tce_sortacc_6_scalar(double* %0, double* %1, i32 %17, i32 %18, i32 %19, i32 %20, i32 %21, i32 %22, i32 %24, i32 %26, i32 %28, i32 %30, i32 %32, i32 %34, double %35)
br label %55
55: ; preds = %53, %51
ret void
}