#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 readEigenspaceFromFile(char *, double **, int *, int *);
int loadEigenspace(char *eigenspaceFile, double **eigenspace, int *klimit,
                   int *dimensionality) {
  int kcount = 0;
  int tmpKlim = 0;
  int tmpDims = 0;
  double *tempEigenspace;
  kcount = readEigenspaceFromFile(eigenspaceFile, &tempEigenspace, &tmpKlim,
                                  &tmpDims);
  *klimit = tmpKlim;
  *dimensionality = tmpDims;
  *eigenspace = tempEigenspace;
  return kcount;
}


x86 assembly (clang, -O0):
<loadEigenspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x38(%rbp),%rsi
lea    -0x28(%rbp),%rdx
lea    -0x2c(%rbp),%rcx
call   1030 <readEigenspaceFromFile@plt>
mov    %eax,-0x24(%rbp)
mov    -0x28(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x2c(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x38(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x24(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loadEigenspace>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %rsi,%r15
movl   $0x0,0x4(%rsp)
movl   $0x0,(%rsp)
lea    0x8(%rsp),%rsi
lea    0x4(%rsp),%rdx
mov    %rsp,%rcx
call   1030 <readEigenspaceFromFile@plt>
mov    0x4(%rsp),%ecx
mov    %ecx,(%rbx)
mov    (%rsp),%ecx
mov    %ecx,(%r14)
mov    0x8(%rsp),%rcx
mov    %rcx,(%r15)
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @loadEigenspace(i8* %0, double** %1, i32* %2, i32* %3) {
%5 = alloca i8*
%6 = alloca double**
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
store i8* %0, i8** %5
store double** %1, double*** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
store i32 0, i32* %9
store i32 0, i32* %10
store i32 0, i32* %11
%13 = load i8*, i8** %5
%14 = call i32 @readEigenspaceFromFile(i8* %13, double** %12, i32* %10, i32* %11)
store i32 %14, i32* %9
%15 = load i32, i32* %10
%16 = load i32*, i32** %7
store i32 %15, i32* %16
%17 = load i32, i32* %11
%18 = load i32*, i32** %8
store i32 %17, i32* %18
%19 = load double*, double** %12
%20 = load double**, double*** %6
store double* %19, double** %20
%21 = load i32, i32* %9
ret i32 %21
}

LLVM IR (-O2):
define i32 @loadEigenspace(i8* %0, double** nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca double*
%8 = bitcast i32* %5 to i8*
store i32 0, i32* %5
%9 = bitcast i32* %6 to i8*
store i32 0, i32* %6
%10 = bitcast double** %7 to i8*
%11 = call i32 @readEigenspaceFromFile(i8* %0, double** %7, i32* %5, i32* %6)
%12 = load i32, i32* %5
store i32 %12, i32* %2
%13 = load i32, i32* %6
store i32 %13, i32* %3
%14 = load double*, double** %7
store double* %14, double** %1
ret i32 %11
}