#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 */
struct timeval {
  double tv_sec;
  double tv_usec;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
float *calloc(int, int);
int /*<<< orphan*/ cfeast_heev(char *, int *, float *, int *, int *, float *,
                               int *, float *, float *, int *, float *, float *,
                               int *, float *, int *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feastinit(int *);
int /*<<< orphan*/ *fopen(char *, char *);
int fscanf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int feastparam[64];
  float epsout;
  int loop;
  char UPLO = 'F';
  FILE *fp;
  char name[] = "../../system2";
  int N, nnz;
  float *A;
  struct timeval t1, t2;
  int i, j, k, n2, err;
  int M0, M, info;
  float Emin, Emax, trace;
  float *X;
  float *E, *res;
  fp = fopen(name, "r");
  err = fscanf(fp, "%d%d\n", &N, &nnz);
  n2 = 2 * N * N;
  A = calloc(n2, sizeof(float));
  for (i = 0; i <= n2 - 1; i++) {
    *(A + i) = (float)0.0;
  };
  for (k = 0; k <= nnz - 1; k++) {
    err = fscanf(fp, "%d %d", &i, &j);
    err = fscanf(fp, "%f%f\n", A + (j - 1) * 2 * N + 2 * i - 2,
                 A + (j - 1) * 2 * N + 2 * i - 1);
  };
  fclose(fp);
  printf("dense matrix -system2- size %.d\n", N);
  gettimeofday(&t1, NULL);
  Emin = (float)-0.35;
  Emax = (float)0.23;
  M0 = 40;
  E = calloc(M0, sizeof(float));
  res = calloc(M0, sizeof(float));
  X = calloc(2 * N * M0, sizeof(float));
  feastinit(feastparam);
  feastparam[0] = 1;
  cfeast_heev(&UPLO, &N, A, &N, feastparam, &epsout, &loop, &Emin, &Emax, &M0,
              E, X, &M, res, &info);
  gettimeofday(&t2, NULL);
  printf("FEAST OUTPUT INFO %d\n", info);
  if (info == 0) {
    printf("*************************************************\n");
    printf("************** REPORT ***************************\n");
    printf("*************************************************\n");
    printf("SIMULATION TIME %f\n", (t2.tv_sec - t1.tv_sec) * 1.0 +
                                       (t2.tv_usec - t1.tv_usec) * 0.000001);
    printf("# Search interval [Emin,Emax] %f %f\n", Emin, Emax);
    printf("# mode found/subspace %d %d \n", M, M0);
    printf("# iterations %d \n", loop);
    trace = (float)0.0;
    for (i = 0; i <= M - 1; i = i + 1) {
      trace = trace + *(E + i);
    }
    printf("TRACE %f\n", trace);
    printf("Relative error on the Trace %f\n", epsout);
    printf("Eigenvalues/Residuals\n");
    for (i = 0; i <= M - 1; i = i + 1) {
      printf("   %d %f %f\n", i, *(E + i), *(res + i));
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1f8,%rsp
movl   $0x0,-0x2c(%rbp)
movb   $0x46,-0x139(%rbp)
mov    0xe67(%rip),%rax
mov    %rax,-0x156(%rbp)
mov    0xe62(%rip),%eax
mov    %eax,-0x14e(%rbp)
mov    0xe59(%rip),%ax
mov    %ax,-0x14a(%rbp)
lea    -0x156(%rbp),%rdi
lea    0xe46(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x148(%rbp)
mov    -0x148(%rbp),%rdi
lea    0xe2e(%rip),%rsi
lea    -0x15c(%rbp),%rdx
lea    -0x160(%rbp),%rcx
mov    $0x0,%al
call   1070 <fscanf@plt>
mov    %eax,-0x19c(%rbp)
mov    -0x15c(%rbp),%eax
shl    $0x1,%eax
imul   -0x15c(%rbp),%eax
mov    %eax,-0x198(%rbp)
mov    -0x198(%rbp),%edi
mov    $0x4,%esi
call   1080 <calloc@plt>
mov    %rax,-0x168(%rbp)
movl   $0x0,-0x18c(%rbp)
mov    -0x18c(%rbp),%eax
mov    -0x198(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1285 <main+0x105>
mov    -0x168(%rbp),%rax
movslq -0x18c(%rbp),%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x18c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18c(%rbp)
jmp    1244 <main+0xc4>
movl   $0x0,-0x194(%rbp)
mov    -0x194(%rbp),%eax
mov    -0x160(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1370 <main+0x1f0>
mov    -0x148(%rbp),%rdi
lea    0xd72(%rip),%rsi
lea    -0x18c(%rbp),%rdx
lea    -0x190(%rbp),%rcx
mov    $0x0,%al
call   1070 <fscanf@plt>
mov    %eax,-0x19c(%rbp)
mov    -0x148(%rbp),%rdi
mov    -0x168(%rbp),%rdx
mov    -0x190(%rbp),%eax
sub    $0x1,%eax
shl    $0x1,%eax
imul   -0x15c(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rdx
mov    -0x18c(%rbp),%eax
shl    $0x1,%eax
cltq
shl    $0x2,%rax
add    %rax,%rdx
add    $0xfffffffffffffff8,%rdx
mov    -0x168(%rbp),%rcx
mov    -0x190(%rbp),%eax
sub    $0x1,%eax
shl    $0x1,%eax
imul   -0x15c(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rcx
mov    -0x18c(%rbp),%eax
shl    $0x1,%eax
cltq
shl    $0x2,%rax
add    %rax,%rcx
add    $0xfffffffffffffffc,%rcx
lea    0xcdd(%rip),%rsi
mov    $0x0,%al
call   1070 <fscanf@plt>
mov    %eax,-0x19c(%rbp)
mov    -0x194(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x194(%rbp)
jmp    128f <main+0x10f>
mov    -0x148(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x15c(%rbp),%esi
lea    0xca9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x178(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1060 <gettimeofday@plt>
movss  0xc5c(%rip),%xmm0
movss  %xmm0,-0x1ac(%rbp)
ff
movss  0xc48(%rip),%xmm0
movss  %xmm0,-0x1b0(%rbp)
ff
movl   $0x28,-0x1a0(%rbp)
mov    -0x1a0(%rbp),%edi
mov    $0x4,%esi
call   1080 <calloc@plt>
mov    %rax,-0x1c8(%rbp)
mov    -0x1a0(%rbp),%edi
mov    $0x4,%esi
call   1080 <calloc@plt>
mov    %rax,-0x1d0(%rbp)
mov    -0x15c(%rbp),%edi
shl    $0x1,%edi
imul   -0x1a0(%rbp),%edi
mov    $0x4,%esi
call   1080 <calloc@plt>
mov    %rax,-0x1c0(%rbp)
lea    -0x130(%rbp),%rdi
call   1050 <feastinit@plt>
movl   $0x1,-0x130(%rbp)
mov    -0x168(%rbp),%rdx
lea    -0x130(%rbp),%r8
mov    -0x1c8(%rbp),%r14
mov    -0x1c0(%rbp),%rbx
mov    -0x1d0(%rbp),%r10
lea    -0x139(%rbp),%rdi
lea    -0x15c(%rbp),%rcx
lea    -0x134(%rbp),%r9
lea    -0x138(%rbp),%rax
lea    -0x1ac(%rbp),%r13
lea    -0x1b0(%rbp),%r12
lea    -0x1a0(%rbp),%r15
lea    -0x1a4(%rbp),%r11
lea    -0x1a8(%rbp),%rsi
mov    %rsi,-0x1d8(%rbp)
mov    %rcx,%rsi
mov    %rax,(%rsp)
mov    -0x1d8(%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   10a0 <cfeast_heev@plt>
lea    -0x188(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1060 <gettimeofday@plt>
mov    -0x1a8(%rbp),%esi
lea    0xb63(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x0,-0x1a8(%rbp)
jne    16e1 <main+0x561>
lea    0xb5e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xb83(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xb42(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsd  -0x188(%rbp),%xmm0
ff
subsd  -0x178(%rbp),%xmm0
ff
movsd  -0x180(%rbp),%xmm1
ff
subsd  -0x170(%rbp),%xmm1
ff
movsd  0xab2(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
lea    0xb6a(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  -0x1ac(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
movss  -0x1b0(%rbp),%xmm1
ff
cvtss2sd %xmm1,%xmm1
lea    0xb58(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
mov    -0x1a4(%rbp),%esi
mov    -0x1a0(%rbp),%edx
lea    0xb63(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x138(%rbp),%esi
lea    0xb6d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x1b4(%rbp)
ff
movl   $0x0,-0x18c(%rbp)
mov    -0x18c(%rbp),%eax
mov    -0x1a4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1623 <main+0x4a3>
movss  -0x1b4(%rbp),%xmm0
ff
mov    -0x1c8(%rbp),%rax
movslq -0x18c(%rbp),%rcx
addss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x1b4(%rbp)
ff
mov    -0x18c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18c(%rbp)
jmp    15d5 <main+0x455>
movss  -0x1b4(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
lea    0xb02(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  -0x134(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
lea    0xaf2(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xb04(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x18c(%rbp)
mov    -0x18c(%rbp),%eax
mov    -0x1a4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     16dc <main+0x55c>
mov    -0x18c(%rbp),%esi
mov    -0x1c8(%rbp),%rax
movslq -0x18c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x1d0(%rbp),%rax
movslq -0x18c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xab8(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
mov    -0x18c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18c(%rbp)
jmp    166f <main+0x4ef>
jmp    16e1 <main+0x561>
xor    %eax,%eax
add    $0x1f8,%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
movb   $0x46,0x3(%rsp)
movabs $0x326d6574737973,%rax
mov    %rax,0x36(%rsp)
movabs $0x79732f2e2e2f2e2e,%rax
2f 73 79
mov    %rax,0x30(%rsp)
lea    0xe3b(%rip),%rsi
lea    0x30(%rsp),%rdi
call   10b0 <fopen@plt>
mov    %rax,%rbx
lea    0xe29(%rip),%rsi
xor    %r14d,%r14d
lea    0x8(%rsp),%rdx
lea    0x20(%rsp),%rcx
mov    %rax,%rdi
xor    %eax,%eax
call   1090 <fscanf@plt>
mov    0x8(%rsp),%ebp
imul   %ebp,%ebp
add    %ebp,%ebp
mov    %ebp,%edi
mov    $0x4,%esi
call   10a0 <calloc@plt>
mov    %rax,%r15
test   %ebp,%ebp
jle    1235 <main+0x95>
mov    %ebp,%edx
shl    $0x2,%rdx
mov    %r15,%rdi
xor    %esi,%esi
call   1080 <memset@plt>
mov    %ebp,%r14d
mov    %r14d,0x4(%rsp)
cmpl   $0x0,0x20(%rsp)
mov    %r15,%r14
jle    12bc <main+0x11c>
lea    0x4(%rsp),%r15
lea    0x24(%rsp),%r13
lea    0xdcf(%rip),%rbp
xor    %r12d,%r12d
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
lea    0xdb4(%rip),%rsi
mov    %r15,%rdx
mov    %r13,%rcx
xor    %eax,%eax
call   1090 <fscanf@plt>
mov    0x24(%rsp),%eax
add    %eax,%eax
add    $0xfffffffe,%eax
movslq 0x8(%rsp),%rcx
cltq
imul   %rcx,%rax
lea    (%r14,%rax,4),%rax
movslq 0x4(%rsp),%rcx
lea    (%rax,%rcx,8),%rdx
add    $0xfffffffffffffff8,%rdx
lea    (%rax,%rcx,8),%rcx
add    $0xfffffffffffffffc,%rcx
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1090 <fscanf@plt>
add    $0x1,%r12d
cmp    0x20(%rsp),%r12d
jl     1260 <main+0xc0>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    0x8(%rsp),%esi
lea    0xd5b(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x50(%rsp),%rdi
xor    %esi,%esi
call   1070 <gettimeofday@plt>
movl   $0xbeb33333,0x14(%rsp)
be
movl   $0x3e6b851f,0x10(%rsp)
3e
movl   $0x28,0x1c(%rsp)
mov    $0x28,%edi
mov    $0x4,%esi
call   10a0 <calloc@plt>
mov    %rax,%r15
mov    $0x28,%edi
mov    $0x4,%esi
call   10a0 <calloc@plt>
mov    %rax,%r13
mov    0x8(%rsp),%eax
shl    $0x4,%eax
lea    (%rax,%rax,4),%edi
mov    $0x4,%esi
call   10a0 <calloc@plt>
mov    %rax,%rbx
lea    0x60(%rsp),%rbp
mov    %rbp,%rdi
call   1060 <feastinit@plt>
movl   $0x1,0x60(%rsp)
sub    $0x8,%rsp
lea    0x20(%rsp),%rax
lea    0x14(%rsp),%r10
lea    0x24(%rsp),%r11
lea    0x18(%rsp),%r12
lea    0xb(%rsp),%rdi
lea    0x10(%rsp),%rcx
lea    0x34(%rsp),%r9
mov    %rcx,%rsi
mov    %r14,%rdx
mov    %rbp,%r8
push   %rax
push   %r13
push   %r10
push   %rbx
push   %r15
push   %r11
push   %r12
lea    0x54(%rsp),%rax
push   %rax
lea    0x70(%rsp),%rax
push   %rax
call   10c0 <cfeast_heev@plt>
add    $0x50,%rsp
lea    0x40(%rsp),%rdi
xor    %esi,%esi
call   1070 <gettimeofday@plt>
mov    0x18(%rsp),%esi
lea    0xc99(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmpl   $0x0,0x18(%rsp)
jne    1573 <main+0x3d3>
lea    0xd68(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xd27(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
movapd 0x40(%rsp),%xmm1
subpd  0x50(%rsp),%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
mulsd  0xbfd(%rip),%xmm0
addsd  %xmm1,%xmm0
lea    0xc53(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0x14(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x10(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xc45(%rip),%rdi
mov    $0x2,%al
call   1050 <printf@plt>
mov    0xc(%rsp),%esi
mov    0x1c(%rsp),%edx
lea    0xc54(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x28(%rsp),%esi
lea    0xc60(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    147d <main+0x2dd>
lea    -0x1(%rax),%rdx
mov    %eax,%ecx
and    $0x7,%ecx
cmp    $0x7,%rdx
jae    1484 <main+0x2e4>
xorps  %xmm0,%xmm0
xor    %edx,%edx
jmp    14d0 <main+0x330>
xorps  %xmm0,%xmm0
xor    %eax,%eax
jmp    14f2 <main+0x352>
mov    %eax,%esi
and    $0xfffffff8,%esi
xorps  %xmm0,%xmm0
xor    %edx,%edx
xchg   %ax,%ax
addss  (%r15,%rdx,4),%xmm0
addss  0x4(%r15,%rdx,4),%xmm0
addss  0x8(%r15,%rdx,4),%xmm0
addss  0xc(%r15,%rdx,4),%xmm0
addss  0x10(%r15,%rdx,4),%xmm0
addss  0x14(%r15,%rdx,4),%xmm0
addss  0x18(%r15,%rdx,4),%xmm0
addss  0x1c(%r15,%rdx,4),%xmm0
add    $0x8,%rdx
cmp    %rdx,%rsi
jne    1490 <main+0x2f0>
test   %rcx,%rcx
je     14ee <main+0x34e>
lea    (%r15,%rdx,4),%rdx
xor    %esi,%esi
nopl   0x0(%rax,%rax,1)
addss  (%rdx,%rsi,4),%xmm0
add    $0x1,%rsi
cmp    %rsi,%rcx
jne    14e0 <main+0x340>
cvtss2sd %xmm0,%xmm0
mov    %eax,0x4(%rsp)
lea    0xbcd(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0x2c(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xbbf(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xc42(%rip),%rdi
call   1030 <puts@plt>
movl   $0x0,0x4(%rsp)
cmpl   $0x0,0xc(%rsp)
jle    1573 <main+0x3d3>
xor    %eax,%eax
lea    0xbb4(%rip),%rbx
movslq %eax,%rsi
movss  (%r15,%rsi,4),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0x0(%r13,%rsi,4),%xmm1
cvtss2sd %xmm1,%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <printf@plt>
mov    0x4(%rsp),%eax
add    $0x1,%eax
mov    %eax,0x4(%rsp)
cmp    0xc(%rsp),%eax
jl     1540 <main+0x3a0>
xor    %eax,%eax
add    $0x168,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
@__const.main.name = [14 x i8] c"../../system2\00"
@.str = [2 x i8] c"r\00"
@.str.1 = [6 x i8] c"%d%d\0A\00"
@.str.2 = [6 x i8] c"%d %d\00"
@.str.3 = [6 x i8] c"%f%f\0A\00"
@.str.4 = [33 x i8] c"dense matrix -system2- size %.d\0A\00"
@.str.5 = [22 x i8] c"FEAST OUTPUT INFO %d\0A\00"
@.str.6 = [51 x i8] c"*************************************************\0A\00"
@.str.7 = [51 x i8] c"************** REPORT ***************************\0A\00"
@.str.8 = [20 x i8] c"SIMULATION TIME %f\0A\00"
@.str.9 = [37 x i8] c"# Search interval [Emin,Emax] %f %f\0A\00"
@.str.10 = [30 x i8] c"# mode found/subspace %d %d \0A\00"
@.str.11 = [18 x i8] c"# iterations %d \0A\00"
@.str.12 = [10 x i8] c"TRACE %f\0A\00"
@.str.13 = [32 x i8] c"Relative error on the Trace %f\0A\00"
@.str.14 = [23 x i8] c"Eigenvalues/Residuals\0A\00"
@.str.15 = [13 x i8] c" %d %f %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [64 x i32]
%3 = alloca float
%4 = alloca i32
%5 = alloca i8
%6 = alloca i32*
%7 = alloca [14 x i8]
%8 = alloca i32
%9 = alloca i32
%10 = alloca float*
%11 = alloca %struct.timeval
%12 = alloca %struct.timeval
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca float
%22 = alloca float
%23 = alloca float
%24 = alloca float*
%25 = alloca float*
%26 = alloca float*
store i32 0, i32* %1
store i8 70, i8* %5
%27 = bitcast [14 x i8]* %7 to i8*
%28 = getelementptr inbounds [14 x i8], [14 x i8]* %7, i64 0, i64 0
%29 = call i32* @fopen(i8* %28, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %29, i32** %6
%30 = load i32*, i32** %6
%31 = call i32 (i32*, i8*, ...) @fscanf(i32* %30, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %8, i32* %9)
store i32 %31, i32* %17
%32 = load i32, i32* %8
%33 = mul nsw i32 2, %32
%34 = load i32, i32* %8
%35 = mul nsw i32 %33, %34
store i32 %35, i32* %16
%36 = load i32, i32* %16
%37 = call float* @calloc(i32 %36, i32 4)
store float* %37, float** %10
store i32 0, i32* %13
br label %38
38: ; preds = %48, %0
%39 = load i32, i32* %13
%40 = load i32, i32* %16
%41 = sub nsw i32 %40, 1
%42 = icmp sle i32 %39, %41
br i1 %42, label %43, label %51
43: ; preds = %38
%44 = load float*, float** %10
%45 = load i32, i32* %13
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds float, float* %44, i64 %46
store float 0.000000e+00, float* %47
br label %48
48: ; preds = %43
%49 = load i32, i32* %13
%50 = add nsw i32 %49, 1
store i32 %50, i32* %13
br label %38
51: ; preds = %38
store i32 0, i32* %15
br label %52
52: ; preds = %88, %51
%53 = load i32, i32* %15
%54 = load i32, i32* %9
%55 = sub nsw i32 %54, 1
%56 = icmp sle i32 %53, %55
br i1 %56, label %57, label %91
57: ; preds = %52
%58 = load i32*, i32** %6
%59 = call i32 (i32*, i8*, ...) @fscanf(i32* %58, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32* %13, i32* %14)
store i32 %59, i32* %17
%60 = load i32*, i32** %6
%61 = load float*, float** %10
%62 = load i32, i32* %14
%63 = sub nsw i32 %62, 1
%64 = mul nsw i32 %63, 2
%65 = load i32, i32* %8
%66 = mul nsw i32 %64, %65
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds float, float* %61, i64 %67
%69 = load i32, i32* %13
%70 = mul nsw i32 2, %69
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds float, float* %68, i64 %71
%73 = getelementptr inbounds float, float* %72, i64 -2
%74 = load float*, float** %10
%75 = load i32, i32* %14
%76 = sub nsw i32 %75, 1
%77 = mul nsw i32 %76, 2
%78 = load i32, i32* %8
%79 = mul nsw i32 %77, %78
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds float, float* %74, i64 %80
%82 = load i32, i32* %13
%83 = mul nsw i32 2, %82
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds float, float* %81, i64 %84
%86 = getelementptr inbounds float, float* %85, i64 -1
%87 = call i32 (i32*, i8*, ...) @fscanf(i32* %60, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), float* %73, float* %86)
store i32 %87, i32* %17
br label %88
88: ; preds = %57
%89 = load i32, i32* %15
%90 = add nsw i32 %89, 1
store i32 %90, i32* %15
br label %52
91: ; preds = %52
%92 = load i32*, i32** %6
%93 = call i32 @fclose(i32* %92)
%94 = load i32, i32* %8
%95 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0), i32 %94)
%96 = call i32 @gettimeofday(%struct.timeval* %11, i32* null)
store float 0xBFD6666660000000, float* %21
store float 0x3FCD70A3E0000000, float* %22
store i32 40, i32* %18
%97 = load i32, i32* %18
%98 = call float* @calloc(i32 %97, i32 4)
store float* %98, float** %25
%99 = load i32, i32* %18
%100 = call float* @calloc(i32 %99, i32 4)
store float* %100, float** %26
%101 = load i32, i32* %8
%102 = mul nsw i32 2, %101
%103 = load i32, i32* %18
%104 = mul nsw i32 %102, %103
%105 = call float* @calloc(i32 %104, i32 4)
store float* %105, float** %24
%106 = getelementptr inbounds [64 x i32], [64 x i32]* %2, i64 0, i64 0
%107 = call i32 @feastinit(i32* %106)
%108 = getelementptr inbounds [64 x i32], [64 x i32]* %2, i64 0, i64 0
store i32 1, i32* %108
%109 = load float*, float** %10
%110 = getelementptr inbounds [64 x i32], [64 x i32]* %2, i64 0, i64 0
%111 = load float*, float** %25
%112 = load float*, float** %24
%113 = load float*, float** %26
%114 = call i32 @cfeast_heev(i8* %5, i32* %8, float* %109, i32* %8, i32* %110, float* %3, i32* %4, float* %21, float* %22, i32* %18, float* %111, float* %112, i32* %19, float* %113, i32* %20)
%115 = call i32 @gettimeofday(%struct.timeval* %12, i32* null)
%116 = load i32, i32* %20
%117 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i32 %116)
%118 = load i32, i32* %20
%119 = icmp eq i32 %118, 0
br i1 %119, label %120, label %195
120: ; preds = %91
%121 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.6, i64 0, i64 0))
%122 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.7, i64 0, i64 0))
%123 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.6, i64 0, i64 0))
%124 = getelementptr inbounds %struct.timeval, %struct.timeval* %12, i32 0, i32 0
%125 = load double, double* %124
%126 = getelementptr inbounds %struct.timeval, %struct.timeval* %11, i32 0, i32 0
%127 = load double, double* %126
%128 = fsub double %125, %127
%129 = getelementptr inbounds %struct.timeval, %struct.timeval* %12, i32 0, i32 1
%130 = load double, double* %129
%131 = getelementptr inbounds %struct.timeval, %struct.timeval* %11, i32 0, i32 1
%132 = load double, double* %131
%133 = fsub double %130, %132
%134 = fmul double %133, 0x3EB0C6F7A0B5ED8D
%135 = call double @llvm.fmuladd.f64(double %128, double 1.000000e+00, double %134)
%136 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0), double %135)
%137 = load float, float* %21
%138 = fpext float %137 to double
%139 = load float, float* %22
%140 = fpext float %139 to double
%141 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.9, i64 0, i64 0), double %138, double %140)
%142 = load i32, i32* %19
%143 = load i32, i32* %18
%144 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.10, i64 0, i64 0), i32 %142, i32 %143)
%145 = load i32, i32* %4
%146 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0), i32 %145)
store float 0.000000e+00, float* %23
store i32 0, i32* %13
br label %147
147: ; preds = %160, %120
%148 = load i32, i32* %13
%149 = load i32, i32* %19
%150 = sub nsw i32 %149, 1
%151 = icmp sle i32 %148, %150
br i1 %151, label %152, label %163
152: ; preds = %147
%153 = load float, float* %23
%154 = load float*, float** %25
%155 = load i32, i32* %13
%156 = sext i32 %155 to i64
%157 = getelementptr inbounds float, float* %154, i64 %156
%158 = load float, float* %157
%159 = fadd float %153, %158
store float %159, float* %23
br label %160
160: ; preds = %152
%161 = load i32, i32* %13
%162 = add nsw i32 %161, 1
store i32 %162, i32* %13
br label %147
163: ; preds = %147
%164 = load float, float* %23
%165 = fpext float %164 to double
%166 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), double %165)
%167 = load float, float* %3
%168 = fpext float %167 to double
%169 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.13, i64 0, i64 0), double %168)
%170 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.14, i64 0, i64 0))
store i32 0, i32* %13
br label %171
171: ; preds = %191, %163
%172 = load i32, i32* %13
%173 = load i32, i32* %19
%174 = sub nsw i32 %173, 1
%175 = icmp sle i32 %172, %174
br i1 %175, label %176, label %194
176: ; preds = %171
%177 = load i32, i32* %13
%178 = load float*, float** %25
%179 = load i32, i32* %13
%180 = sext i32 %179 to i64
%181 = getelementptr inbounds float, float* %178, i64 %180
%182 = load float, float* %181
%183 = fpext float %182 to double
%184 = load float*, float** %26
%185 = load i32, i32* %13
%186 = sext i32 %185 to i64
%187 = getelementptr inbounds float, float* %184, i64 %186
%188 = load float, float* %187
%189 = fpext float %188 to double
%190 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.15, i64 0, i64 0), i32 %177, double %183, double %189)
br label %191
191: ; preds = %176
%192 = load i32, i32* %13
%193 = add nsw i32 %192, 1
store i32 %193, i32* %13
br label %171
194: ; preds = %171
br label %195
195: ; preds = %194, %91
ret i32 0
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
@__const.main.name = [14 x i8] c"../../system2\00"
@.str = [2 x i8] c"r\00"
@.str.1 = [6 x i8] c"%d%d\0A\00"
@.str.2 = [6 x i8] c"%d %d\00"
@.str.3 = [6 x i8] c"%f%f\0A\00"
@.str.4 = [33 x i8] c"dense matrix -system2- size %.d\0A\00"
@.str.5 = [22 x i8] c"FEAST OUTPUT INFO %d\0A\00"
@.str.8 = [20 x i8] c"SIMULATION TIME %f\0A\00"
@.str.9 = [37 x i8] c"# Search interval [Emin,Emax] %f %f\0A\00"
@.str.10 = [30 x i8] c"# mode found/subspace %d %d \0A\00"
@.str.11 = [18 x i8] c"# iterations %d \0A\00"
@.str.12 = [10 x i8] c"TRACE %f\0A\00"
@.str.13 = [32 x i8] c"Relative error on the Trace %f\0A\00"
@.str.15 = [13 x i8] c" %d %f %f\0A\00"
@str.16 = [50 x i8] c"************** REPORT ***************************\00"
@str.17 = [50 x i8] c"*************************************************\00"
@str.18 = [22 x i8] c"Eigenvalues/Residuals\00"
define i32 @main() {
%1 = alloca [64 x i32]
%2 = alloca float
%3 = alloca i32
%4 = alloca i8
%5 = alloca [14 x i8]
%6 = alloca i32
%7 = alloca i32
%8 = alloca <2 x double>
%9 = bitcast <2 x double>* %8 to %struct.timeval*
%10 = alloca <2 x double>
%11 = bitcast <2 x double>* %10 to %struct.timeval*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca float
%18 = alloca float
%19 = bitcast [64 x i32]* %1 to i8*
%20 = bitcast float* %2 to i8*
%21 = bitcast i32* %3 to i8*
store i8 70, i8* %4
%22 = getelementptr inbounds [14 x i8], [14 x i8]* %5, i64 0, i64 0
%23 = bitcast i32* %6 to i8*
%24 = bitcast i32* %7 to i8*
%25 = bitcast <2 x double>* %8 to i8*
%26 = bitcast <2 x double>* %10 to i8*
%27 = bitcast i32* %12 to i8*
%28 = bitcast i32* %13 to i8*
%29 = bitcast i32* %14 to i8*
%30 = bitcast i32* %15 to i8*
%31 = bitcast i32* %16 to i8*
%32 = bitcast float* %17 to i8*
%33 = bitcast float* %18 to i8*
%34 = call i32* @fopen(i8* %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%35 = call i32 (i32*, i8*, ...) @fscanf(i32* %34, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %6, i32* %7)
%36 = load i32, i32* %6
%37 = shl nsw i32 %36, 1
%38 = mul nsw i32 %37, %36
%39 = call float* @calloc(i32 %38, i32 4)
%40 = icmp sgt i32 %38, 0
br i1 %40, label %41, label %45
41: ; preds = %0
%42 = bitcast float* %39 to i8*
%43 = zext i32 %38 to i64
%44 = shl nuw nsw i64 %43, 2
br label %45
45: ; preds = %41, %0
%46 = phi i32 [ 0, %0 ], [ %38, %41 ]
store i32 %46, i32* %12
%47 = load i32, i32* %7
%48 = icmp sgt i32 %47, 0
br i1 %48, label %49, label %69
49: ; preds = %45, %49
%50 = phi i32 [ %66, %49 ], [ 0, %45 ]
%51 = call i32 (i32*, i8*, ...) @fscanf(i32* %34, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32* %12, i32* %13)
%52 = load i32, i32* %13
%53 = shl i32 %52, 1
%54 = add i32 %53, -2
%55 = load i32, i32* %6
%56 = mul nsw i32 %54, %55
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds float, float* %39, i64 %57
%59 = load i32, i32* %12
%60 = shl nsw i32 %59, 1
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds float, float* %58, i64 %61
%63 = getelementptr inbounds float, float* %62, i64 -2
%64 = getelementptr inbounds float, float* %62, i64 -1
%65 = call i32 (i32*, i8*, ...) @fscanf(i32* %34, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), float* %63, float* %64)
%66 = add nuw nsw i32 %50, 1
%67 = load i32, i32* %7
%68 = icmp slt i32 %66, %67
br i1 %68, label %49, label %69
69: ; preds = %49, %45
%70 = call i32 @fclose(i32* %34)
%71 = load i32, i32* %6
%72 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0), i32 %71)
%73 = call i32 @gettimeofday(%struct.timeval* %9, i32* null)
store float 0xBFD6666660000000, float* %17
store float 0x3FCD70A3E0000000, float* %18
store i32 40, i32* %14
%74 = call float* @calloc(i32 40, i32 4)
%75 = call float* @calloc(i32 40, i32 4)
%76 = load i32, i32* %6
%77 = mul nsw i32 %76, 80
%78 = call float* @calloc(i32 %77, i32 4)
%79 = getelementptr inbounds [64 x i32], [64 x i32]* %1, i64 0, i64 0
%80 = call i32 @feastinit(i32* %79)
store i32 1, i32* %79
%81 = call i32 @cfeast_heev(i8* %4, i32* %6, float* %39, i32* %6, i32* %79, float* %2, i32* %3, float* %17, float* %18, i32* %14, float* %74, float* %78, i32* %15, float* %75, i32* %16)
%82 = call i32 @gettimeofday(%struct.timeval* %11, i32* null)
%83 = load i32, i32* %16
%84 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i32 %83)
%85 = load i32, i32* %16
%86 = icmp eq i32 %85, 0
br i1 %86, label %87, label %198
87: ; preds = %69
%88 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.17, i64 0, i64 0))
%89 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.16, i64 0, i64 0))
%90 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.17, i64 0, i64 0))
%91 = load <2 x double>, <2 x double>* %10
%92 = load <2 x double>, <2 x double>* %8
%93 = fsub <2 x double> %91, %92
%94 = extractelement <2 x double> %93, i64 1
%95 = fmul double %94, 0x3EB0C6F7A0B5ED8D
%96 = extractelement <2 x double> %93, i64 0
%97 = fadd double %96, %95
%98 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0), double %97)
%99 = load float, float* %17
%100 = fpext float %99 to double
%101 = load float, float* %18
%102 = fpext float %101 to double
%103 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.9, i64 0, i64 0), double %100, double %102)
%104 = load i32, i32* %15
%105 = load i32, i32* %14
%106 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.10, i64 0, i64 0), i32 %104, i32 %105)
%107 = load i32, i32* %3
%108 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0), i32 %107)
%109 = load i32, i32* %15
%110 = icmp sgt i32 %109, 0
br i1 %110, label %111, label %174
111: ; preds = %87
%112 = zext i32 %109 to i64
%113 = add nsw i64 %112, -1
%114 = and i64 %112, 7
%115 = icmp ult i64 %113, 7
br i1 %115, label %156, label %116
116: ; preds = %111
%117 = and i64 %112, 4294967288
br label %118
118: ; preds = %118, %116
%119 = phi i64 [ 0, %116 ], [ %153, %118 ]
%120 = phi float [ 0.000000e+00, %116 ], [ %152, %118 ]
%121 = phi i64 [ 0, %116 ], [ %154, %118 ]
%122 = getelementptr inbounds float, float* %74, i64 %119
%123 = load float, float* %122
%124 = fadd float %120, %123
%125 = or i64 %119, 1
%126 = getelementptr inbounds float, float* %74, i64 %125
%127 = load float, float* %126
%128 = fadd float %124, %127
%129 = or i64 %119, 2
%130 = getelementptr inbounds float, float* %74, i64 %129
%131 = load float, float* %130
%132 = fadd float %128, %131
%133 = or i64 %119, 3
%134 = getelementptr inbounds float, float* %74, i64 %133
%135 = load float, float* %134
%136 = fadd float %132, %135
%137 = or i64 %119, 4
%138 = getelementptr inbounds float, float* %74, i64 %137
%139 = load float, float* %138
%140 = fadd float %136, %139
%141 = or i64 %119, 5
%142 = getelementptr inbounds float, float* %74, i64 %141
%143 = load float, float* %142
%144 = fadd float %140, %143
%145 = or i64 %119, 6
%146 = getelementptr inbounds float, float* %74, i64 %145
%147 = load float, float* %146
%148 = fadd float %144, %147
%149 = or i64 %119, 7
%150 = getelementptr inbounds float, float* %74, i64 %149
%151 = load float, float* %150
%152 = fadd float %148, %151
%153 = add nuw nsw i64 %119, 8
%154 = add i64 %121, 8
%155 = icmp eq i64 %154, %117
br i1 %155, label %156, label %118
156: ; preds = %118, %111
%157 = phi float [ undef, %111 ], [ %152, %118 ]
%158 = phi i64 [ 0, %111 ], [ %153, %118 ]
%159 = phi float [ 0.000000e+00, %111 ], [ %152, %118 ]
%160 = icmp eq i64 %114, 0
br i1 %160, label %171, label %161
161: ; preds = %156, %161
%162 = phi i64 [ %168, %161 ], [ %158, %156 ]
%163 = phi float [ %167, %161 ], [ %159, %156 ]
%164 = phi i64 [ %169, %161 ], [ 0, %156 ]
%165 = getelementptr inbounds float, float* %74, i64 %162
%166 = load float, float* %165
%167 = fadd float %163, %166
%168 = add nuw nsw i64 %162, 1
%169 = add i64 %164, 1
%170 = icmp eq i64 %169, %114
br i1 %170, label %171, label %161
171: ; preds = %161, %156
%172 = phi float [ %157, %156 ], [ %167, %161 ]
%173 = fpext float %172 to double
br label %174
174: ; preds = %171, %87
%175 = phi i32 [ 0, %87 ], [ %109, %171 ]
%176 = phi double [ 0.000000e+00, %87 ], [ %173, %171 ]
store i32 %175, i32* %12
%177 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), double %176)
%178 = load float, float* %2
%179 = fpext float %178 to double
%180 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.13, i64 0, i64 0), double %179)
%181 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.18, i64 0, i64 0))
store i32 0, i32* %12
%182 = load i32, i32* %15
%183 = icmp sgt i32 %182, 0
br i1 %183, label %184, label %198
184: ; preds = %174, %184
%185 = phi i32 [ %195, %184 ], [ 0, %174 ]
%186 = sext i32 %185 to i64
%187 = getelementptr inbounds float, float* %74, i64 %186
%188 = load float, float* %187
%189 = fpext float %188 to double
%190 = getelementptr inbounds float, float* %75, i64 %186
%191 = load float, float* %190
%192 = fpext float %191 to double
%193 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.15, i64 0, i64 0), i32 %185, double %189, double %192)
%194 = load i32, i32* %12
%195 = add nsw i32 %194, 1
store i32 %195, i32* %12
%196 = load i32, i32* %15
%197 = icmp slt i32 %195, %196
br i1 %197, label %184, label %198
198: ; preds = %184, %174, %69
ret i32 0
}