#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 */
double *calloc(int, int);
int /*<<< orphan*/ dfeast_syev(char *, int *, double *, int *, int *, double *,
                               int *, double *, double *, int *, double *,
                               double *, int *, double *, int *);
int /*<<< orphan*/ feastinit(int *);
int /*<<< orphan*/ free(double *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int N = 2, LDA = 2;
  char UPLO = 'F';
  double A[4] = {2.0, -1.0, -1.0, 2.0};
  double Emin = -5.0, Emax = 5.0;
  int M0 = 2;
  int feastparam[64];
  double *E, *res, *X;
  double epsout, trace;
  int i, loop, info, M;
  E = calloc(M0, sizeof(double));
  res = calloc(M0, sizeof(double));
  X = calloc(N * M0, sizeof(double));
  feastinit(feastparam);
  feastparam[0] = 1;
  dfeast_syev(&UPLO, &N, A, &LDA, feastparam, &epsout, &loop, &Emin, &Emax, &M0,
              E, X, &M, res, &info);
  printf("FEAST OUTPUT INFO %d\n", info);
  if (info == 0) {
    printf("*************************************************\n");
    printf("************** REPORT ***************************\n");
    printf("*************************************************\n");
    printf("# Search interval [Emin,Emax] %.15e %.15e\n", Emin, Emax);
    printf("# mode found/subspace %d %d \n", M, M0);
    printf("# iterations %d \n", loop);
    trace = 0.0;
    for (i = 0; i <= M - 1; i = i + 1) {
      trace = trace + *(E + i);
    }
    printf("TRACE %.15e\n", trace);
    printf("Relative error on the Trace %.15e\n", epsout);
    printf("Eigenvalues/Residuals\n");
    for (i = 0; i <= M - 1; i = i + 1) {
      printf("   %d %.15e %.15e\n", i, *(E + i), *(res + i));
    }
    printf("Eigenvectors\n");
    for (i = 0; i <= M - 1; i = i + 1) {
      printf("   %d (%.15e, %.15e)\n", i, *(X + i * M), *(X + 1 + i * M));
    }
  }
  free(E);
  free(res);
  free(X);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1e8,%rsp
movl   $0x0,-0x2c(%rbp)
movl   $0x2,-0x30(%rbp)
movl   $0x2,-0x34(%rbp)
movb   $0x46,-0x35(%rbp)
mov    0xe8c(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xe89(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0xe86(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xe83(%rip),%rax
mov    %rax,-0x48(%rbp)
movsd  0xe57(%rip),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xe42(%rip),%xmm0
movsd  %xmm0,-0x70(%rbp)
movl   $0x2,-0x74(%rbp)
mov    -0x74(%rbp),%edi
mov    $0x8,%esi
call   1070 <calloc@plt>
mov    %rax,-0x188(%rbp)
mov    -0x74(%rbp),%edi
mov    $0x8,%esi
call   1070 <calloc@plt>
mov    %rax,-0x190(%rbp)
mov    -0x30(%rbp),%edi
imul   -0x74(%rbp),%edi
mov    $0x8,%esi
call   1070 <calloc@plt>
mov    %rax,-0x198(%rbp)
lea    -0x180(%rbp),%rdi
call   1060 <feastinit@plt>
movl   $0x1,-0x180(%rbp)
lea    -0x60(%rbp),%rdx
lea    -0x180(%rbp),%r8
mov    -0x188(%rbp),%r14
mov    -0x198(%rbp),%rbx
mov    -0x190(%rbp),%r10
lea    -0x35(%rbp),%rdi
lea    -0x30(%rbp),%rsi
lea    -0x34(%rbp),%rcx
lea    -0x1a0(%rbp),%r9
lea    -0x1b0(%rbp),%rax
mov    %rax,-0x1c8(%rbp)
lea    -0x68(%rbp),%r13
lea    -0x70(%rbp),%r12
lea    -0x74(%rbp),%r15
lea    -0x1b8(%rbp),%r11
lea    -0x1b4(%rbp),%rax
mov    %rax,-0x1c0(%rbp)
mov    -0x1c8(%rbp),%rax
mov    %rax,(%rsp)
mov    -0x1c0(%rbp),%rax
mov    %r13,0x8(%rsp)
mov    %r12,0x10(%rsp)
mov    %r15,0x18(%rsp)
mov    %r14,0x20(%rsp)
mov    %rbx,0x28(%rsp)
mov    %r11,0x30(%rsp)
mov    %r10,0x38(%rsp)
mov    %rax,0x40(%rsp)
call   1040 <dfeast_syev@plt>
mov    -0x1b4(%rbp),%esi
lea    0xd62(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
cmpl   $0x0,-0x1b4(%rbp)
jne    14f0 <main+0x3a0>
lea    0xd5d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xd82(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xd41(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movsd  -0x68(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm1
lea    0xd8f(%rip),%rdi
mov    $0x2,%al
call   1050 <printf@plt>
mov    -0x1b8(%rbp),%esi
mov    -0x74(%rbp),%edx
lea    0xda3(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x1b0(%rbp),%esi
lea    0xdad(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x1a8(%rbp)
ff
movl   $0x0,-0x1ac(%rbp)
mov    -0x1ac(%rbp),%eax
mov    -0x1b8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     13b2 <main+0x262>
movsd  -0x1a8(%rbp),%xmm0
ff
mov    -0x188(%rbp),%rax
movslq -0x1ac(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x1a8(%rbp)
ff
mov    -0x1ac(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1ac(%rbp)
jmp    1364 <main+0x214>
movsd  -0x1a8(%rbp),%xmm0
ff
lea    0xd46(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  -0x1a0(%rbp),%xmm0
ff
lea    0xd3d(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xd52(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x1ac(%rbp)
mov    -0x1ac(%rbp),%eax
mov    -0x1b8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     145b <main+0x30b>
mov    -0x1ac(%rbp),%esi
mov    -0x188(%rbp),%rax
movslq -0x1ac(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x190(%rbp),%rax
movslq -0x1ac(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
lea    0xd0e(%rip),%rdi
mov    $0x2,%al
call   1050 <printf@plt>
mov    -0x1ac(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1ac(%rbp)
jmp    13f6 <main+0x2a6>
lea    0xcff(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x1ac(%rbp)
mov    -0x1ac(%rbp),%eax
mov    -0x1b8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     14eb <main+0x39b>
mov    -0x1ac(%rbp),%esi
mov    -0x198(%rbp),%rax
mov    -0x1ac(%rbp),%ecx
imul   -0x1b8(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x198(%rbp),%rax
mov    -0x1ac(%rbp),%ecx
imul   -0x1b8(%rbp),%ecx
movslq %ecx,%rcx
movsd  0x8(%rax,%rcx,8),%xmm1
lea    0xc9f(%rip),%rdi
mov    $0x2,%al
call   1050 <printf@plt>
mov    -0x1ac(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1ac(%rbp)
jmp    1473 <main+0x323>
jmp    14f0 <main+0x3a0>
mov    -0x188(%rbp),%rdi
call   1030 <free@plt>
mov    -0x190(%rbp),%rdi
call   1030 <free@plt>
mov    -0x198(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x1e8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x168,%rsp
movl   $0x2,0x24(%rsp)
movl   $0x2,0x20(%rsp)
movb   $0x46,0xf(%rsp)
movaps 0xe83(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xe67(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movabs $0xc014000000000000,%rax
mov    %rax,0x30(%rsp)
movabs $0x4014000000000000,%rax
mov    %rax,0x28(%rsp)
movl   $0x2,0x18(%rsp)
mov    $0x2,%edi
mov    $0x8,%esi
call   1080 <calloc@plt>
mov    %rax,%rbx
mov    $0x2,%edi
mov    $0x8,%esi
call   1080 <calloc@plt>
mov    %rax,%r14
mov    $0x4,%edi
mov    $0x8,%esi
call   1080 <calloc@plt>
mov    %rax,%r15
lea    0x60(%rsp),%rbp
mov    %rbp,%rdi
call   1070 <feastinit@plt>
movl   $0x1,0x60(%rsp)
sub    $0x8,%rsp
lea    0x1c(%rsp),%rax
lea    0x18(%rsp),%r10
lea    0x20(%rsp),%r11
lea    0x30(%rsp),%r12
lea    0x38(%rsp),%r13
lea    0x17(%rsp),%rdi
lea    0x2c(%rsp),%rsi
lea    0x48(%rsp),%rdx
lea    0x28(%rsp),%rcx
lea    0x40(%rsp),%r9
mov    %rbp,%r8
push   %rax
push   %r14
push   %r10
push   %r15
push   %rbx
push   %r11
push   %r12
push   %r13
lea    0x64(%rsp),%rax
push   %rax
call   1050 <dfeast_syev@plt>
add    $0x50,%rsp
mov    0x14(%rsp),%esi
lea    0xdb0(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
cmpl   $0x0,0x14(%rsp)
jne    1439 <main+0x2d9>
lea    0xe93(%rip),%rbp
mov    %rbp,%rdi
call   1040 <puts@plt>
lea    0xe52(%rip),%rdi
call   1040 <puts@plt>
mov    %rbp,%rdi
call   1040 <puts@plt>
movsd  0x30(%rsp),%xmm0
movsd  0x28(%rsp),%xmm1
lea    0xd7e(%rip),%rdi
mov    $0x2,%al
call   1060 <printf@plt>
mov    0x10(%rsp),%esi
mov    0x18(%rsp),%edx
lea    0xd93(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x1c(%rsp),%esi
lea    0xd9f(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x10(%rsp),%ecx
test   %ecx,%ecx
jle    1306 <main+0x1a6>
lea    -0x1(%rcx),%rdx
mov    %ecx,%eax
and    $0x7,%eax
cmp    $0x7,%rdx
jae    130c <main+0x1ac>
xorpd  %xmm0,%xmm0
xor    %edx,%edx
jmp    1358 <main+0x1f8>
xorpd  %xmm0,%xmm0
jmp    137e <main+0x21e>
and    $0xfffffff8,%ecx
xorpd  %xmm0,%xmm0
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nop
addsd  (%rbx,%rdx,8),%xmm0
addsd  0x8(%rbx,%rdx,8),%xmm0
addsd  0x10(%rbx,%rdx,8),%xmm0
addsd  0x18(%rbx,%rdx,8),%xmm0
addsd  0x20(%rbx,%rdx,8),%xmm0
addsd  0x28(%rbx,%rdx,8),%xmm0
addsd  0x30(%rbx,%rdx,8),%xmm0
addsd  0x38(%rbx,%rdx,8),%xmm0
add    $0x8,%rdx
cmp    %rdx,%rcx
jne    1320 <main+0x1c0>
test   %rax,%rax
je     137e <main+0x21e>
lea    (%rbx,%rdx,8),%rcx
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
addsd  (%rcx,%rdx,8),%xmm0
add    $0x1,%rdx
cmp    %rdx,%rax
jne    1370 <main+0x210>
lea    0xd0c(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x38(%rsp),%xmm0
lea    0xd05(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
lea    0xda7(%rip),%rdi
call   1040 <puts@plt>
cmpl   $0x0,0x10(%rsp)
jle    13e5 <main+0x285>
xor    %ebp,%ebp
lea    0xd05(%rip),%r12
nopl   0x0(%rax)
movsd  (%rbx,%rbp,8),%xmm0
movsd  (%r14,%rbp,8),%xmm1
mov    %r12,%rdi
mov    %ebp,%esi
mov    $0x2,%al
call   1060 <printf@plt>
add    $0x1,%rbp
movslq 0x10(%rsp),%rax
cmp    %rax,%rbp
jl     13c0 <main+0x260>
lea    0xd78(%rip),%rdi
call   1040 <puts@plt>
mov    0x10(%rsp),%eax
test   %eax,%eax
jle    1439 <main+0x2d9>
xor    %ebp,%ebp
lea    0xcd2(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
imul   %ebp,%eax
cltq
movsd  (%r15,%rax,8),%xmm0
movsd  0x8(%r15,%rax,8),%xmm1
mov    %r12,%rdi
mov    %ebp,%esi
mov    $0x2,%al
call   1060 <printf@plt>
add    $0x1,%ebp
mov    0x10(%rsp),%eax
cmp    %eax,%ebp
jl     1410 <main+0x2b0>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x168,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.A = [4 x double] [double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 2.000000e+00]
@.str = [22 x i8] c"FEAST OUTPUT INFO %d\0A\00"
@.str.1 = [51 x i8] c"*************************************************\0A\00"
@.str.2 = [51 x i8] c"************** REPORT ***************************\0A\00"
@.str.3 = [43 x i8] c"# Search interval [Emin,Emax] %.15e %.15e\0A\00"
@.str.4 = [30 x i8] c"# mode found/subspace %d %d \0A\00"
@.str.5 = [18 x i8] c"# iterations %d \0A\00"
@.str.6 = [13 x i8] c"TRACE %.15e\0A\00"
@.str.7 = [35 x i8] c"Relative error on the Trace %.15e\0A\00"
@.str.8 = [23 x i8] c"Eigenvalues/Residuals\0A\00"
@.str.9 = [19 x i8] c" %d %.15e %.15e\0A\00"
@.str.10 = [14 x i8] c"Eigenvectors\0A\00"
@.str.11 = [22 x i8] c" %d (%.15e, %.15e)\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
%5 = alloca [4 x double]
%6 = alloca double
%7 = alloca double
%8 = alloca i32
%9 = alloca [64 x i32]
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca double
%14 = alloca double
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
store i32 2, i32* %3
store i8 70, i8* %4
%19 = bitcast [4 x double]* %5 to i8*
store double -5.000000e+00, double* %6
store double 5.000000e+00, double* %7
store i32 2, i32* %8
%20 = load i32, i32* %8
%21 = call double* @calloc(i32 %20, i32 8)
store double* %21, double** %10
%22 = load i32, i32* %8
%23 = call double* @calloc(i32 %22, i32 8)
store double* %23, double** %11
%24 = load i32, i32* %2
%25 = load i32, i32* %8
%26 = mul nsw i32 %24, %25
%27 = call double* @calloc(i32 %26, i32 8)
store double* %27, double** %12
%28 = getelementptr inbounds [64 x i32], [64 x i32]* %9, i64 0, i64 0
%29 = call i32 @feastinit(i32* %28)
%30 = getelementptr inbounds [64 x i32], [64 x i32]* %9, i64 0, i64 0
store i32 1, i32* %30
%31 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 0
%32 = getelementptr inbounds [64 x i32], [64 x i32]* %9, i64 0, i64 0
%33 = load double*, double** %10
%34 = load double*, double** %12
%35 = load double*, double** %11
%36 = call i32 @dfeast_syev(i8* %4, i32* %2, double* %31, i32* %3, i32* %32, double* %13, i32* %16, double* %6, double* %7, i32* %8, double* %33, double* %34, i32* %18, double* %35, i32* %17)
%37 = load i32, i32* %17
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %37)
%39 = load i32, i32* %17
%40 = icmp eq i32 %39, 0
br i1 %40, label %41, label %125
41: ; preds = %0
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0))
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
%45 = load double, double* %6
%46 = load double, double* %7
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0), double %45, double %46)
%48 = load i32, i32* %18
%49 = load i32, i32* %8
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i32 %48, i32 %49)
%51 = load i32, i32* %16
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32 %51)
store double 0.000000e+00, double* %14
store i32 0, i32* %15
br label %53
53: ; preds = %66, %41
%54 = load i32, i32* %15
%55 = load i32, i32* %18
%56 = sub nsw i32 %55, 1
%57 = icmp sle i32 %54, %56
br i1 %57, label %58, label %69
58: ; preds = %53
%59 = load double, double* %14
%60 = load double*, double** %10
%61 = load i32, i32* %15
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds double, double* %60, i64 %62
%64 = load double, double* %63
%65 = fadd double %59, %64
store double %65, double* %14
br label %66
66: ; preds = %58
%67 = load i32, i32* %15
%68 = add nsw i32 %67, 1
store i32 %68, i32* %15
br label %53
69: ; preds = %53
%70 = load double, double* %14
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), double %70)
%72 = load double, double* %13
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.7, i64 0, i64 0), double %72)
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0))
store i32 0, i32* %15
br label %75
75: ; preds = %93, %69
%76 = load i32, i32* %15
%77 = load i32, i32* %18
%78 = sub nsw i32 %77, 1
%79 = icmp sle i32 %76, %78
br i1 %79, label %80, label %96
80: ; preds = %75
%81 = load i32, i32* %15
%82 = load double*, double** %10
%83 = load i32, i32* %15
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds double, double* %82, i64 %84
%86 = load double, double* %85
%87 = load double*, double** %11
%88 = load i32, i32* %15
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds double, double* %87, i64 %89
%91 = load double, double* %90
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), i32 %81, double %86, double %91)
br label %93
93: ; preds = %80
%94 = load i32, i32* %15
%95 = add nsw i32 %94, 1
store i32 %95, i32* %15
br label %75
96: ; preds = %75
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0))
store i32 0, i32* %15
br label %98
98: ; preds = %121, %96
%99 = load i32, i32* %15
%100 = load i32, i32* %18
%101 = sub nsw i32 %100, 1
%102 = icmp sle i32 %99, %101
br i1 %102, label %103, label %124
103: ; preds = %98
%104 = load i32, i32* %15
%105 = load double*, double** %12
%106 = load i32, i32* %15
%107 = load i32, i32* %18
%108 = mul nsw i32 %106, %107
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds double, double* %105, i64 %109
%111 = load double, double* %110
%112 = load double*, double** %12
%113 = getelementptr inbounds double, double* %112, i64 1
%114 = load i32, i32* %15
%115 = load i32, i32* %18
%116 = mul nsw i32 %114, %115
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds double, double* %113, i64 %117
%119 = load double, double* %118
%120 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.11, i64 0, i64 0), i32 %104, double %111, double %119)
br label %121
121: ; preds = %103
%122 = load i32, i32* %15
%123 = add nsw i32 %122, 1
store i32 %123, i32* %15
br label %98
124: ; preds = %98
br label %125
125: ; preds = %124, %0
%126 = load double*, double** %10
%127 = call i32 @free(double* %126)
%128 = load double*, double** %11
%129 = call i32 @free(double* %128)
%130 = load double*, double** %12
%131 = call i32 @free(double* %130)
ret i32 0
}

LLVM IR (-O2):
@__const.main.A = [4 x double] [double 2.000000e+00, double -1.000000e+00, double -1.000000e+00, double 2.000000e+00]
@.str = [22 x i8] c"FEAST OUTPUT INFO %d\0A\00"
@.str.3 = [43 x i8] c"# Search interval [Emin,Emax] %.15e %.15e\0A\00"
@.str.4 = [30 x i8] c"# mode found/subspace %d %d \0A\00"
@.str.5 = [18 x i8] c"# iterations %d \0A\00"
@.str.6 = [13 x i8] c"TRACE %.15e\0A\00"
@.str.7 = [35 x i8] c"Relative error on the Trace %.15e\0A\00"
@.str.9 = [19 x i8] c" %d %.15e %.15e\0A\00"
@.str.11 = [22 x i8] c" %d (%.15e, %.15e)\0A\00"
@str.12 = [50 x i8] c"************** REPORT ***************************\00"
@str.13 = [50 x i8] c"*************************************************\00"
@str.14 = [22 x i8] c"Eigenvalues/Residuals\00"
@str.15 = [13 x i8] c"Eigenvectors\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
%4 = alloca [4 x double]
%5 = alloca double
%6 = alloca double
%7 = alloca i32
%8 = alloca [64 x i32]
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = bitcast i32* %1 to i8*
store i32 2, i32* %1
%14 = bitcast i32* %2 to i8*
store i32 2, i32* %2
store i8 70, i8* %3
%15 = bitcast [4 x double]* %4 to i8*
%16 = bitcast double* %5 to i8*
store double -5.000000e+00, double* %5
%17 = bitcast double* %6 to i8*
store double 5.000000e+00, double* %6
%18 = bitcast i32* %7 to i8*
store i32 2, i32* %7
%19 = bitcast [64 x i32]* %8 to i8*
%20 = bitcast double* %9 to i8*
%21 = bitcast i32* %10 to i8*
%22 = bitcast i32* %11 to i8*
%23 = bitcast i32* %12 to i8*
%24 = tail call double* @calloc(i32 2, i32 8)
%25 = tail call double* @calloc(i32 2, i32 8)
%26 = tail call double* @calloc(i32 4, i32 8)
%27 = getelementptr inbounds [64 x i32], [64 x i32]* %8, i64 0, i64 0
%28 = call i32 @feastinit(i32* %27)
store i32 1, i32* %27
%29 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%30 = call i32 @dfeast_syev(i8* %3, i32* %1, double* %29, i32* %2, i32* %27, double* %9, i32* %10, double* %5, double* %6, i32* %7, double* %24, double* %26, i32* %12, double* %25, i32* %11)
%31 = load i32, i32* %11
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %31)
%33 = load i32, i32* %11
%34 = icmp eq i32 %33, 0
br i1 %34, label %35, label %148
35: ; preds = %0
%36 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.13, i64 0, i64 0))
%37 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.12, i64 0, i64 0))
%38 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.13, i64 0, i64 0))
%39 = load double, double* %5
%40 = load double, double* %6
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0), double %39, double %40)
%42 = load i32, i32* %12
%43 = load i32, i32* %7
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i32 %42, i32 %43)
%45 = load i32, i32* %10
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32 %45)
%47 = load i32, i32* %12
%48 = icmp sgt i32 %47, 0
br i1 %48, label %49, label %109
49: ; preds = %35
%50 = zext i32 %47 to i64
%51 = add nsw i64 %50, -1
%52 = and i64 %50, 7
%53 = icmp ult i64 %51, 7
br i1 %53, label %94, label %54
54: ; preds = %49
%55 = and i64 %50, 4294967288
br label %56
56: ; preds = %56, %54
%57 = phi i64 [ 0, %54 ], [ %91, %56 ]
%58 = phi double [ 0.000000e+00, %54 ], [ %90, %56 ]
%59 = phi i64 [ 0, %54 ], [ %92, %56 ]
%60 = getelementptr inbounds double, double* %24, i64 %57
%61 = load double, double* %60
%62 = fadd double %58, %61
%63 = or i64 %57, 1
%64 = getelementptr inbounds double, double* %24, i64 %63
%65 = load double, double* %64
%66 = fadd double %62, %65
%67 = or i64 %57, 2
%68 = getelementptr inbounds double, double* %24, i64 %67
%69 = load double, double* %68
%70 = fadd double %66, %69
%71 = or i64 %57, 3
%72 = getelementptr inbounds double, double* %24, i64 %71
%73 = load double, double* %72
%74 = fadd double %70, %73
%75 = or i64 %57, 4
%76 = getelementptr inbounds double, double* %24, i64 %75
%77 = load double, double* %76
%78 = fadd double %74, %77
%79 = or i64 %57, 5
%80 = getelementptr inbounds double, double* %24, i64 %79
%81 = load double, double* %80
%82 = fadd double %78, %81
%83 = or i64 %57, 6
%84 = getelementptr inbounds double, double* %24, i64 %83
%85 = load double, double* %84
%86 = fadd double %82, %85
%87 = or i64 %57, 7
%88 = getelementptr inbounds double, double* %24, i64 %87
%89 = load double, double* %88
%90 = fadd double %86, %89
%91 = add nuw nsw i64 %57, 8
%92 = add i64 %59, 8
%93 = icmp eq i64 %92, %55
br i1 %93, label %94, label %56
94: ; preds = %56, %49
%95 = phi double [ undef, %49 ], [ %90, %56 ]
%96 = phi i64 [ 0, %49 ], [ %91, %56 ]
%97 = phi double [ 0.000000e+00, %49 ], [ %90, %56 ]
%98 = icmp eq i64 %52, 0
br i1 %98, label %109, label %99
99: ; preds = %94, %99
%100 = phi i64 [ %106, %99 ], [ %96, %94 ]
%101 = phi double [ %105, %99 ], [ %97, %94 ]
%102 = phi i64 [ %107, %99 ], [ 0, %94 ]
%103 = getelementptr inbounds double, double* %24, i64 %100
%104 = load double, double* %103
%105 = fadd double %101, %104
%106 = add nuw nsw i64 %100, 1
%107 = add i64 %102, 1
%108 = icmp eq i64 %107, %52
br i1 %108, label %109, label %99
109: ; preds = %94, %99, %35
%110 = phi double [ 0.000000e+00, %35 ], [ %95, %94 ], [ %105, %99 ]
%111 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), double %110)
%112 = load double, double* %9
%113 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.7, i64 0, i64 0), double %112)
%114 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.14, i64 0, i64 0))
%115 = load i32, i32* %12
%116 = icmp sgt i32 %115, 0
br i1 %116, label %117, label %129
117: ; preds = %109, %117
%118 = phi i64 [ %125, %117 ], [ 0, %109 ]
%119 = getelementptr inbounds double, double* %24, i64 %118
%120 = load double, double* %119
%121 = getelementptr inbounds double, double* %25, i64 %118
%122 = load double, double* %121
%123 = trunc i64 %118 to i32
%124 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), i32 %123, double %120, double %122)
%125 = add nuw nsw i64 %118, 1
%126 = load i32, i32* %12
%127 = sext i32 %126 to i64
%128 = icmp slt i64 %125, %127
br i1 %128, label %117, label %129
129: ; preds = %117, %109
%130 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.15, i64 0, i64 0))
%131 = load i32, i32* %12
%132 = icmp sgt i32 %131, 0
br i1 %132, label %133, label %148
133: ; preds = %129
%134 = getelementptr inbounds double, double* %26, i64 1
br label %135
135: ; preds = %133, %135
%136 = phi i32 [ %131, %133 ], [ %146, %135 ]
%137 = phi i32 [ 0, %133 ], [ %145, %135 ]
%138 = mul nsw i32 %136, %137
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds double, double* %26, i64 %139
%141 = load double, double* %140
%142 = getelementptr inbounds double, double* %134, i64 %139
%143 = load double, double* %142
%144 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.11, i64 0, i64 0), i32 %137, double %141, double %143)
%145 = add nuw nsw i32 %137, 1
%146 = load i32, i32* %12
%147 = icmp slt i32 %145, %146
br i1 %147, label %135, label %148
148: ; preds = %135, %129, %0
%149 = call i32 @free(double* %24)
%150 = call i32 @free(double* %25)
%151 = call i32 @free(double* %26)
ret i32 0
}