#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 */
double *calloc(int, 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 /*<<< orphan*/ zfeast_heev(char *, int *, double *, int *, int *, double *,
                               int *, double *, double *, int *, double *,
                               double *, int *, double *, int *);
int main() {
  int feastparam[64];
  double epsout;
  int loop;
  char UPLO = 'F';
  FILE *fp;
  char name[] = "../../system2";
  int N, nnz;
  double *A;
  struct timeval t1, t2;
  int i, j, k, n2, err;
  int M0, M, info;
  double Emin, Emax, trace;
  double *X;
  double *E, *res;
  fp = fopen(name, "r");
  err = fscanf(fp, "%d%d\n", &N, &nnz);
  n2 = 2 * N * N;
  A = calloc(n2, sizeof(double));
  for (i = 0; i <= n2 - 1; i++) {
    *(A + i) = (double)0.0;
  };
  for (k = 0; k <= nnz - 1; k++) {
    err = fscanf(fp, "%d %d", &i, &j);
    err = fscanf(fp, "%lf%lf\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 = (double)-0.35;
  Emax = (double)0.23;
  M0 = 40;
  E = calloc(M0, sizeof(double));
  res = calloc(M0, sizeof(double));
  X = calloc(2 * N * M0, sizeof(double));
  feastinit(feastparam);
  feastparam[0] = 1;
  zfeast_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] %.15e %.15e\n", Emin, Emax);
    printf("# mode found/subspace %d %d \n", M, M0);
    printf("# iterations %d \n", loop);
    trace = (double)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));
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x208,%rsp
movl   $0x0,-0x2c(%rbp)
movb   $0x46,-0x13d(%rbp)
mov    0xe6f(%rip),%rax
mov    %rax,-0x156(%rbp)
mov    0xe6a(%rip),%eax
mov    %eax,-0x14e(%rbp)
mov    0xe61(%rip),%ax
mov    %ax,-0x14a(%rbp)
lea    -0x156(%rbp),%rdi
lea    0xe4e(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x148(%rbp)
mov    -0x148(%rbp),%rdi
lea    0xe36(%rip),%rsi
lea    -0x15c(%rbp),%rdx
lea    -0x160(%rbp),%rcx
mov    $0x0,%al
call   1080 <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    $0x8,%esi
call   1090 <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
movsd  %xmm0,(%rax,%rcx,8)
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    0xd7a(%rip),%rsi
lea    -0x18c(%rbp),%rdx
lea    -0x190(%rbp),%rcx
mov    $0x0,%al
call   1080 <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    $0x3,%rax
add    %rax,%rdx
mov    -0x18c(%rbp),%eax
shl    $0x1,%eax
cltq
shl    $0x3,%rax
add    %rax,%rdx
add    $0xfffffffffffffff0,%rdx
mov    -0x168(%rbp),%rcx
mov    -0x190(%rbp),%eax
sub    $0x1,%eax
shl    $0x1,%eax
imul   -0x15c(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rcx
mov    -0x18c(%rbp),%eax
shl    $0x1,%eax
cltq
shl    $0x3,%rax
add    %rax,%rcx
add    $0xfffffffffffffff8,%rcx
lea    0xce5(%rip),%rsi
mov    $0x0,%al
call   1080 <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   1040 <fclose@plt>
mov    -0x15c(%rbp),%esi
lea    0xcb3(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x178(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gettimeofday@plt>
movsd  0xc60(%rip),%xmm0
movsd  %xmm0,-0x1b0(%rbp)
ff
movsd  0xc48(%rip),%xmm0
movsd  %xmm0,-0x1b8(%rbp)
ff
movl   $0x28,-0x1a0(%rbp)
mov    -0x1a0(%rbp),%edi
mov    $0x8,%esi
call   1090 <calloc@plt>
mov    %rax,-0x1d0(%rbp)
mov    -0x1a0(%rbp),%edi
mov    $0x8,%esi
call   1090 <calloc@plt>
mov    %rax,-0x1d8(%rbp)
mov    -0x15c(%rbp),%edi
shl    $0x1,%edi
imul   -0x1a0(%rbp),%edi
mov    $0x8,%esi
call   1090 <calloc@plt>
mov    %rax,-0x1c8(%rbp)
lea    -0x130(%rbp),%rdi
call   1060 <feastinit@plt>
movl   $0x1,-0x130(%rbp)
mov    -0x168(%rbp),%rdx
lea    -0x130(%rbp),%r8
mov    -0x1d0(%rbp),%r14
mov    -0x1c8(%rbp),%rbx
mov    -0x1d8(%rbp),%r10
lea    -0x13d(%rbp),%rdi
lea    -0x15c(%rbp),%rcx
lea    -0x138(%rbp),%r9
lea    -0x13c(%rbp),%rax
lea    -0x1b0(%rbp),%r13
lea    -0x1b8(%rbp),%r12
lea    -0x1a0(%rbp),%r15
lea    -0x1a4(%rbp),%r11
lea    -0x1a8(%rbp),%rsi
mov    %rsi,-0x1e0(%rbp)
mov    %rcx,%rsi
mov    %rax,(%rsp)
mov    -0x1e0(%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   1030 <zfeast_heev@plt>
lea    -0x188(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <gettimeofday@plt>
mov    -0x1a8(%rbp),%esi
lea    0xb6d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
cmpl   $0x0,-0x1a8(%rbp)
jne    16c9 <main+0x549>
lea    0xb68(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xb8d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xb4c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movsd  -0x188(%rbp),%xmm0
ff
subsd  -0x178(%rbp),%xmm0
ff
movsd  -0x180(%rbp),%xmm1
ff
subsd  -0x170(%rbp),%xmm1
ff
movsd  0xaba(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
lea    0xb74(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  -0x1b0(%rbp),%xmm0
ff
movsd  -0x1b8(%rbp),%xmm1
ff
lea    0xb6a(%rip),%rdi
mov    $0x2,%al
call   1050 <printf@plt>
mov    -0x1a4(%rbp),%esi
mov    -0x1a0(%rbp),%edx
lea    0xb7b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x13c(%rbp),%esi
lea    0xb85(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x1c0(%rbp)
ff
movl   $0x0,-0x18c(%rbp)
mov    -0x18c(%rbp),%eax
mov    -0x1a4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     161b <main+0x49b>
movsd  -0x1c0(%rbp),%xmm0
ff
mov    -0x1d0(%rbp),%rax
movslq -0x18c(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x1c0(%rbp)
ff
mov    -0x18c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18c(%rbp)
jmp    15cd <main+0x44d>
movsd  -0x1c0(%rbp),%xmm0
ff
lea    0xb1e(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  -0x138(%rbp),%xmm0
ff
lea    0xb15(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xb2a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x18c(%rbp)
mov    -0x18c(%rbp),%eax
mov    -0x1a4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     16c4 <main+0x544>
mov    -0x18c(%rbp),%esi
mov    -0x1d0(%rbp),%rax
movslq -0x18c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x1d8(%rbp),%rax
movslq -0x18c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
lea    0xae6(%rip),%rdi
mov    $0x2,%al
call   1050 <printf@plt>
mov    -0x18c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18c(%rbp)
jmp    165f <main+0x4df>
jmp    16c9 <main+0x549>
xor    %eax,%eax
add    $0x208,%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    $0x178,%rsp
movb   $0x46,0x7(%rsp)
movabs $0x326d6574737973,%rax
mov    %rax,0x46(%rsp)
movabs $0x79732f2e2e2f2e2e,%rax
2f 73 79
mov    %rax,0x40(%rsp)
lea    0xe3b(%rip),%rsi
lea    0x40(%rsp),%rdi
call   10c0 <fopen@plt>
mov    %rax,%rbx
lea    0xe29(%rip),%rsi
xor    %r14d,%r14d
lea    0xc(%rsp),%rdx
lea    0x1c(%rsp),%rcx
mov    %rax,%rdi
xor    %eax,%eax
call   10a0 <fscanf@plt>
mov    0xc(%rsp),%ebp
imul   %ebp,%ebp
add    %ebp,%ebp
mov    %ebp,%edi
mov    $0x8,%esi
call   10b0 <calloc@plt>
mov    %rax,%r15
test   %ebp,%ebp
jle    1235 <main+0x95>
mov    %ebp,%edx
shl    $0x3,%rdx
mov    %r15,%rdi
xor    %esi,%esi
call   1090 <memset@plt>
mov    %ebp,%r14d
mov    %r14d,0x8(%rsp)
cmpl   $0x0,0x1c(%rsp)
mov    %r15,%r14
jle    12bf <main+0x11f>
lea    0x8(%rsp),%r15
lea    0x20(%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   10a0 <fscanf@plt>
mov    0x20(%rsp),%eax
add    %eax,%eax
add    $0xfffffffe,%eax
movslq 0xc(%rsp),%rcx
cltq
imul   %rcx,%rax
lea    (%r14,%rax,8),%rax
movslq 0x8(%rsp),%rcx
shl    $0x4,%rcx
lea    (%rcx,%rax,1),%rdx
add    $0xfffffffffffffff0,%rdx
add    %rax,%rcx
add    $0xfffffffffffffff8,%rcx
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   10a0 <fscanf@plt>
add    $0x1,%r12d
cmp    0x1c(%rsp),%r12d
jl     1260 <main+0xc0>
mov    %rbx,%rdi
call   1050 <fclose@plt>
mov    0xc(%rsp),%esi
lea    0xd5a(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0x60(%rsp),%rdi
xor    %esi,%esi
call   1080 <gettimeofday@plt>
movabs $0xbfd6666666666666,%rax
66 d6 bf
mov    %rax,0x30(%rsp)
movabs $0x3fcd70a3d70a3d71,%rax
70 cd 3f
mov    %rax,0x28(%rsp)
movl   $0x28,0x18(%rsp)
mov    $0x28,%edi
mov    $0x8,%esi
call   10b0 <calloc@plt>
mov    %rax,%r15
mov    $0x28,%edi
mov    $0x8,%esi
call   10b0 <calloc@plt>
mov    %rax,%r13
mov    0xc(%rsp),%eax
shl    $0x4,%eax
lea    (%rax,%rax,4),%edi
mov    $0x8,%esi
call   10b0 <calloc@plt>
mov    %rax,%rbx
lea    0x70(%rsp),%rbp
mov    %rbp,%rdi
call   1070 <feastinit@plt>
movl   $0x1,0x70(%rsp)
sub    $0x8,%rsp
lea    0x1c(%rsp),%rax
lea    0x18(%rsp),%r10
lea    0x20(%rsp),%r11
lea    0x30(%rsp),%r12
lea    0xf(%rsp),%rdi
lea    0x14(%rsp),%rcx
lea    0x40(%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    0x70(%rsp),%rax
push   %rax
lea    0x6c(%rsp),%rax
push   %rax
call   1030 <zfeast_heev@plt>
add    $0x50,%rsp
lea    0x50(%rsp),%rdi
xor    %esi,%esi
call   1080 <gettimeofday@plt>
mov    0x14(%rsp),%esi
lea    0xc8a(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
cmpl   $0x0,0x14(%rsp)
jne    157b <main+0x3db>
lea    0xd6b(%rip),%rbx
mov    %rbx,%rdi
call   1040 <puts@plt>
lea    0xd2a(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
movapd 0x50(%rsp),%xmm1
subpd  0x60(%rsp),%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
mulsd  0xbec(%rip),%xmm0
addsd  %xmm1,%xmm0
lea    0xc44(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x30(%rsp),%xmm0
movsd  0x28(%rsp),%xmm1
lea    0xc3e(%rip),%rdi
mov    $0x2,%al
call   1060 <printf@plt>
mov    0x10(%rsp),%esi
mov    0x18(%rsp),%edx
lea    0xc53(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x24(%rsp),%esi
lea    0xc5f(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x10(%rsp),%eax
test   %eax,%eax
jle    1487 <main+0x2e7>
lea    -0x1(%rax),%rdx
mov    %eax,%ecx
and    $0x7,%ecx
cmp    $0x7,%rdx
jae    148f <main+0x2ef>
xorpd  %xmm0,%xmm0
xor    %edx,%edx
jmp    14e0 <main+0x340>
xorpd  %xmm0,%xmm0
xor    %eax,%eax
jmp    14fe <main+0x35e>
mov    %eax,%esi
and    $0xfffffff8,%esi
xorpd  %xmm0,%xmm0
xor    %edx,%edx
nopw   0x0(%rax,%rax,1)
addsd  (%r15,%rdx,8),%xmm0
addsd  0x8(%r15,%rdx,8),%xmm0
addsd  0x10(%r15,%rdx,8),%xmm0
addsd  0x18(%r15,%rdx,8),%xmm0
addsd  0x20(%r15,%rdx,8),%xmm0
addsd  0x28(%r15,%rdx,8),%xmm0
addsd  0x30(%r15,%rdx,8),%xmm0
addsd  0x38(%r15,%rdx,8),%xmm0
add    $0x8,%rdx
cmp    %rdx,%rsi
jne    14a0 <main+0x300>
test   %rcx,%rcx
je     14fe <main+0x35e>
lea    (%r15,%rdx,8),%rdx
xor    %esi,%esi
nopl   0x0(%rax,%rax,1)
addsd  (%rdx,%rsi,8),%xmm0
add    $0x1,%rsi
cmp    %rsi,%rcx
jne    14f0 <main+0x350>
mov    %eax,0x8(%rsp)
lea    0xbc9(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0x38(%rsp),%xmm0
lea    0xbc2(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
lea    0xc4e(%rip),%rdi
call   1040 <puts@plt>
movl   $0x0,0x8(%rsp)
cmpl   $0x0,0x10(%rsp)
jle    157b <main+0x3db>
xor    %eax,%eax
lea    0xbba(%rip),%rbx
nopl   0x0(%rax,%rax,1)
movslq %eax,%rsi
movsd  (%r15,%rsi,8),%xmm0
movsd  0x0(%r13,%rsi,8),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1060 <printf@plt>
mov    0x8(%rsp),%eax
add    $0x1,%eax
mov    %eax,0x8(%rsp)
cmp    0x10(%rsp),%eax
jl     1550 <main+0x3b0>
xor    %eax,%eax
add    $0x178,%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 = [8 x i8] c"%lf%lf\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 = [43 x i8] c"# Search interval [Emin,Emax] %.15e %.15e\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 = [13 x i8] c"TRACE %.15e\0A\00"
@.str.13 = [35 x i8] c"Relative error on the Trace %.15e\0A\00"
@.str.14 = [23 x i8] c"Eigenvalues/Residuals\0A\00"
@.str.15 = [19 x i8] c" %d %.15e %.15e\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [64 x i32]
%3 = alloca double
%4 = alloca i32
%5 = alloca i8
%6 = alloca i32*
%7 = alloca [14 x i8]
%8 = alloca i32
%9 = alloca i32
%10 = alloca double*
%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 double
%22 = alloca double
%23 = alloca double
%24 = alloca double*
%25 = alloca double*
%26 = alloca double*
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 double* @calloc(i32 %36, i32 8)
store double* %37, double** %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 double*, double** %10
%45 = load i32, i32* %13
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds double, double* %44, i64 %46
store double 0.000000e+00, double* %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 double*, double** %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 double, double* %61, i64 %67
%69 = load i32, i32* %13
%70 = mul nsw i32 2, %69
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds double, double* %68, i64 %71
%73 = getelementptr inbounds double, double* %72, i64 -2
%74 = load double*, double** %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 double, double* %74, i64 %80
%82 = load i32, i32* %13
%83 = mul nsw i32 2, %82
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds double, double* %81, i64 %84
%86 = getelementptr inbounds double, double* %85, i64 -1
%87 = call i32 (i32*, i8*, ...) @fscanf(i32* %60, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), double* %73, double* %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 double -3.500000e-01, double* %21
store double 2.300000e-01, double* %22
store i32 40, i32* %18
%97 = load i32, i32* %18
%98 = call double* @calloc(i32 %97, i32 8)
store double* %98, double** %25
%99 = load i32, i32* %18
%100 = call double* @calloc(i32 %99, i32 8)
store double* %100, double** %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 double* @calloc(i32 %104, i32 8)
store double* %105, double** %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 double*, double** %10
%110 = getelementptr inbounds [64 x i32], [64 x i32]* %2, i64 0, i64 0
%111 = load double*, double** %25
%112 = load double*, double** %24
%113 = load double*, double** %26
%114 = call i32 @zfeast_heev(i8* %5, i32* %8, double* %109, i32* %8, i32* %110, double* %3, i32* %4, double* %21, double* %22, i32* %18, double* %111, double* %112, i32* %19, double* %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 %189
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 double, double* %21
%138 = load double, double* %22
%139 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.9, i64 0, i64 0), double %137, double %138)
%140 = load i32, i32* %19
%141 = load i32, i32* %18
%142 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.10, i64 0, i64 0), i32 %140, i32 %141)
%143 = load i32, i32* %4
%144 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0), i32 %143)
store double 0.000000e+00, double* %23
store i32 0, i32* %13
br label %145
145: ; preds = %158, %120
%146 = load i32, i32* %13
%147 = load i32, i32* %19
%148 = sub nsw i32 %147, 1
%149 = icmp sle i32 %146, %148
br i1 %149, label %150, label %161
150: ; preds = %145
%151 = load double, double* %23
%152 = load double*, double** %25
%153 = load i32, i32* %13
%154 = sext i32 %153 to i64
%155 = getelementptr inbounds double, double* %152, i64 %154
%156 = load double, double* %155
%157 = fadd double %151, %156
store double %157, double* %23
br label %158
158: ; preds = %150
%159 = load i32, i32* %13
%160 = add nsw i32 %159, 1
store i32 %160, i32* %13
br label %145
161: ; preds = %145
%162 = load double, double* %23
%163 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.12, i64 0, i64 0), double %162)
%164 = load double, double* %3
%165 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.13, i64 0, i64 0), double %164)
%166 = 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 %167
167: ; preds = %185, %161
%168 = load i32, i32* %13
%169 = load i32, i32* %19
%170 = sub nsw i32 %169, 1
%171 = icmp sle i32 %168, %170
br i1 %171, label %172, label %188
172: ; preds = %167
%173 = load i32, i32* %13
%174 = load double*, double** %25
%175 = load i32, i32* %13
%176 = sext i32 %175 to i64
%177 = getelementptr inbounds double, double* %174, i64 %176
%178 = load double, double* %177
%179 = load double*, double** %26
%180 = load i32, i32* %13
%181 = sext i32 %180 to i64
%182 = getelementptr inbounds double, double* %179, i64 %181
%183 = load double, double* %182
%184 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.15, i64 0, i64 0), i32 %173, double %178, double %183)
br label %185
185: ; preds = %172
%186 = load i32, i32* %13
%187 = add nsw i32 %186, 1
store i32 %187, i32* %13
br label %167
188: ; preds = %167
br label %189
189: ; preds = %188, %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 = [8 x i8] c"%lf%lf\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 = [43 x i8] c"# Search interval [Emin,Emax] %.15e %.15e\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 = [13 x i8] c"TRACE %.15e\0A\00"
@.str.13 = [35 x i8] c"Relative error on the Trace %.15e\0A\00"
@.str.15 = [19 x i8] c" %d %.15e %.15e\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 double
%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 double
%18 = alloca double
%19 = bitcast [64 x i32]* %1 to i8*
%20 = bitcast double* %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 double* %17 to i8*
%33 = bitcast double* %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 double* @calloc(i32 %38, i32 8)
%40 = icmp sgt i32 %38, 0
br i1 %40, label %41, label %45
41: ; preds = %0
%42 = bitcast double* %39 to i8*
%43 = zext i32 %38 to i64
%44 = shl nuw nsw i64 %43, 3
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 double, double* %39, i64 %57
%59 = load i32, i32* %12
%60 = shl nsw i32 %59, 1
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds double, double* %58, i64 %61
%63 = getelementptr inbounds double, double* %62, i64 -2
%64 = getelementptr inbounds double, double* %62, i64 -1
%65 = call i32 (i32*, i8*, ...) @fscanf(i32* %34, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), double* %63, double* %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 double -3.500000e-01, double* %17
store double 2.300000e-01, double* %18
store i32 40, i32* %14
%74 = call double* @calloc(i32 40, i32 8)
%75 = call double* @calloc(i32 40, i32 8)
%76 = load i32, i32* %6
%77 = mul nsw i32 %76, 80
%78 = call double* @calloc(i32 %77, i32 8)
%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 @zfeast_heev(i8* %4, i32* %6, double* %39, i32* %6, i32* %79, double* %2, i32* %3, double* %17, double* %18, i32* %14, double* %74, double* %78, i32* %15, double* %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 %190
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 double, double* %17
%100 = load double, double* %18
%101 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.9, i64 0, i64 0), double %99, double %100)
%102 = load i32, i32* %15
%103 = load i32, i32* %14
%104 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.10, i64 0, i64 0), i32 %102, i32 %103)
%105 = load i32, i32* %3
%106 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0), i32 %105)
%107 = load i32, i32* %15
%108 = icmp sgt i32 %107, 0
br i1 %108, label %109, label %169
109: ; preds = %87
%110 = zext i32 %107 to i64
%111 = add nsw i64 %110, -1
%112 = and i64 %110, 7
%113 = icmp ult i64 %111, 7
br i1 %113, label %154, label %114
114: ; preds = %109
%115 = and i64 %110, 4294967288
br label %116
116: ; preds = %116, %114
%117 = phi i64 [ 0, %114 ], [ %151, %116 ]
%118 = phi double [ 0.000000e+00, %114 ], [ %150, %116 ]
%119 = phi i64 [ 0, %114 ], [ %152, %116 ]
%120 = getelementptr inbounds double, double* %74, i64 %117
%121 = load double, double* %120
%122 = fadd double %118, %121
%123 = or i64 %117, 1
%124 = getelementptr inbounds double, double* %74, i64 %123
%125 = load double, double* %124
%126 = fadd double %122, %125
%127 = or i64 %117, 2
%128 = getelementptr inbounds double, double* %74, i64 %127
%129 = load double, double* %128
%130 = fadd double %126, %129
%131 = or i64 %117, 3
%132 = getelementptr inbounds double, double* %74, i64 %131
%133 = load double, double* %132
%134 = fadd double %130, %133
%135 = or i64 %117, 4
%136 = getelementptr inbounds double, double* %74, i64 %135
%137 = load double, double* %136
%138 = fadd double %134, %137
%139 = or i64 %117, 5
%140 = getelementptr inbounds double, double* %74, i64 %139
%141 = load double, double* %140
%142 = fadd double %138, %141
%143 = or i64 %117, 6
%144 = getelementptr inbounds double, double* %74, i64 %143
%145 = load double, double* %144
%146 = fadd double %142, %145
%147 = or i64 %117, 7
%148 = getelementptr inbounds double, double* %74, i64 %147
%149 = load double, double* %148
%150 = fadd double %146, %149
%151 = add nuw nsw i64 %117, 8
%152 = add i64 %119, 8
%153 = icmp eq i64 %152, %115
br i1 %153, label %154, label %116
154: ; preds = %116, %109
%155 = phi double [ undef, %109 ], [ %150, %116 ]
%156 = phi i64 [ 0, %109 ], [ %151, %116 ]
%157 = phi double [ 0.000000e+00, %109 ], [ %150, %116 ]
%158 = icmp eq i64 %112, 0
br i1 %158, label %169, label %159
159: ; preds = %154, %159
%160 = phi i64 [ %166, %159 ], [ %156, %154 ]
%161 = phi double [ %165, %159 ], [ %157, %154 ]
%162 = phi i64 [ %167, %159 ], [ 0, %154 ]
%163 = getelementptr inbounds double, double* %74, i64 %160
%164 = load double, double* %163
%165 = fadd double %161, %164
%166 = add nuw nsw i64 %160, 1
%167 = add i64 %162, 1
%168 = icmp eq i64 %167, %112
br i1 %168, label %169, label %159
169: ; preds = %154, %159, %87
%170 = phi i32 [ 0, %87 ], [ %107, %159 ], [ %107, %154 ]
%171 = phi double [ 0.000000e+00, %87 ], [ %155, %154 ], [ %165, %159 ]
store i32 %170, i32* %12
%172 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.12, i64 0, i64 0), double %171)
%173 = load double, double* %2
%174 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.13, i64 0, i64 0), double %173)
%175 = 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
%176 = load i32, i32* %15
%177 = icmp sgt i32 %176, 0
br i1 %177, label %178, label %190
178: ; preds = %169, %178
%179 = phi i32 [ %187, %178 ], [ 0, %169 ]
%180 = sext i32 %179 to i64
%181 = getelementptr inbounds double, double* %74, i64 %180
%182 = load double, double* %181
%183 = getelementptr inbounds double, double* %75, i64 %180
%184 = load double, double* %183
%185 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.15, i64 0, i64 0), i32 %179, double %182, double %184)
%186 = load i32, i32* %12
%187 = add nsw i32 %186, 1
store i32 %187, i32* %12
%188 = load i32, i32* %15
%189 = icmp slt i32 %187, %188
br i1 %189, label %178, label %190
190: ; preds = %178, %169, %69
ret i32 0
}