#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 NAN;
int abs(double);
int /*<<< orphan*/ dgeqrf(int, int, double *, int, double *, double *, int);
int /*<<< orphan*/ dormqr(char *, char *, int, int, int, double *, int,
                          double *, double *, int, double *, int);
int /*<<< orphan*/ free(double *);
scalar_t__ isnan(double);
double *malloc(int);
int pow(double, int);
int /*<<< orphan*/ printf(char *, int);
int sqrt(double);
int deigvals(double *H, int dim, double *wr, double *wi, double prec) {
  int info, converged, real;
  double *workspace;
  double *tau;
  double *Hmem;
  double *R;
  int workdim;
  double error, Delta;
  int i, j, k;
  tau = malloc(dim * dim * sizeof(double));
  R = malloc(dim * dim * sizeof(double));
  Hmem = malloc(dim * dim * sizeof(double));
  workspace = malloc(sizeof(double));
  dgeqrf(dim, dim, H, dim, tau, workspace, -1);
  workdim = workspace[0];
  free(workspace);
  workspace = malloc(workdim * workdim * sizeof(double));
  converged = 0;
  k = 0;
  while (converged == 0) {
    for (i = 0; i < dim * dim; i++) {
      Hmem[i] = H[i];
    }
    dgeqrf(dim, dim, H, dim, tau, workspace, workdim);
    for (i = 0; i < dim; i++) {
      for (j = 0; j < dim; j++) {
        R[i * dim + j] = H[i * dim + j];
      }
    }
    dormqr("R", "N", dim, dim, dim, R, dim, tau, H, dim, workspace, workdim);
    error = 0;
    for (i = 1; i < dim * dim; i++) {
      error += (H[i] - Hmem[i]) * (H[i] - Hmem[i]);
    }
    if (error < prec * prec) {
      converged = 1;
    }
    k++;
  }
  printf("%d steps.\n", k);
  free(workspace);
  free(Hmem);
  free(tau);
  k = 0;
  for (i = 0; i < dim; i++) {
    real = 1;
    if (isnan(R[i * dim + i]) == 0) {
      for (j = i + 1; j < dim; j++) {
        if (abs(R[j * dim + i]) > 10 * prec) {
          if (real == 0) {
            wr[k] = NAN;
            wi[k] = NAN;
            wr[k + 1] = NAN;
            wi[k + 1] = NAN;
          } else {
            real = 0;
            Delta = pow(R[i * dim + i] + R[j * dim + j], 2) -
                    4 * (R[i * dim + i] * R[j * dim + j] -
                         R[i * dim + j] * R[j * dim + i]);
            if (Delta >= 0) {
              wr[k] = NAN;
              wi[k] = NAN;
              wr[k + 1] = NAN;
              wi[k + 1] = NAN;
            } else {
              wr[k] = (R[i * dim + i] + R[j * dim + j]) / 2;
              wr[k + 1] = (R[i * dim + i] + R[j * dim + j]) / 2;
              wi[k] = sqrt(-Delta) / 2;
              wi[k + 1] = sqrt(-Delta) / 2;
            }
          }
          R[j * dim + j] = NAN;
        }
      }
      if (real = 1) {
        wr[k] = R[i * dim + i];
        wi[k] = 0;
        k++;
      }
      if (real = 0) {
        k += 2;
      }
    }
  }
  if (k == dim) {
    info = 0;
  } else {
    info = 1;
  }
  return info;
}


x86 assembly (clang, -O0):
<deigvals>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %rbx
sub    $0xb8,%rsp
mov    %rdi,-0x20(%rbp)
mov    %esi,-0x24(%rbp)
mov    %rdx,-0x30(%rbp)
mov    %rcx,-0x38(%rbp)
movsd  %xmm0,-0x40(%rbp)
mov    -0x24(%rbp),%eax
imul   -0x24(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x60(%rbp)
mov    -0x24(%rbp),%eax
imul   -0x24(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x70(%rbp)
mov    -0x24(%rbp),%eax
imul   -0x24(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x68(%rbp)
mov    $0x8,%edi
call   1070 <malloc@plt>
mov    %rax,-0x58(%rbp)
mov    -0x24(%rbp),%edi
mov    -0x24(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x60(%rbp),%r8
mov    -0x58(%rbp),%r9
movl   $0xffffffff,(%rsp)
call   10b0 <dgeqrf@plt>
mov    -0x58(%rbp),%rax
cvttsd2si (%rax),%eax
mov    %eax,-0x74(%rbp)
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
mov    -0x74(%rbp),%eax
imul   -0x74(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x58(%rbp)
movl   $0x0,-0x48(%rbp)
movl   $0x0,-0x94(%rbp)
cmpl   $0x0,-0x48(%rbp)
jne    1491 <deigvals+0x301>
movl   $0x0,-0x8c(%rbp)
mov    -0x8c(%rbp),%eax
mov    -0x24(%rbp),%ecx
imul   -0x24(%rbp),%ecx
cmp    %ecx,%eax
jge    12c5 <deigvals+0x135>
mov    -0x20(%rbp),%rax
movslq -0x8c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x68(%rbp),%rax
movslq -0x8c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8c(%rbp)
jmp    127c <deigvals+0xec>
mov    -0x24(%rbp),%edi
mov    -0x24(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x60(%rbp),%r8
mov    -0x58(%rbp),%r9
mov    -0x74(%rbp),%eax
mov    %eax,(%rsp)
call   10b0 <dgeqrf@plt>
movl   $0x0,-0x8c(%rbp)
mov    -0x8c(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    137c <deigvals+0x1ec>
movl   $0x0,-0x90(%rbp)
mov    -0x90(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1363 <deigvals+0x1d3>
mov    -0x20(%rbp),%rax
mov    -0x8c(%rbp),%ecx
imul   -0x24(%rbp),%ecx
add    -0x90(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x70(%rbp),%rax
mov    -0x8c(%rbp),%ecx
imul   -0x24(%rbp),%ecx
add    -0x90(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x90(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x90(%rbp)
jmp    1308 <deigvals+0x178>
jmp    1368 <deigvals+0x1d8>
mov    -0x8c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8c(%rbp)
jmp    12ef <deigvals+0x15f>
mov    -0x24(%rbp),%edx
mov    -0x24(%rbp),%ecx
mov    -0x24(%rbp),%r8d
mov    -0x70(%rbp),%r9
mov    -0x24(%rbp),%r15d
mov    -0x60(%rbp),%r14
mov    -0x20(%rbp),%rbx
mov    -0x24(%rbp),%r11d
mov    -0x58(%rbp),%r10
mov    -0x74(%rbp),%eax
lea    0xc70(%rip),%rdi
lea    0xc6b(%rip),%rsi
mov    %r15d,(%rsp)
mov    %r14,0x8(%rsp)
mov    %rbx,0x10(%rsp)
mov    %r11d,0x18(%rsp)
mov    %r10,0x20(%rsp)
mov    %eax,0x28(%rsp)
call   1040 <dormqr@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x80(%rbp)
movl   $0x1,-0x8c(%rbp)
mov    -0x8c(%rbp),%eax
mov    -0x24(%rbp),%ecx
imul   -0x24(%rbp),%ecx
cmp    %ecx,%eax
jge    145d <deigvals+0x2cd>
mov    -0x20(%rbp),%rax
movslq -0x8c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x68(%rbp),%rax
movslq -0x8c(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x8c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x68(%rbp),%rax
movslq -0x8c(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm2
movsd  -0x80(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x8c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8c(%rbp)
jmp    13e2 <deigvals+0x252>
movsd  -0x80(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    147d <deigvals+0x2ed>
movl   $0x1,-0x48(%rbp)
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    1268 <deigvals+0xd8>
mov    -0x94(%rbp),%esi
lea    0xb7e(%rip),%rdi
call   1060 <printf@plt>
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
mov    -0x68(%rbp),%rdi
call   1030 <free@plt>
mov    -0x60(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x94(%rbp)
movl   $0x0,-0x8c(%rbp)
mov    -0x8c(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1994 <deigvals+0x804>
movl   $0x1,-0x4c(%rbp)
mov    -0x70(%rbp),%rax
mov    -0x8c(%rbp),%ecx
imul   -0x24(%rbp),%ecx
add    -0x8c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1080 <isnan@plt>
cmp    $0x0,%rax
jne    197b <deigvals+0x7eb>
mov    -0x8c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x90(%rbp)
mov    -0x90(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    18ed <deigvals+0x75d>
mov    -0x70(%rbp),%rax
mov    -0x90(%rbp),%ecx
imul   -0x24(%rbp),%ecx
add    -0x8c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1050 <abs@plt>
cvtsi2sd %eax,%xmm0
movsd  0xaa2(%rip),%xmm1
mulsd  -0x40(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jbe    18d4 <deigvals+0x744>
cmpl   $0x0,-0x4c(%rbp)
jne    15f2 <deigvals+0x462>
mov    0x2a7a(%rip),%rax
movsd  (%rax),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x94(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x2a5f(%rip),%rax
movsd  (%rax),%xmm0
mov    -0x38(%rbp),%rax
movslq -0x94(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x2a44(%rip),%rax
movsd  (%rax),%xmm0
mov    -0x30(%rbp),%rax
mov    -0x94(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x2a24(%rip),%rax
movsd  (%rax),%xmm0
mov    -0x38(%rbp),%rax
mov    -0x94(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    18ad <deigvals+0x71d>
movl   $0x0,-0x4c(%rbp)
mov    -0x70(%rbp),%rax
mov    -0x8c(%rbp),%ecx
imul   -0x24(%rbp),%ecx
add    -0x8c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x70(%rbp),%rax
mov    -0x90(%rbp),%ecx
imul   -0x24(%rbp),%ecx
add    -0x90(%rbp),%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    $0x2,%edi
call   1090 <pow@plt>
cvtsi2sd %eax,%xmm1
mov    -0x70(%rbp),%rax
mov    -0x8c(%rbp),%ecx
imul   -0x24(%rbp),%ecx
add    -0x8c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x70(%rbp),%rax
mov    -0x90(%rbp),%ecx
imul   -0x24(%rbp),%ecx
add    -0x90(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm3
mov    -0x70(%rbp),%rax
mov    -0x8c(%rbp),%ecx
imul   -0x24(%rbp),%ecx
add    -0x90(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x70(%rbp),%rax
mov    -0x90(%rbp),%ecx
imul   -0x24(%rbp),%ecx
add    -0x8c(%rbp),%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
movsd  0x932(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1776 <deigvals+0x5e6>
mov    0x28f6(%rip),%rax
movsd  (%rax),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x94(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x28db(%rip),%rax
movsd  (%rax),%xmm0
mov    -0x38(%rbp),%rax
movslq -0x94(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x28c0(%rip),%rax
movsd  (%rax),%xmm0
mov    -0x30(%rbp),%rax
mov    -0x94(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x28a0(%rip),%rax
movsd  (%rax),%xmm0
mov    -0x38(%rbp),%rax
mov    -0x94(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    18a8 <deigvals+0x718>
mov    -0x70(%rbp),%rax
mov    -0x8c(%rbp),%ecx
imul   -0x24(%rbp),%ecx
add    -0x8c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x70(%rbp),%rax
mov    -0x90(%rbp),%ecx
imul   -0x24(%rbp),%ecx
add    -0x90(%rbp),%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  0x85a(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movslq -0x94(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x70(%rbp),%rax
mov    -0x8c(%rbp),%ecx
imul   -0x24(%rbp),%ecx
add    -0x8c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x70(%rbp),%rax
mov    -0x90(%rbp),%ecx
imul   -0x24(%rbp),%ecx
add    -0x90(%rbp),%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  0x806(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
mov    -0x94(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x88(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   10a0 <sqrt@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
mov    -0x38(%rbp),%rax
movslq -0x94(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x88(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   10a0 <sqrt@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
mov    -0x38(%rbp),%rax
mov    -0x94(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    18ad <deigvals+0x71d>
mov    0x2744(%rip),%rax
movsd  (%rax),%xmm0
mov    -0x70(%rbp),%rax
mov    -0x90(%rbp),%ecx
imul   -0x24(%rbp),%ecx
add    -0x90(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    18d9 <deigvals+0x749>
mov    -0x90(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x90(%rbp)
jmp    1522 <deigvals+0x392>
movl   $0x1,-0x4c(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    1903 <deigvals+0x773>
jmp    1951 <deigvals+0x7c1>
mov    -0x70(%rbp),%rax
mov    -0x8c(%rbp),%ecx
imul   -0x24(%rbp),%ecx
add    -0x8c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x94(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%rax
movslq -0x94(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
movl   $0x0,-0x4c(%rbp)
xor    %eax,%eax
test   $0x1,%al
jne    1967 <deigvals+0x7d7>
jmp    1976 <deigvals+0x7e6>
mov    -0x94(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x94(%rbp)
jmp    197b <deigvals+0x7eb>
jmp    1980 <deigvals+0x7f0>
mov    -0x8c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8c(%rbp)
jmp    14d2 <deigvals+0x342>
mov    -0x94(%rbp),%eax
cmp    -0x24(%rbp),%eax
jne    19af <deigvals+0x81f>
movl   $0x0,-0x44(%rbp)
jmp    19b6 <deigvals+0x826>
movl   $0x1,-0x44(%rbp)
mov    -0x44(%rbp),%eax
add    $0xb8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<deigvals>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xb8,%rsp
movsd  %xmm0,0x70(%rsp)
mov    %rcx,0x68(%rsp)
mov    %rdx,0x60(%rsp)
mov    %esi,%r12d
mov    %rdi,%rbp
mov    %esi,%ebx
imul   %ebx,%ebx
lea    0x0(,%rbx,8),%r14d
mov    %r14d,%edi
call   1080 <malloc@plt>
mov    %rax,%r15
mov    %r14d,%edi
call   1080 <malloc@plt>
mov    %rax,0x8(%rsp)
mov    %r14d,%edi
call   1080 <malloc@plt>
mov    %rax,%r13
mov    $0x8,%edi
call   1080 <malloc@plt>
mov    %rax,%r14
sub    $0x8,%rsp
mov    %r12d,%edi
mov    %r12d,%esi
mov    %rbp,%rdx
mov    %r12d,%ecx
mov    %r15,%r8
mov    %rax,%r9
push   $0xffffffffffffffff
call   10c0 <dgeqrf@plt>
add    $0x10,%rsp
cvttsd2si (%r14),%eax
mov    %rax,0x10(%rsp)
mov    %r14,%rdi
call   1030 <free@plt>
mov    0x10(%rsp),%rax
mov    %eax,%edi
imul   %eax,%edi
shl    $0x3,%edi
call   1080 <malloc@plt>
mov    %rax,%r14
movsd  0x70(%rsp),%xmm0
mulsd  %xmm0,%xmm0
movsd  %xmm0,0x58(%rsp)
lea    0x0(,%rbx,8),%rax
mov    %rax,0x48(%rsp)
mov    %r12d,%eax
lea    0x0(,%rax,8),%r8
lea    -0x1(%rbx),%rcx
mov    %rbx,0x38(%rsp)
lea    -0x2(%rbx),%rdx
mov    %rdx,0x90(%rsp)
mov    %rax,0x20(%rsp)
and    $0xfffffffe,%eax
mov    %rax,0x78(%rsp)
mov    %ecx,%edi
and    $0x3,%edi
and    $0xfffffffffffffffc,%rcx
mov    %rcx,0x80(%rsp)
lea    (%r12,%r12,1),%ebx
xor    %esi,%esi
mov    %r12,0x98(%rsp)
mov    %r15,0x50(%rsp)
mov    %r14,0x30(%rsp)
mov    %r8,0x40(%rsp)
mov    %r13,0x18(%rsp)
mov    %rdi,0xa0(%rsp)
mov    %ebx,0x88(%rsp)
mov    0x88(%rsp),%ebx
jmp    1308 <deigvals+0x168>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x28(%rsp),%rsi
add    $0x1,%esi
movsd  0x58(%rsp),%xmm1
ucomisd %xmm0,%xmm1
ja     1550 <deigvals+0x3b0>
mov    %rsi,0x28(%rsp)
cmpl   $0x0,0x38(%rsp)
je     1324 <deigvals+0x184>
mov    %r13,%rdi
mov    %rbp,%rsi
mov    0x48(%rsp),%rdx
call   1070 <memcpy@plt>
sub    $0x8,%rsp
mov    %r12d,%edi
mov    %r12d,%esi
mov    %rbp,%rdx
mov    %r12d,%ecx
mov    %r15,%r8
mov    %r14,%r9
push   0x18(%rsp)
call   10c0 <dgeqrf@plt>
add    $0x10,%rsp
test   %r12d,%r12d
jle    141a <deigvals+0x27a>
mov    %rbp,%rax
cmp    $0x1,%r12d
jne    1370 <deigvals+0x1d0>
xor    %r14d,%r14d
mov    %rax,%rbp
jmp    13dc <deigvals+0x23c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %r12d,%r12d
xor    %r14d,%r14d
mov    0x8(%rsp),%r15
mov    0x40(%rsp),%r13
mov    %rax,%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movslq %r12d,%r12
lea    0x0(,%r12,8),%rsi
add    %rbp,%rsi
lea    (%r15,%r12,8),%rdi
mov    %r13,%rdx
call   1070 <memcpy@plt>
mov    0x98(%rsp),%rax
add    %r12d,%eax
cltq
lea    0x0(,%rax,8),%rsi
add    %rbp,%rsi
lea    (%r15,%rax,8),%rdi
mov    %r13,%rdx
call   1070 <memcpy@plt>
add    $0x2,%r14
add    %ebx,%r12d
cmp    %r14,0x78(%rsp)
jne    1390 <deigvals+0x1f0>
testb  $0x1,0x20(%rsp)
mov    0x98(%rsp),%r12
mov    0x50(%rsp),%r15
mov    0x18(%rsp),%r13
je     141a <deigvals+0x27a>
imul   %r12d,%r14d
movslq %r14d,%rax
lea    0x0(,%rax,8),%rsi
add    %rbp,%rsi
mov    0x8(%rsp),%rcx
lea    (%rcx,%rax,8),%rdi
mov    0x40(%rsp),%rdx
call   1070 <memcpy@plt>
lea    0xc0f(%rip),%rdi
lea    0xc0a(%rip),%rsi
mov    %r12d,%edx
mov    %r12d,%ecx
mov    %r12d,%r8d
mov    0x8(%rsp),%r9
push   0x10(%rsp)
mov    0x38(%rsp),%r14
push   %r14
push   %r12
push   %rbp
push   %r15
push   %r12
call   1040 <dormqr@plt>
add    $0x30,%rsp
xorpd  %xmm0,%xmm0
cmpl   $0x2,0x38(%rsp)
mov    0xa0(%rsp),%rdi
jb     12f0 <deigvals+0x150>
cmpq   $0x3,0x90(%rsp)
jae    1490 <deigvals+0x2f0>
xorpd  %xmm0,%xmm0
mov    $0x1,%eax
test   %rdi,%rdi
jne    150a <deigvals+0x36a>
jmp    12f0 <deigvals+0x150>
nopw   0x0(%rax,%rax,1)
xorpd  %xmm0,%xmm0
xor    %eax,%eax
mov    0x80(%rsp),%rcx
xchg   %ax,%ax
movsd  0x8(%rbp,%rax,8),%xmm1
movsd  0x10(%rbp,%rax,8),%xmm2
subsd  0x8(%r13,%rax,8),%xmm1
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
subsd  0x10(%r13,%rax,8),%xmm2
mulsd  %xmm2,%xmm2
addsd  %xmm1,%xmm2
movsd  0x18(%rbp,%rax,8),%xmm1
subsd  0x18(%r13,%rax,8),%xmm1
mulsd  %xmm1,%xmm1
addsd  %xmm2,%xmm1
movsd  0x20(%rbp,%rax,8),%xmm0
subsd  0x20(%r13,%rax,8),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
add    $0x4,%rax
cmp    %rax,%rcx
jne    14a0 <deigvals+0x300>
add    $0x1,%rax
test   %rdi,%rdi
je     12f0 <deigvals+0x150>
lea    0x0(,%rax,8),%rcx
add    %r13,%rcx
lea    0x0(,%rax,8),%rax
add    %rbp,%rax
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  (%rax,%rdx,8),%xmm1
subsd  (%rcx,%rdx,8),%xmm1
mulsd  %xmm1,%xmm1
addsd  %xmm1,%xmm0
add    $0x1,%rdx
cmp    %rdx,%rdi
jne    1530 <deigvals+0x390>
jmp    12f0 <deigvals+0x150>
lea    0xadd(%rip),%rdi
call   1060 <printf@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
test   %r12d,%r12d
jle    18df <deigvals+0x73f>
movsd  0x70(%rsp),%xmm0
mulsd  0xa75(%rip),%xmm0
movsd  %xmm0,0x70(%rsp)
mov    0x20(%rsp),%rax
lea    0x1(%rax),%rbx
mov    0x8(%rsp),%rdx
lea    (%rdx,%rax,8),%rcx
mov    %rcx,0x78(%rsp)
mov    %rdx,%r14
add    $0x8,%r14
lea    0x8(,%rax,8),%rax
mov    %rax,0x40(%rsp)
xor    %r13d,%r13d
mov    $0x1,%eax
mov    %rax,0x50(%rsp)
xor    %r15d,%r15d
mov    $0x1,%ecx
mov    %rcx,0x48(%rsp)
movl   $0x0,0x18(%rsp)
mov    %rbx,0x58(%rsp)
jmp    1613 <deigvals+0x473>
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x8(%rsp),%rdx
addq   $0x1,0x48(%rsp)
add    %rbx,0x50(%rsp)
add    %rbx,%r13
add    0x40(%rsp),%r14
cmp    0x20(%rsp),%r15
je     18e7 <deigvals+0x747>
mov    %r15d,%eax
imul   %r12d,%eax
movslq %eax,%rbp
add    %r15,%rbp
movsd  (%rdx,%rbp,8),%xmm0
call   1090 <isnan@plt>
add    $0x1,%r15
test   %rax,%rax
jne    15f0 <deigvals+0x450>
mov    %rbp,0x30(%rsp)
mov    0x18(%rsp),%eax
movslq %eax,%rcx
mov    %rcx,0x28(%rsp)
mov    %r15,0x90(%rsp)
cmp    0x20(%rsp),%r15
jae    187c <deigvals+0x6dc>
add    $0x1,%eax
mov    %eax,0x18(%rsp)
cltq
mov    %rax,0x10(%rsp)
mov    $0x1,%ebp
mov    %r14,0x88(%rsp)
mov    %r13,0x80(%rsp)
mov    %r13,%r15
mov    0x50(%rsp),%r12
mov    0x48(%rsp),%r13
jmp    16fd <deigvals+0x55d>
mov    0x2968(%rip),%rdx
movsd  (%rdx),%xmm0
mov    0x60(%rsp),%rax
mov    0x28(%rsp),%rsi
movsd  %xmm0,(%rax,%rsi,8)
movsd  (%rdx),%xmm0
mov    0x68(%rsp),%rcx
movsd  %xmm0,(%rcx,%rsi,8)
movsd  (%rdx),%xmm0
mov    0x10(%rsp),%rsi
movsd  %xmm0,(%rax,%rsi,8)
movsd  (%rdx),%xmm0
movsd  %xmm0,(%rcx,%rsi,8)
mov    0x20(%rsp),%rax
lea    (%rax,%r12,1),%rcx
movsd  (%rdx),%xmm0
mov    0x8(%rsp),%rax
movsd  %xmm0,(%rax,%rcx,8)
xor    %ebp,%ebp
add    $0x1,%r13
add    %rbx,%r12
mov    0x20(%rsp),%rax
add    %rax,%r15
add    $0x8,%r14
cmp    %r13,%rax
je     188f <deigvals+0x6ef>
mov    0x78(%rsp),%rax
movsd  (%rax,%r15,8),%xmm0
call   1050 <abs@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
ucomisd 0x70(%rsp),%xmm0
jbe    16e1 <deigvals+0x541>
test   %ebp,%ebp
je     1689 <deigvals+0x4e9>
mov    %r13,%rax
imul   0x20(%rsp),%rax
mov    0x30(%rsp),%rbx
mov    0x8(%rsp),%rcx
movsd  (%rcx,%rbx,8),%xmm0
add    %r13,%rax
mov    %rax,0x38(%rsp)
mov    0x78(%rsp),%rbp
addsd  0x0(%rbp,%r12,8),%xmm0
mov    $0x2,%edi
call   10a0 <pow@plt>
xorps  %xmm2,%xmm2
cvtsi2sd %eax,%xmm2
mov    0x8(%rsp),%rax
movsd  (%rax,%rbx,8),%xmm4
movsd  0x0(%rbp,%r12,8),%xmm1
movsd  0x0(%rbp,%r15,8),%xmm3
mulsd  (%r14),%xmm3
movapd %xmm4,%xmm0
mulsd  %xmm1,%xmm0
subsd  %xmm3,%xmm0
mulsd  0x876(%rip),%xmm0
addsd  %xmm2,%xmm0
ucomisd 0x87a(%rip),%xmm0
jae    182e <deigvals+0x68e>
addsd  %xmm1,%xmm4
mulsd  0x860(%rip),%xmm4
mov    0x60(%rsp),%rax
mov    0x28(%rsp),%rbp
movsd  %xmm4,(%rax,%rbp,8)
mov    0x10(%rsp),%rcx
movsd  %xmm4,(%rax,%rcx,8)
xorpd  0x84f(%rip),%xmm0
movapd %xmm0,0xa0(%rsp)
call   10b0 <sqrt@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
mov    0x68(%rsp),%rbx
movsd  %xmm0,(%rbx,%rbp,8)
movaps 0xa0(%rsp),%xmm0
call   10b0 <sqrt@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
mov    0x10(%rsp),%rax
movsd  %xmm0,(%rbx,%rax,8)
mov    0x58(%rsp),%rbx
mov    0x27cc(%rip),%rdx
jmp    1872 <deigvals+0x6d2>
mov    0x27c3(%rip),%rdx
movsd  (%rdx),%xmm0
mov    0x60(%rsp),%rax
mov    0x28(%rsp),%rsi
movsd  %xmm0,(%rax,%rsi,8)
movsd  (%rdx),%xmm0
mov    0x68(%rsp),%rcx
movsd  %xmm0,(%rcx,%rsi,8)
movsd  (%rdx),%xmm0
mov    0x10(%rsp),%rsi
movsd  %xmm0,(%rax,%rsi,8)
movsd  (%rdx),%xmm0
movsd  %xmm0,(%rcx,%rsi,8)
mov    0x58(%rsp),%rbx
mov    0x38(%rsp),%rcx
jmp    16d1 <deigvals+0x531>
add    $0x1,%eax
mov    %eax,0x18(%rsp)
mov    0x30(%rsp),%rax
mov    0x8(%rsp),%rdx
jmp    18b1 <deigvals+0x711>
mov    0x98(%rsp),%r12
mov    0x8(%rsp),%rdx
mov    0x88(%rsp),%r14
mov    0x80(%rsp),%r13
mov    0x30(%rsp),%rax
movsd  (%rdx,%rax,8),%xmm0
mov    0x60(%rsp),%rax
mov    0x28(%rsp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x68(%rsp),%rax
movq   $0x0,(%rax,%rcx,8)
mov    0x90(%rsp),%r15
jmp    15f5 <deigvals+0x455>
movl   $0x0,0x18(%rsp)
xor    %eax,%eax
cmp    %r12d,0x18(%rsp)
setne  %al
add    $0xb8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"R\00"
@.str.1 = [2 x i8] c"N\00"
@.str.2 = [11 x i8] c"%d steps.\0A\00"
@NAN = global double 0.000000e+00
define i32 @deigvals(double* %0, i32 %1, double* %2, double* %3, double %4) {
%6 = alloca double*
%7 = alloca i32
%8 = alloca double*
%9 = alloca double*
%10 = alloca double
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca double*
%15 = alloca double*
%16 = alloca double*
%17 = alloca double*
%18 = alloca i32
%19 = alloca double
%20 = alloca double
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
store double* %0, double** %6
store i32 %1, i32* %7
store double* %2, double** %8
store double* %3, double** %9
store double %4, double* %10
%24 = load i32, i32* %7
%25 = load i32, i32* %7
%26 = mul nsw i32 %24, %25
%27 = sext i32 %26 to i64
%28 = mul i64 %27, 8
%29 = trunc i64 %28 to i32
%30 = call double* @malloc(i32 %29)
store double* %30, double** %15
%31 = load i32, i32* %7
%32 = load i32, i32* %7
%33 = mul nsw i32 %31, %32
%34 = sext i32 %33 to i64
%35 = mul i64 %34, 8
%36 = trunc i64 %35 to i32
%37 = call double* @malloc(i32 %36)
store double* %37, double** %17
%38 = load i32, i32* %7
%39 = load i32, i32* %7
%40 = mul nsw i32 %38, %39
%41 = sext i32 %40 to i64
%42 = mul i64 %41, 8
%43 = trunc i64 %42 to i32
%44 = call double* @malloc(i32 %43)
store double* %44, double** %16
%45 = call double* @malloc(i32 8)
store double* %45, double** %14
%46 = load i32, i32* %7
%47 = load i32, i32* %7
%48 = load double*, double** %6
%49 = load i32, i32* %7
%50 = load double*, double** %15
%51 = load double*, double** %14
%52 = call i32 @dgeqrf(i32 %46, i32 %47, double* %48, i32 %49, double* %50, double* %51, i32 -1)
%53 = load double*, double** %14
%54 = getelementptr inbounds double, double* %53, i64 0
%55 = load double, double* %54
%56 = fptosi double %55 to i32
store i32 %56, i32* %18
%57 = load double*, double** %14
%58 = call i32 @free(double* %57)
%59 = load i32, i32* %18
%60 = load i32, i32* %18
%61 = mul nsw i32 %59, %60
%62 = sext i32 %61 to i64
%63 = mul i64 %62, 8
%64 = trunc i64 %63 to i32
%65 = call double* @malloc(i32 %64)
store double* %65, double** %14
store i32 0, i32* %12
store i32 0, i32* %23
br label %66
66: ; preds = %185, %5
%67 = load i32, i32* %12
%68 = icmp eq i32 %67, 0
br i1 %68, label %69, label %188
69: ; preds = %66
store i32 0, i32* %21
br label %70
70: ; preds = %86, %69
%71 = load i32, i32* %21
%72 = load i32, i32* %7
%73 = load i32, i32* %7
%74 = mul nsw i32 %72, %73
%75 = icmp slt i32 %71, %74
br i1 %75, label %76, label %89
76: ; preds = %70
%77 = load double*, double** %6
%78 = load i32, i32* %21
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds double, double* %77, i64 %79
%81 = load double, double* %80
%82 = load double*, double** %16
%83 = load i32, i32* %21
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds double, double* %82, i64 %84
store double %81, double* %85
br label %86
86: ; preds = %76
%87 = load i32, i32* %21
%88 = add nsw i32 %87, 1
store i32 %88, i32* %21
br label %70
89: ; preds = %70
%90 = load i32, i32* %7
%91 = load i32, i32* %7
%92 = load double*, double** %6
%93 = load i32, i32* %7
%94 = load double*, double** %15
%95 = load double*, double** %14
%96 = load i32, i32* %18
%97 = call i32 @dgeqrf(i32 %90, i32 %91, double* %92, i32 %93, double* %94, double* %95, i32 %96)
store i32 0, i32* %21
br label %98
98: ; preds = %129, %89
%99 = load i32, i32* %21
%100 = load i32, i32* %7
%101 = icmp slt i32 %99, %100
br i1 %101, label %102, label %132
102: ; preds = %98
store i32 0, i32* %22
br label %103
103: ; preds = %125, %102
%104 = load i32, i32* %22
%105 = load i32, i32* %7
%106 = icmp slt i32 %104, %105
br i1 %106, label %107, label %128
107: ; preds = %103
%108 = load double*, double** %6
%109 = load i32, i32* %21
%110 = load i32, i32* %7
%111 = mul nsw i32 %109, %110
%112 = load i32, i32* %22
%113 = add nsw i32 %111, %112
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds double, double* %108, i64 %114
%116 = load double, double* %115
%117 = load double*, double** %17
%118 = load i32, i32* %21
%119 = load i32, i32* %7
%120 = mul nsw i32 %118, %119
%121 = load i32, i32* %22
%122 = add nsw i32 %120, %121
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds double, double* %117, i64 %123
store double %116, double* %124
br label %125
125: ; preds = %107
%126 = load i32, i32* %22
%127 = add nsw i32 %126, 1
store i32 %127, i32* %22
br label %103
128: ; preds = %103
br label %129
129: ; preds = %128
%130 = load i32, i32* %21
%131 = add nsw i32 %130, 1
store i32 %131, i32* %21
br label %98
132: ; preds = %98
%133 = load i32, i32* %7
%134 = load i32, i32* %7
%135 = load i32, i32* %7
%136 = load double*, double** %17
%137 = load i32, i32* %7
%138 = load double*, double** %15
%139 = load double*, double** %6
%140 = load i32, i32* %7
%141 = load double*, double** %14
%142 = load i32, i32* %18
%143 = call i32 @dormqr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %133, i32 %134, i32 %135, double* %136, i32 %137, double* %138, double* %139, i32 %140, double* %141, i32 %142)
store double 0.000000e+00, double* %19
store i32 1, i32* %21
br label %144
144: ; preds = %175, %132
%145 = load i32, i32* %21
%146 = load i32, i32* %7
%147 = load i32, i32* %7
%148 = mul nsw i32 %146, %147
%149 = icmp slt i32 %145, %148
br i1 %149, label %150, label %178
150: ; preds = %144
%151 = load double*, double** %6
%152 = load i32, i32* %21
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds double, double* %151, i64 %153
%155 = load double, double* %154
%156 = load double*, double** %16
%157 = load i32, i32* %21
%158 = sext i32 %157 to i64
%159 = getelementptr inbounds double, double* %156, i64 %158
%160 = load double, double* %159
%161 = fsub double %155, %160
%162 = load double*, double** %6
%163 = load i32, i32* %21
%164 = sext i32 %163 to i64
%165 = getelementptr inbounds double, double* %162, i64 %164
%166 = load double, double* %165
%167 = load double*, double** %16
%168 = load i32, i32* %21
%169 = sext i32 %168 to i64
%170 = getelementptr inbounds double, double* %167, i64 %169
%171 = load double, double* %170
%172 = fsub double %166, %171
%173 = load double, double* %19
%174 = call double @llvm.fmuladd.f64(double %161, double %172, double %173)
store double %174, double* %19
br label %175
175: ; preds = %150
%176 = load i32, i32* %21
%177 = add nsw i32 %176, 1
store i32 %177, i32* %21
br label %144
178: ; preds = %144
%179 = load double, double* %19
%180 = load double, double* %10
%181 = load double, double* %10
%182 = fmul double %180, %181
%183 = fcmp olt double %179, %182
br i1 %183, label %184, label %185
184: ; preds = %178
store i32 1, i32* %12
br label %185
185: ; preds = %184, %178
%186 = load i32, i32* %23
%187 = add nsw i32 %186, 1
store i32 %187, i32* %23
br label %66
188: ; preds = %66
%189 = load i32, i32* %23
%190 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %189)
%191 = load double*, double** %14
%192 = call i32 @free(double* %191)
%193 = load double*, double** %16
%194 = call i32 @free(double* %193)
%195 = load double*, double** %15
%196 = call i32 @free(double* %195)
store i32 0, i32* %23
store i32 0, i32* %21
br label %197
197: ; preds = %459, %188
%198 = load i32, i32* %21
%199 = load i32, i32* %7
%200 = icmp slt i32 %198, %199
br i1 %200, label %201, label %462
201: ; preds = %197
store i32 1, i32* %13
%202 = load double*, double** %17
%203 = load i32, i32* %21
%204 = load i32, i32* %7
%205 = mul nsw i32 %203, %204
%206 = load i32, i32* %21
%207 = add nsw i32 %205, %206
%208 = sext i32 %207 to i64
%209 = getelementptr inbounds double, double* %202, i64 %208
%210 = load double, double* %209
%211 = call i64 @isnan(double %210)
%212 = icmp eq i64 %211, 0
br i1 %212, label %213, label %458
213: ; preds = %201
%214 = load i32, i32* %21
%215 = add nsw i32 %214, 1
store i32 %215, i32* %22
br label %216
216: ; preds = %429, %213
%217 = load i32, i32* %22
%218 = load i32, i32* %7
%219 = icmp slt i32 %217, %218
br i1 %219, label %220, label %432
220: ; preds = %216
%221 = load double*, double** %17
%222 = load i32, i32* %22
%223 = load i32, i32* %7
%224 = mul nsw i32 %222, %223
%225 = load i32, i32* %21
%226 = add nsw i32 %224, %225
%227 = sext i32 %226 to i64
%228 = getelementptr inbounds double, double* %221, i64 %227
%229 = load double, double* %228
%230 = call i32 @abs(double %229)
%231 = sitofp i32 %230 to double
%232 = load double, double* %10
%233 = fmul double 1.000000e+01, %232
%234 = fcmp ogt double %231, %233
br i1 %234, label %235, label %428
235: ; preds = %220
%236 = load i32, i32* %13
%237 = icmp eq i32 %236, 0
br i1 %237, label %238, label %261
238: ; preds = %235
%239 = load double, double* @NAN
%240 = load double*, double** %8
%241 = load i32, i32* %23
%242 = sext i32 %241 to i64
%243 = getelementptr inbounds double, double* %240, i64 %242
store double %239, double* %243
%244 = load double, double* @NAN
%245 = load double*, double** %9
%246 = load i32, i32* %23
%247 = sext i32 %246 to i64
%248 = getelementptr inbounds double, double* %245, i64 %247
store double %244, double* %248
%249 = load double, double* @NAN
%250 = load double*, double** %8
%251 = load i32, i32* %23
%252 = add nsw i32 %251, 1
%253 = sext i32 %252 to i64
%254 = getelementptr inbounds double, double* %250, i64 %253
store double %249, double* %254
%255 = load double, double* @NAN
%256 = load double*, double** %9
%257 = load i32, i32* %23
%258 = add nsw i32 %257, 1
%259 = sext i32 %258 to i64
%260 = getelementptr inbounds double, double* %256, i64 %259
store double %255, double* %260
br label %418
261: ; preds = %235
store i32 0, i32* %13
%262 = load double*, double** %17
%263 = load i32, i32* %21
%264 = load i32, i32* %7
%265 = mul nsw i32 %263, %264
%266 = load i32, i32* %21
%267 = add nsw i32 %265, %266
%268 = sext i32 %267 to i64
%269 = getelementptr inbounds double, double* %262, i64 %268
%270 = load double, double* %269
%271 = load double*, double** %17
%272 = load i32, i32* %22
%273 = load i32, i32* %7
%274 = mul nsw i32 %272, %273
%275 = load i32, i32* %22
%276 = add nsw i32 %274, %275
%277 = sext i32 %276 to i64
%278 = getelementptr inbounds double, double* %271, i64 %277
%279 = load double, double* %278
%280 = fadd double %270, %279
%281 = call i32 @pow(double %280, i32 2)
%282 = sitofp i32 %281 to double
%283 = load double*, double** %17
%284 = load i32, i32* %21
%285 = load i32, i32* %7
%286 = mul nsw i32 %284, %285
%287 = load i32, i32* %21
%288 = add nsw i32 %286, %287
%289 = sext i32 %288 to i64
%290 = getelementptr inbounds double, double* %283, i64 %289
%291 = load double, double* %290
%292 = load double*, double** %17
%293 = load i32, i32* %22
%294 = load i32, i32* %7
%295 = mul nsw i32 %293, %294
%296 = load i32, i32* %22
%297 = add nsw i32 %295, %296
%298 = sext i32 %297 to i64
%299 = getelementptr inbounds double, double* %292, i64 %298
%300 = load double, double* %299
%301 = load double*, double** %17
%302 = load i32, i32* %21
%303 = load i32, i32* %7
%304 = mul nsw i32 %302, %303
%305 = load i32, i32* %22
%306 = add nsw i32 %304, %305
%307 = sext i32 %306 to i64
%308 = getelementptr inbounds double, double* %301, i64 %307
%309 = load double, double* %308
%310 = load double*, double** %17
%311 = load i32, i32* %22
%312 = load i32, i32* %7
%313 = mul nsw i32 %311, %312
%314 = load i32, i32* %21
%315 = add nsw i32 %313, %314
%316 = sext i32 %315 to i64
%317 = getelementptr inbounds double, double* %310, i64 %316
%318 = load double, double* %317
%319 = fmul double %309, %318
%320 = fneg double %319
%321 = call double @llvm.fmuladd.f64(double %291, double %300, double %320)
%322 = call double @llvm.fmuladd.f64(double -4.000000e+00, double %321, double %282)
store double %322, double* %20
%323 = load double, double* %20
%324 = fcmp oge double %323, 0.000000e+00
br i1 %324, label %325, label %348
325: ; preds = %261
%326 = load double, double* @NAN
%327 = load double*, double** %8
%328 = load i32, i32* %23
%329 = sext i32 %328 to i64
%330 = getelementptr inbounds double, double* %327, i64 %329
store double %326, double* %330
%331 = load double, double* @NAN
%332 = load double*, double** %9
%333 = load i32, i32* %23
%334 = sext i32 %333 to i64
%335 = getelementptr inbounds double, double* %332, i64 %334
store double %331, double* %335
%336 = load double, double* @NAN
%337 = load double*, double** %8
%338 = load i32, i32* %23
%339 = add nsw i32 %338, 1
%340 = sext i32 %339 to i64
%341 = getelementptr inbounds double, double* %337, i64 %340
store double %336, double* %341
%342 = load double, double* @NAN
%343 = load double*, double** %9
%344 = load i32, i32* %23
%345 = add nsw i32 %344, 1
%346 = sext i32 %345 to i64
%347 = getelementptr inbounds double, double* %343, i64 %346
store double %342, double* %347
br label %417
348: ; preds = %261
%349 = load double*, double** %17
%350 = load i32, i32* %21
%351 = load i32, i32* %7
%352 = mul nsw i32 %350, %351
%353 = load i32, i32* %21
%354 = add nsw i32 %352, %353
%355 = sext i32 %354 to i64
%356 = getelementptr inbounds double, double* %349, i64 %355
%357 = load double, double* %356
%358 = load double*, double** %17
%359 = load i32, i32* %22
%360 = load i32, i32* %7
%361 = mul nsw i32 %359, %360
%362 = load i32, i32* %22
%363 = add nsw i32 %361, %362
%364 = sext i32 %363 to i64
%365 = getelementptr inbounds double, double* %358, i64 %364
%366 = load double, double* %365
%367 = fadd double %357, %366
%368 = fdiv double %367, 2.000000e+00
%369 = load double*, double** %8
%370 = load i32, i32* %23
%371 = sext i32 %370 to i64
%372 = getelementptr inbounds double, double* %369, i64 %371
store double %368, double* %372
%373 = load double*, double** %17
%374 = load i32, i32* %21
%375 = load i32, i32* %7
%376 = mul nsw i32 %374, %375
%377 = load i32, i32* %21
%378 = add nsw i32 %376, %377
%379 = sext i32 %378 to i64
%380 = getelementptr inbounds double, double* %373, i64 %379
%381 = load double, double* %380
%382 = load double*, double** %17
%383 = load i32, i32* %22
%384 = load i32, i32* %7
%385 = mul nsw i32 %383, %384
%386 = load i32, i32* %22
%387 = add nsw i32 %385, %386
%388 = sext i32 %387 to i64
%389 = getelementptr inbounds double, double* %382, i64 %388
%390 = load double, double* %389
%391 = fadd double %381, %390
%392 = fdiv double %391, 2.000000e+00
%393 = load double*, double** %8
%394 = load i32, i32* %23
%395 = add nsw i32 %394, 1
%396 = sext i32 %395 to i64
%397 = getelementptr inbounds double, double* %393, i64 %396
store double %392, double* %397
%398 = load double, double* %20
%399 = fneg double %398
%400 = call i32 @sqrt(double %399)
%401 = sdiv i32 %400, 2
%402 = sitofp i32 %401 to double
%403 = load double*, double** %9
%404 = load i32, i32* %23
%405 = sext i32 %404 to i64
%406 = getelementptr inbounds double, double* %403, i64 %405
store double %402, double* %406
%407 = load double, double* %20
%408 = fneg double %407
%409 = call i32 @sqrt(double %408)
%410 = sdiv i32 %409, 2
%411 = sitofp i32 %410 to double
%412 = load double*, double** %9
%413 = load i32, i32* %23
%414 = add nsw i32 %413, 1
%415 = sext i32 %414 to i64
%416 = getelementptr inbounds double, double* %412, i64 %415
store double %411, double* %416
br label %417
417: ; preds = %348, %325
br label %418
418: ; preds = %417, %238
%419 = load double, double* @NAN
%420 = load double*, double** %17
%421 = load i32, i32* %22
%422 = load i32, i32* %7
%423 = mul nsw i32 %421, %422
%424 = load i32, i32* %22
%425 = add nsw i32 %423, %424
%426 = sext i32 %425 to i64
%427 = getelementptr inbounds double, double* %420, i64 %426
store double %419, double* %427
br label %428
428: ; preds = %418, %220
br label %429
429: ; preds = %428
%430 = load i32, i32* %22
%431 = add nsw i32 %430, 1
store i32 %431, i32* %22
br label %216
432: ; preds = %216
store i32 1, i32* %13
br i1 true, label %433, label %453
433: ; preds = %432
%434 = load double*, double** %17
%435 = load i32, i32* %21
%436 = load i32, i32* %7
%437 = mul nsw i32 %435, %436
%438 = load i32, i32* %21
%439 = add nsw i32 %437, %438
%440 = sext i32 %439 to i64
%441 = getelementptr inbounds double, double* %434, i64 %440
%442 = load double, double* %441
%443 = load double*, double** %8
%444 = load i32, i32* %23
%445 = sext i32 %444 to i64
%446 = getelementptr inbounds double, double* %443, i64 %445
store double %442, double* %446
%447 = load double*, double** %9
%448 = load i32, i32* %23
%449 = sext i32 %448 to i64
%450 = getelementptr inbounds double, double* %447, i64 %449
store double 0.000000e+00, double* %450
%451 = load i32, i32* %23
%452 = add nsw i32 %451, 1
store i32 %452, i32* %23
br label %453
453: ; preds = %433, %432
store i32 0, i32* %13
br i1 false, label %454, label %457
454: ; preds = %453
%455 = load i32, i32* %23
%456 = add nsw i32 %455, 2
store i32 %456, i32* %23
br label %457
457: ; preds = %454, %453
br label %458
458: ; preds = %457, %201
br label %459
459: ; preds = %458
%460 = load i32, i32* %21
%461 = add nsw i32 %460, 1
store i32 %461, i32* %21
br label %197
462: ; preds = %197
%463 = load i32, i32* %23
%464 = load i32, i32* %7
%465 = icmp eq i32 %463, %464
br i1 %465, label %466, label %467
466: ; preds = %462
store i32 0, i32* %11
br label %468
467: ; preds = %462
store i32 1, i32* %11
br label %468
468: ; preds = %467, %466
%469 = load i32, i32* %11
ret i32 %469
}

LLVM IR (-O2):
@.str = [2 x i8] c"R\00"
@.str.1 = [2 x i8] c"N\00"
@.str.2 = [11 x i8] c"%d steps.\0A\00"
@NAN = global double 0.000000e+00
define i32 @deigvals(double* %0, i32 %1, double* nocapture writeonly %2, double* nocapture writeonly %3, double %4) {
%6 = bitcast double* %0 to i8*
%7 = mul nsw i32 %1, %1
%8 = shl i32 %7, 3
%9 = tail call double* @malloc(i32 %8)
%10 = tail call double* @malloc(i32 %8)
%11 = tail call double* @malloc(i32 %8)
%12 = bitcast double* %11 to i8*
%13 = tail call double* @malloc(i32 8)
%14 = tail call i32 @dgeqrf(i32 %1, i32 %1, double* %0, i32 %1, double* %9, double* %13, i32 -1)
%15 = load double, double* %13
%16 = fptosi double %15 to i32
%17 = tail call i32 @free(double* %13)
%18 = shl i32 %16, 3
%19 = mul i32 %18, %16
%20 = tail call double* @malloc(i32 %19)
%21 = icmp eq i32 %7, 0
%22 = icmp sgt i32 %1, 0
%23 = icmp ugt i32 %7, 1
%24 = fmul double %4, %4
%25 = zext i32 %7 to i64
%26 = shl nuw nsw i64 %25, 3
%27 = zext i32 %1 to i64
%28 = shl nuw nsw i64 %27, 3
%29 = add nsw i64 %25, -1
%30 = add nsw i64 %25, -2
%31 = and i64 %27, 1
%32 = icmp eq i32 %1, 1
%33 = and i64 %27, 4294967294
%34 = icmp eq i64 %31, 0
%35 = and i64 %29, 3
%36 = icmp ult i64 %30, 3
%37 = and i64 %29, -4
%38 = icmp eq i64 %35, 0
br label %39
39: ; preds = %5, %130
%40 = phi i32 [ 0, %5 ], [ %133, %130 ]
br i1 %21, label %42, label %41
41: ; preds = %39
br label %42
42: ; preds = %41, %39
%43 = tail call i32 @dgeqrf(i32 %1, i32 %1, double* %0, i32 %1, double* %9, double* %20, i32 %16)
br i1 %22, label %44, label %76
44: ; preds = %42
br i1 %32, label %66, label %45
45: ; preds = %44, %45
%46 = phi i64 [ %63, %45 ], [ 0, %44 ]
%47 = phi i64 [ %64, %45 ], [ 0, %44 ]
%48 = trunc i64 %46 to i32
%49 = mul i32 %48, %1
%50 = sext i32 %49 to i64
%51 = getelementptr double, double* %0, i64 %50
%52 = bitcast double* %51 to i8*
%53 = getelementptr double, double* %10, i64 %50
%54 = bitcast double* %53 to i8*
%55 = trunc i64 %46 to i32
%56 = or i32 %55, 1
%57 = mul i32 %56, %1
%58 = sext i32 %57 to i64
%59 = getelementptr double, double* %0, i64 %58
%60 = bitcast double* %59 to i8*
%61 = getelementptr double, double* %10, i64 %58
%62 = bitcast double* %61 to i8*
%63 = add nuw nsw i64 %46, 2
%64 = add i64 %47, 2
%65 = icmp eq i64 %64, %33
br i1 %65, label %66, label %45
66: ; preds = %45, %44
%67 = phi i64 [ 0, %44 ], [ %63, %45 ]
br i1 %34, label %76, label %68
68: ; preds = %66
%69 = trunc i64 %67 to i32
%70 = mul i32 %69, %1
%71 = sext i32 %70 to i64
%72 = getelementptr double, double* %0, i64 %71
%73 = bitcast double* %72 to i8*
%74 = getelementptr double, double* %10, i64 %71
%75 = bitcast double* %74 to i8*
br label %76
76: ; preds = %68, %66, %42
%77 = tail call i32 @dormqr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %1, i32 %1, i32 %1, double* %10, i32 %1, double* %9, double* %0, i32 %1, double* %20, i32 %16)
br i1 %23, label %78, label %130
78: ; preds = %76
br i1 %36, label %113, label %79
79: ; preds = %78, %79
%80 = phi i64 [ %110, %79 ], [ 1, %78 ]
%81 = phi double [ %109, %79 ], [ 0.000000e+00, %78 ]
%82 = phi i64 [ %111, %79 ], [ 0, %78 ]
%83 = getelementptr inbounds double, double* %0, i64 %80
%84 = load double, double* %83
%85 = getelementptr inbounds double, double* %11, i64 %80
%86 = load double, double* %85
%87 = fsub double %84, %86
%88 = tail call double @llvm.fmuladd.f64(double %87, double %87, double %81)
%89 = add nuw nsw i64 %80, 1
%90 = getelementptr inbounds double, double* %0, i64 %89
%91 = load double, double* %90
%92 = getelementptr inbounds double, double* %11, i64 %89
%93 = load double, double* %92
%94 = fsub double %91, %93
%95 = tail call double @llvm.fmuladd.f64(double %94, double %94, double %88)
%96 = add nuw nsw i64 %80, 2
%97 = getelementptr inbounds double, double* %0, i64 %96
%98 = load double, double* %97
%99 = getelementptr inbounds double, double* %11, i64 %96
%100 = load double, double* %99
%101 = fsub double %98, %100
%102 = tail call double @llvm.fmuladd.f64(double %101, double %101, double %95)
%103 = add nuw nsw i64 %80, 3
%104 = getelementptr inbounds double, double* %0, i64 %103
%105 = load double, double* %104
%106 = getelementptr inbounds double, double* %11, i64 %103
%107 = load double, double* %106
%108 = fsub double %105, %107
%109 = tail call double @llvm.fmuladd.f64(double %108, double %108, double %102)
%110 = add nuw nsw i64 %80, 4
%111 = add i64 %82, 4
%112 = icmp eq i64 %111, %37
br i1 %112, label %113, label %79
113: ; preds = %79, %78
%114 = phi double [ undef, %78 ], [ %109, %79 ]
%115 = phi i64 [ 1, %78 ], [ %110, %79 ]
%116 = phi double [ 0.000000e+00, %78 ], [ %109, %79 ]
br i1 %38, label %130, label %117
117: ; preds = %113, %117
%118 = phi i64 [ %127, %117 ], [ %115, %113 ]
%119 = phi double [ %126, %117 ], [ %116, %113 ]
%120 = phi i64 [ %128, %117 ], [ 0, %113 ]
%121 = getelementptr inbounds double, double* %0, i64 %118
%122 = load double, double* %121
%123 = getelementptr inbounds double, double* %11, i64 %118
%124 = load double, double* %123
%125 = fsub double %122, %124
%126 = tail call double @llvm.fmuladd.f64(double %125, double %125, double %119)
%127 = add nuw nsw i64 %118, 1
%128 = add i64 %120, 1
%129 = icmp eq i64 %128, %35
br i1 %129, label %130, label %117
130: ; preds = %113, %117, %76
%131 = phi double [ 0.000000e+00, %76 ], [ %114, %113 ], [ %126, %117 ]
%132 = fcmp uge double %131, %24
%133 = add nuw nsw i32 %40, 1
br i1 %132, label %39, label %134
134: ; preds = %130
%135 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %133)
%136 = tail call i32 @free(double* %20)
%137 = tail call i32 @free(double* %11)
%138 = tail call i32 @free(double* %9)
br i1 %22, label %139, label %237
139: ; preds = %134
%140 = fmul double %4, 1.000000e+01
%141 = zext i32 %1 to i64
br label %142
142: ; preds = %139, %233
%143 = phi i64 [ 0, %139 ], [ %155, %233 ]
%144 = phi i64 [ 1, %139 ], [ %235, %233 ]
%145 = phi i32 [ 0, %139 ], [ %234, %233 ]
%146 = trunc i64 %143 to i32
%147 = mul nsw i64 %143, %141
%148 = mul nsw i32 %146, %1
%149 = sext i32 %148 to i64
%150 = add nsw i64 %143, %149
%151 = getelementptr inbounds double, double* %10, i64 %150
%152 = load double, double* %151
%153 = tail call i64 @isnan(double %152)
%154 = icmp eq i64 %153, 0
%155 = add nuw nsw i64 %143, 1
br i1 %154, label %156, label %233
156: ; preds = %142
%157 = icmp ult i64 %155, %141
%158 = sext i32 %145 to i64
br i1 %157, label %161, label %159
159: ; preds = %156
%160 = add nsw i32 %145, 1
br label %228
161: ; preds = %156
%162 = getelementptr inbounds double, double* %2, i64 %158
%163 = getelementptr inbounds double, double* %3, i64 %158
%164 = add nsw i32 %145, 1
%165 = sext i32 %164 to i64
%166 = getelementptr inbounds double, double* %2, i64 %165
%167 = getelementptr inbounds double, double* %3, i64 %165
br label %168
168: ; preds = %161, %224
%169 = phi i64 [ %144, %161 ], [ %226, %224 ]
%170 = phi i32 [ 1, %161 ], [ %225, %224 ]
%171 = mul nsw i64 %169, %141
%172 = add nuw nsw i64 %171, %143
%173 = getelementptr inbounds double, double* %10, i64 %172
%174 = load double, double* %173
%175 = tail call i32 @abs(double %174)
%176 = sitofp i32 %175 to double
%177 = fcmp olt double %140, %176
br i1 %177, label %178, label %224
178: ; preds = %168
%179 = icmp eq i32 %170, 0
br i1 %179, label %180, label %186
180: ; preds = %178
%181 = load double, double* @NAN
store double %181, double* %162
%182 = load double, double* @NAN
store double %182, double* %163
%183 = load double, double* @NAN
store double %183, double* %166
%184 = load double, double* @NAN
store double %184, double* %167
%185 = add nuw nsw i64 %171, %169
br label %220
186: ; preds = %178
%187 = load double, double* %151
%188 = add nuw nsw i64 %171, %169
%189 = getelementptr inbounds double, double* %10, i64 %188
%190 = load double, double* %189
%191 = fadd double %187, %190
%192 = tail call i32 @pow(double %191, i32 2)
%193 = sitofp i32 %192 to double
%194 = load double, double* %151
%195 = load double, double* %189
%196 = add nuw nsw i64 %169, %147
%197 = getelementptr inbounds double, double* %10, i64 %196
%198 = load double, double* %197
%199 = load double, double* %173
%200 = fneg double %198
%201 = fmul double %199, %200
%202 = tail call double @llvm.fmuladd.f64(double %194, double %195, double %201)
%203 = tail call double @llvm.fmuladd.f64(double %202, double -4.000000e+00, double %193)
%204 = fcmp ult double %203, 0.000000e+00
br i1 %204, label %210, label %205
205: ; preds = %186
%206 = load double, double* @NAN
store double %206, double* %162
%207 = load double, double* @NAN
store double %207, double* %163
%208 = load double, double* @NAN
store double %208, double* %166
%209 = load double, double* @NAN
store double %209, double* %167
br label %220
210: ; preds = %186
%211 = fadd double %194, %195
%212 = fmul double %211, 5.000000e-01
store double %212, double* %162
store double %212, double* %166
%213 = fneg double %203
%214 = tail call i32 @sqrt(double %213)
%215 = sdiv i32 %214, 2
%216 = sitofp i32 %215 to double
store double %216, double* %163
%217 = tail call i32 @sqrt(double %213)
%218 = sdiv i32 %217, 2
%219 = sitofp i32 %218 to double
store double %219, double* %167
br label %220
220: ; preds = %205, %210, %180
%221 = phi i64 [ %188, %205 ], [ %188, %210 ], [ %185, %180 ]
%222 = load double, double* @NAN
%223 = getelementptr inbounds double, double* %10, i64 %221
store double %222, double* %223
br label %224
224: ; preds = %168, %220
%225 = phi i32 [ 0, %220 ], [ %170, %168 ]
%226 = add nuw nsw i64 %169, 1
%227 = icmp eq i64 %226, %27
br i1 %227, label %228, label %168
228: ; preds = %224, %159
%229 = phi i32 [ %160, %159 ], [ %164, %224 ]
%230 = load double, double* %151
%231 = getelementptr inbounds double, double* %2, i64 %158
store double %230, double* %231
%232 = getelementptr inbounds double, double* %3, i64 %158
store double 0.000000e+00, double* %232
br label %233
233: ; preds = %142, %228
%234 = phi i32 [ %229, %228 ], [ %145, %142 ]
%235 = add nuw nsw i64 %144, 1
%236 = icmp eq i64 %155, %27
br i1 %236, label %237, label %142
237: ; preds = %233, %134
%238 = phi i32 [ 0, %134 ], [ %234, %233 ]
%239 = icmp ne i32 %238, %1
%240 = zext i1 %239 to i32
ret i32 %240
}