#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*/ flap_2d(double **, double **, int const *);
int /*<<< orphan*/ symeigen(double *, double *, int);
void gklt_1d(double klt[(1 << (4))][(1 << (4))],
             double cov[((1 << (4)) * 2)][((1 << (4)) * 2)], const int *_f) {
  static double workA[((1 << (4)) * 2)][((1 << (4)) * 2)];
  static double workB[(1 << (4))][(1 << (4))];
  int i, j;
  for (i = 0; i < ((1 << (4)) * 2); i++)
    for (j = 0; j < ((1 << (4)) * 2); j++)
      workA[i][j] = cov[i][j];
  flap_2d(workB, workA, _f);
  symeigen(&klt[0][0], &workB[0][0], (1 << (4)));
}


x86 assembly (clang, -O0):
<gklt_1d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x20,-0x1c(%rbp)
jge    11aa <gklt_1d+0x8a>
movl   $0x0,-0x20(%rbp)
cmpl   $0x20,-0x20(%rbp)
jge    1197 <gklt_1d+0x77>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
shl    $0x8,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movslq -0x1c(%rbp),%rcx
lea    0x2ec7(%rip),%rax
shl    $0x8,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    114c <gklt_1d+0x2c>
jmp    119c <gklt_1d+0x7c>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113b <gklt_1d+0x1b>
mov    -0x18(%rbp),%rdx
lea    0x4e8b(%rip),%rdi
lea    0x2e84(%rip),%rsi
call   1040 <flap_2d@plt>
mov    -0x8(%rbp),%rdi
lea    0x4e74(%rip),%rsi
mov    $0x10,%edx
call   1030 <symeigen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gklt_1d>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0x18(%rsi),%rax
lea    0x2f26(%rip),%rcx
xor    %r9d,%r9d
lea    0x2f04(%rip),%r8
jmp    1245 <gklt_1d+0x125>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movups (%rsi,%rdi,1),%xmm0
movaps %xmm0,(%rdi,%r8,1)
movups 0x10(%rsi,%rdi,1),%xmm0
movaps %xmm0,0x10(%rdi,%r8,1)
movups 0x20(%rsi,%rdi,1),%xmm0
movaps %xmm0,0x20(%rdi,%r8,1)
movups 0x30(%rsi,%rdi,1),%xmm0
movaps %xmm0,0x30(%rdi,%r8,1)
movups 0x40(%rsi,%rdi,1),%xmm0
movaps %xmm0,0x40(%rdi,%r8,1)
movups 0x50(%rsi,%rdi,1),%xmm0
movaps %xmm0,0x50(%rdi,%r8,1)
movups 0x60(%rsi,%rdi,1),%xmm0
movaps %xmm0,0x60(%rdi,%r8,1)
movups 0x70(%rsi,%rdi,1),%xmm0
movaps %xmm0,0x70(%rdi,%r8,1)
movups 0x80(%rsi,%rdi,1),%xmm0
movaps %xmm0,0x80(%rdi,%r8,1)
movups 0x90(%rsi,%rdi,1),%xmm0
movaps %xmm0,0x90(%rdi,%r8,1)
movups 0xa0(%rsi,%rdi,1),%xmm0
movaps %xmm0,0xa0(%rdi,%r8,1)
movups 0xb0(%rsi,%rdi,1),%xmm0
movaps %xmm0,0xb0(%rdi,%r8,1)
movups 0xc0(%rsi,%rdi,1),%xmm0
movaps %xmm0,0xc0(%rdi,%r8,1)
movups 0xd0(%rsi,%rdi,1),%xmm0
movaps %xmm0,0xd0(%rdi,%r8,1)
movups 0xe0(%rsi,%rdi,1),%xmm0
movaps %xmm0,0xe0(%rdi,%r8,1)
movups 0xf0(%rsi,%rdi,1),%xmm0
movaps %xmm0,0xf0(%rdi,%r8,1)
add    $0x1,%r9
add    $0x100,%rax
add    $0x100,%rcx
cmp    $0x20,%r9
je     12bd <gklt_1d+0x19d>
mov    %r9,%rdi
shl    $0x8,%rdi
lea    (%rsi,%rdi,1),%r10
add    $0x100,%r10
lea    (%r8,%rdi,1),%rbx
cmp    %r10,%rbx
jae    1150 <gklt_1d+0x30>
lea    (%rsi,%rdi,1),%r10
lea    (%rdi,%r8,1),%rbx
add    $0x100,%rbx
cmp    %rbx,%r10
jae    1150 <gklt_1d+0x30>
xor    %edi,%edi
xchg   %ax,%ax
movsd  -0x18(%rax,%rdi,8),%xmm0
movsd  %xmm0,-0x18(%rcx,%rdi,8)
movsd  -0x10(%rax,%rdi,8),%xmm0
movsd  %xmm0,-0x10(%rcx,%rdi,8)
movsd  -0x8(%rax,%rdi,8),%xmm0
movsd  %xmm0,-0x8(%rcx,%rdi,8)
movsd  (%rax,%rdi,8),%xmm0
movsd  %xmm0,(%rcx,%rdi,8)
add    $0x4,%rdi
cmp    $0x20,%rdi
jne    1280 <gklt_1d+0x160>
jmp    122e <gklt_1d+0x10e>
lea    0x4d7c(%rip),%rbx
lea    0x2d75(%rip),%rsi
mov    %rbx,%rdi
call   1040 <flap_2d@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x10,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <symeigen@plt>

LLVM IR (-O0):
@gklt_1d.workA = internal global [32 x [32 x double]] zeroinitializer
@gklt_1d.workB = internal global [16 x [16 x double]] zeroinitializer
define void @gklt_1d([16 x double]* %0, [32 x double]* %1, i32* %2) {
%4 = alloca [16 x double]*
%5 = alloca [32 x double]*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store [16 x double]* %0, [16 x double]** %4
store [32 x double]* %1, [32 x double]** %5
store i32* %2, i32** %6
store i32 0, i32* %7
br label %9
9: ; preds = %35, %3
%10 = load i32, i32* %7
%11 = icmp slt i32 %10, 32
br i1 %11, label %12, label %38
12: ; preds = %9
store i32 0, i32* %8
br label %13
13: ; preds = %31, %12
%14 = load i32, i32* %8
%15 = icmp slt i32 %14, 32
br i1 %15, label %16, label %34
16: ; preds = %13
%17 = load [32 x double]*, [32 x double]** %5
%18 = load i32, i32* %7
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [32 x double], [32 x double]* %17, i64 %19
%21 = load i32, i32* %8
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [32 x double], [32 x double]* %20, i64 0, i64 %22
%24 = load double, double* %23
%25 = load i32, i32* %7
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [32 x [32 x double]], [32 x [32 x double]]* @gklt_1d.workA, i64 0, i64 %26
%28 = load i32, i32* %8
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [32 x double], [32 x double]* %27, i64 0, i64 %29
store double %24, double* %30
br label %31
31: ; preds = %16
%32 = load i32, i32* %8
%33 = add nsw i32 %32, 1
store i32 %33, i32* %8
br label %13
34: ; preds = %13
br label %35
35: ; preds = %34
%36 = load i32, i32* %7
%37 = add nsw i32 %36, 1
store i32 %37, i32* %7
br label %9
38: ; preds = %9
%39 = load i32*, i32** %6
%40 = call i32 @flap_2d(double** bitcast ([16 x [16 x double]]* @gklt_1d.workB to double**), double** bitcast ([32 x [32 x double]]* @gklt_1d.workA to double**), i32* %39)
%41 = load [16 x double]*, [16 x double]** %4
%42 = getelementptr inbounds [16 x double], [16 x double]* %41, i64 0
%43 = getelementptr inbounds [16 x double], [16 x double]* %42, i64 0, i64 0
%44 = call i32 @symeigen(double* %43, double* getelementptr inbounds ([16 x [16 x double]], [16 x [16 x double]]* @gklt_1d.workB, i64 0, i64 0, i64 0), i32 16)
ret void
}

LLVM IR (-O2):
@gklt_1d.workA = internal global [32 x [32 x double]] zeroinitializer
@gklt_1d.workB = internal global [16 x [16 x double]] zeroinitializer
define void @gklt_1d([16 x double]* %0, [32 x double]* nocapture %1, i32* %2) {
br label %4
4: ; preds = %3, %114
%5 = phi i64 [ 0, %3 ], [ %115, %114 ]
%6 = add nuw i64 %5, 1
%7 = getelementptr [32 x double], [32 x double]* %1, i64 %6, i64 0
%8 = getelementptr [32 x double], [32 x double]* %1, i64 %5, i64 0
%9 = getelementptr [32 x [32 x double]], [32 x [32 x double]]* @gklt_1d.workA, i64 0, i64 %6, i64 0
%10 = getelementptr [32 x [32 x double]], [32 x [32 x double]]* @gklt_1d.workA, i64 0, i64 %5, i64 0
%11 = icmp ult double* %10, %7
%12 = icmp ult double* %8, %9
%13 = and i1 %11, %12
br i1 %13, label %95, label %14
14: ; preds = %4
%15 = getelementptr inbounds [32 x double], [32 x double]* %1, i64 %5, i64 0
%16 = bitcast double* %15 to <2 x double>*
%17 = load <2 x double>, <2 x double>* %16
%18 = getelementptr inbounds [32 x [32 x double]], [32 x [32 x double]]* @gklt_1d.workA, i64 0, i64 %5, i64 0
%19 = bitcast double* %18 to <2 x double>*
store <2 x double> %17, <2 x double>* %19
%20 = getelementptr inbounds [32 x double], [32 x double]* %1, i64 %5, i64 2
%21 = bitcast double* %20 to <2 x double>*
%22 = load <2 x double>, <2 x double>* %21
%23 = getelementptr inbounds [32 x [32 x double]], [32 x [32 x double]]* @gklt_1d.workA, i64 0, i64 %5, i64 2
%24 = bitcast double* %23 to <2 x double>*
store <2 x double> %22, <2 x double>* %24
%25 = getelementptr inbounds [32 x double], [32 x double]* %1, i64 %5, i64 4
%26 = bitcast double* %25 to <2 x double>*
%27 = load <2 x double>, <2 x double>* %26
%28 = getelementptr inbounds [32 x [32 x double]], [32 x [32 x double]]* @gklt_1d.workA, i64 0, i64 %5, i64 4
%29 = bitcast double* %28 to <2 x double>*
store <2 x double> %27, <2 x double>* %29
%30 = getelementptr inbounds [32 x double], [32 x double]* %1, i64 %5, i64 6
%31 = bitcast double* %30 to <2 x double>*
%32 = load <2 x double>, <2 x double>* %31
%33 = getelementptr inbounds [32 x [32 x double]], [32 x [32 x double]]* @gklt_1d.workA, i64 0, i64 %5, i64 6
%34 = bitcast double* %33 to <2 x double>*
store <2 x double> %32, <2 x double>* %34
%35 = getelementptr inbounds [32 x double], [32 x double]* %1, i64 %5, i64 8
%36 = bitcast double* %35 to <2 x double>*
%37 = load <2 x double>, <2 x double>* %36
%38 = getelementptr inbounds [32 x [32 x double]], [32 x [32 x double]]* @gklt_1d.workA, i64 0, i64 %5, i64 8
%39 = bitcast double* %38 to <2 x double>*
store <2 x double> %37, <2 x double>* %39
%40 = getelementptr inbounds [32 x double], [32 x double]* %1, i64 %5, i64 10
%41 = bitcast double* %40 to <2 x double>*
%42 = load <2 x double>, <2 x double>* %41
%43 = getelementptr inbounds [32 x [32 x double]], [32 x [32 x double]]* @gklt_1d.workA, i64 0, i64 %5, i64 10
%44 = bitcast double* %43 to <2 x double>*
store <2 x double> %42, <2 x double>* %44
%45 = getelementptr inbounds [32 x double], [32 x double]* %1, i64 %5, i64 12
%46 = bitcast double* %45 to <2 x double>*
%47 = load <2 x double>, <2 x double>* %46
%48 = getelementptr inbounds [32 x [32 x double]], [32 x [32 x double]]* @gklt_1d.workA, i64 0, i64 %5, i64 12
%49 = bitcast double* %48 to <2 x double>*
store <2 x double> %47, <2 x double>* %49
%50 = getelementptr inbounds [32 x double], [32 x double]* %1, i64 %5, i64 14
%51 = bitcast double* %50 to <2 x double>*
%52 = load <2 x double>, <2 x double>* %51
%53 = getelementptr inbounds [32 x [32 x double]], [32 x [32 x double]]* @gklt_1d.workA, i64 0, i64 %5, i64 14
%54 = bitcast double* %53 to <2 x double>*
store <2 x double> %52, <2 x double>* %54
%55 = getelementptr inbounds [32 x double], [32 x double]* %1, i64 %5, i64 16
%56 = bitcast double* %55 to <2 x double>*
%57 = load <2 x double>, <2 x double>* %56
%58 = getelementptr inbounds [32 x [32 x double]], [32 x [32 x double]]* @gklt_1d.workA, i64 0, i64 %5, i64 16
%59 = bitcast double* %58 to <2 x double>*
store <2 x double> %57, <2 x double>* %59
%60 = getelementptr inbounds [32 x double], [32 x double]* %1, i64 %5, i64 18
%61 = bitcast double* %60 to <2 x double>*
%62 = load <2 x double>, <2 x double>* %61
%63 = getelementptr inbounds [32 x [32 x double]], [32 x [32 x double]]* @gklt_1d.workA, i64 0, i64 %5, i64 18
%64 = bitcast double* %63 to <2 x double>*
store <2 x double> %62, <2 x double>* %64
%65 = getelementptr inbounds [32 x double], [32 x double]* %1, i64 %5, i64 20
%66 = bitcast double* %65 to <2 x double>*
%67 = load <2 x double>, <2 x double>* %66
%68 = getelementptr inbounds [32 x [32 x double]], [32 x [32 x double]]* @gklt_1d.workA, i64 0, i64 %5, i64 20
%69 = bitcast double* %68 to <2 x double>*
store <2 x double> %67, <2 x double>* %69
%70 = getelementptr inbounds [32 x double], [32 x double]* %1, i64 %5, i64 22
%71 = bitcast double* %70 to <2 x double>*
%72 = load <2 x double>, <2 x double>* %71
%73 = getelementptr inbounds [32 x [32 x double]], [32 x [32 x double]]* @gklt_1d.workA, i64 0, i64 %5, i64 22
%74 = bitcast double* %73 to <2 x double>*
store <2 x double> %72, <2 x double>* %74
%75 = getelementptr inbounds [32 x double], [32 x double]* %1, i64 %5, i64 24
%76 = bitcast double* %75 to <2 x double>*
%77 = load <2 x double>, <2 x double>* %76
%78 = getelementptr inbounds [32 x [32 x double]], [32 x [32 x double]]* @gklt_1d.workA, i64 0, i64 %5, i64 24
%79 = bitcast double* %78 to <2 x double>*
store <2 x double> %77, <2 x double>* %79
%80 = getelementptr inbounds [32 x double], [32 x double]* %1, i64 %5, i64 26
%81 = bitcast double* %80 to <2 x double>*
%82 = load <2 x double>, <2 x double>* %81
%83 = getelementptr inbounds [32 x [32 x double]], [32 x [32 x double]]* @gklt_1d.workA, i64 0, i64 %5, i64 26
%84 = bitcast double* %83 to <2 x double>*
store <2 x double> %82, <2 x double>* %84
%85 = getelementptr inbounds [32 x double], [32 x double]* %1, i64 %5, i64 28
%86 = bitcast double* %85 to <2 x double>*
%87 = load <2 x double>, <2 x double>* %86
%88 = getelementptr inbounds [32 x [32 x double]], [32 x [32 x double]]* @gklt_1d.workA, i64 0, i64 %5, i64 28
%89 = bitcast double* %88 to <2 x double>*
store <2 x double> %87, <2 x double>* %89
%90 = getelementptr inbounds [32 x double], [32 x double]* %1, i64 %5, i64 30
%91 = bitcast double* %90 to <2 x double>*
%92 = load <2 x double>, <2 x double>* %91
%93 = getelementptr inbounds [32 x [32 x double]], [32 x [32 x double]]* @gklt_1d.workA, i64 0, i64 %5, i64 30
%94 = bitcast double* %93 to <2 x double>*
store <2 x double> %92, <2 x double>* %94
br label %114
95: ; preds = %4, %95
%96 = phi i64 [ %112, %95 ], [ 0, %4 ]
%97 = getelementptr inbounds [32 x double], [32 x double]* %1, i64 %5, i64 %96
%98 = load double, double* %97
%99 = getelementptr inbounds [32 x [32 x double]], [32 x [32 x double]]* @gklt_1d.workA, i64 0, i64 %5, i64 %96
store double %98, double* %99
%100 = or i64 %96, 1
%101 = getelementptr inbounds [32 x double], [32 x double]* %1, i64 %5, i64 %100
%102 = load double, double* %101
%103 = getelementptr inbounds [32 x [32 x double]], [32 x [32 x double]]* @gklt_1d.workA, i64 0, i64 %5, i64 %100
store double %102, double* %103
%104 = or i64 %96, 2
%105 = getelementptr inbounds [32 x double], [32 x double]* %1, i64 %5, i64 %104
%106 = load double, double* %105
%107 = getelementptr inbounds [32 x [32 x double]], [32 x [32 x double]]* @gklt_1d.workA, i64 0, i64 %5, i64 %104
store double %106, double* %107
%108 = or i64 %96, 3
%109 = getelementptr inbounds [32 x double], [32 x double]* %1, i64 %5, i64 %108
%110 = load double, double* %109
%111 = getelementptr inbounds [32 x [32 x double]], [32 x [32 x double]]* @gklt_1d.workA, i64 0, i64 %5, i64 %108
store double %110, double* %111
%112 = add nuw nsw i64 %96, 4
%113 = icmp eq i64 %112, 32
br i1 %113, label %114, label %95
114: ; preds = %95, %14
%115 = add nuw nsw i64 %5, 1
%116 = icmp eq i64 %115, 32
br i1 %116, label %117, label %4
117: ; preds = %114
%118 = tail call i32 @flap_2d(double** bitcast ([16 x [16 x double]]* @gklt_1d.workB to double**), double** bitcast ([32 x [32 x double]]* @gklt_1d.workA to double**), i32* %2)
%119 = getelementptr inbounds [16 x double], [16 x double]* %0, i64 0, i64 0
%120 = tail call i32 @symeigen(double* %119, double* getelementptr inbounds ([16 x [16 x double]], [16 x [16 x double]]* @gklt_1d.workB, i64 0, i64 0, i64 0), i32 16)
ret void
}