#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ exit(int);
double fabs(double);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void eig2(double d[], double e[], long n, double **z) {
  double pythag(double a, double b);
  long m, l, iter, i, k;
  double s, r, p, g, f, dd, c, b;
  for (i = 1; i < n; i++)
    e[i - 1] = e[i];
  e[n - 1] = 0.0;
  for (l = 0; l < n; l++) {
    iter = 0;
    do {
      for (m = l; m < n - 1; m++) {
        dd = fabs(d[m]) + fabs(d[m + 1]);
        if ((double)(fabs(e[m]) + dd) == dd)
          break;
      }
      if (m != l) {
        if (iter++ == 30) {
          fprintf(stderr, "Iteration count exceeded in eig2");
          exit(5);
        }
        g = (d[l + 1] - d[l]) / (2.0 * e[l]);
        r = pythag(g, 1.0);
        g = d[m] - d[l] + e[l] / (g + ((g) >= 0.0 ? fabs(r) : -fabs(r)));
        s = c = 1.0;
        p = 0.0;
        for (i = m - 1; i >= l; i--) {
          f = s * e[i];
          b = c * e[i];
          e[i + 1] = (r = pythag(f, g));
          if (r == 0.0) {
            d[i + 1] -= p;
            e[m] = 0.0;
            break;
          }
          s = f / r;
          c = g / r;
          g = d[i + 1] - p;
          r = (d[i] - g) * s + 2.0 * c * b;
          d[i + 1] = g + (p = s * r);
          g = c * r - b;
          for (k = 0; k < n; k++) {
            f = z[k][i + 1];
            z[k][i + 1] = s * z[k][i] + c * f;
            z[k][i] = c * z[k][i] - s * f;
          }
        }
        if (r == 0.0 && i >= l)
          continue;
        d[l] -= p;
        e[l] = g;
        e[m] = 0.0;
      }
    } while (m != l);
  }
}


x86 assembly (clang, -O0):
<eig2>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movq   $0x1,-0x40(%rbp)
mov    -0x40(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    1190 <eig2+0x60>
mov    -0x10(%rbp),%rax
mov    -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x40(%rbp),%rcx
sub    $0x1,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    1153 <eig2+0x23>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movq   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    16f2 <eig2+0x5c2>
movq   $0x0,-0x38(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
cmp    %rcx,%rax
jge    1262 <eig2+0x132>
mov    -0x8(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xe0d(%rip),%xmm1
pand   %xmm1,%xmm0
mov    -0x8(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  0x8(%rax,%rcx,8),%xmm1
movaps 0xdf4(%rip),%xmm2
pand   %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xdd3(%rip),%xmm1
pand   %xmm1,%xmm0
addsd  -0x78(%rbp),%xmm0
ucomisd -0x78(%rbp),%xmm0
jne    124c <eig2+0x11c>
jp     124c <eig2+0x11c>
jmp    1262 <eig2+0x132>
jmp    1251 <eig2+0x121>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    11ca <eig2+0x9a>
mov    -0x28(%rbp),%rax
cmp    -0x30(%rbp),%rax
je     16c9 <eig2+0x599>
mov    -0x38(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x38(%rbp)
cmp    $0x1e,%rax
jne    12a8 <eig2+0x178>
mov    0x2d50(%rip),%rax
mov    (%rax),%edi
lea    0xd87(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x5,%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  0x8(%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x30(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  0xd45(%rip),%xmm1
mulsd  (%rax,%rcx,8),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  0xd22(%rip),%xmm1
call   1040 <pythag@plt>
movsd  %xmm0,-0x58(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x30(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
mov    -0x10(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     136b <eig2+0x23b>
movsd  -0x58(%rbp),%xmm0
movaps 0xca6(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
jmp    139a <eig2+0x26a>
movsd  -0x58(%rbp),%xmm0
movaps 0xc89(%rip),%xmm1
pand   %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
movsd  -0x98(%rbp),%xmm1
ff
movsd  -0x90(%rbp),%xmm2
ff
movsd  -0xa8(%rbp),%xmm3
ff
addsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xc3d(%rip),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  0xc30(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x28(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
cmp    -0x30(%rbp),%rax
jl     1661 <eig2+0x531>
movsd  -0x50(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x40(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x80(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x40(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x70(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm1
call   1040 <pythag@plt>
movsd  %xmm0,-0x58(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x40(%rbp),%rcx
movsd  %xmm0,0x8(%rax,%rcx,8)
movsd  -0x58(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    14a4 <eig2+0x374>
jp     14a4 <eig2+0x374>
movsd  -0x60(%rbp),%xmm1
mov    -0x8(%rbp),%rax
mov    -0x40(%rbp),%rcx
movsd  0x8(%rax,%rcx,8),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    1661 <eig2+0x531>
movsd  -0x70(%rbp),%xmm0
divsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x68(%rbp),%xmm0
divsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x40(%rbp),%rcx
movsd  0x8(%rax,%rcx,8),%xmm0
subsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  -0x68(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  0xb1f(%rip),%xmm1
mulsd  -0x80(%rbp),%xmm1
mulsd  -0x88(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
mulsd  -0x58(%rbp),%xmm1
movsd  %xmm1,-0x60(%rbp)
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
mov    -0x40(%rbp),%rcx
movsd  %xmm0,0x8(%rax,%rcx,8)
movsd  -0x80(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x88(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movq   $0x0,-0x48(%rbp)
mov    -0x48(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    164b <eig2+0x51b>
mov    -0x20(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x40(%rbp),%rcx
movsd  0x8(%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x50(%rbp),%xmm0
mov    -0x20(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x80(%rbp),%xmm1
mulsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x40(%rbp),%rcx
movsd  %xmm0,0x8(%rax,%rcx,8)
movsd  -0x80(%rbp),%xmm0
mov    -0x20(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x50(%rbp),%xmm1
mulsd  -0x70(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x40(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x48(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x48(%rbp)
jmp    1577 <eig2+0x447>
jmp    1650 <eig2+0x520>
mov    -0x40(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x40(%rbp)
jmp    13f9 <eig2+0x2c9>
movsd  -0x58(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    168c <eig2+0x55c>
jp     168c <eig2+0x55c>
mov    -0x40(%rbp),%rax
cmp    -0x30(%rbp),%rax
jl     168c <eig2+0x55c>
jmp    16ce <eig2+0x59e>
movsd  -0x60(%rbp),%xmm1
mov    -0x8(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x68(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    16ce <eig2+0x59e>
mov    -0x28(%rbp),%rax
cmp    -0x30(%rbp),%rax
jne    11c2 <eig2+0x92>
jmp    16e1 <eig2+0x5b1>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    11ac <eig2+0x7c>
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eig2>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
mov    %rcx,%rbx
mov    %rsi,%r14
mov    %rdi,%r13
cmp    $0x2,%rdx
mov    %rdx,0x8(%rsp)
jl     118d <eig2+0x4d>
lea    0x8(%r14),%rsi
lea    -0x8(,%rdx,8),%rdx
ff
mov    %r14,%rdi
call   1050 <memmove@plt>
mov    0x8(%rsp),%rdx
lea    -0x1(%rdx),%rcx
movq   $0x0,-0x8(%r14,%rdx,8)
jmp    11a2 <eig2+0x62>
movq   $0x0,-0x8(%r14,%rdx,8)
cmp    $0x1,%rdx
jne    151e <eig2+0x3de>
xor    %ecx,%ecx
mov    %rdx,%rbp
and    $0xfffffffffffffffe,%rbp
xor    %r15d,%r15d
movdqa 0xe4c(%rip),%xmm2
movsd  0xe64(%rip),%xmm1
mov    %rcx,0x18(%rsp)
mov    %r14,0x10(%rsp)
mov    0x10(%rsp),%r12
jmp    11e1 <eig2+0xa1>
nopl   (%rax)
mov    0x20(%rsp),%rdx
mov    %rdx,%r15
cmp    %rax,%rdx
je     151e <eig2+0x3de>
cmp    %rcx,%r15
mov    %rcx,%rax
cmovg  %r15,%rax
mov    %rax,0x48(%rsp)
lea    0x1(%r15),%rax
mov    %rax,0x20(%rsp)
xor    %edx,%edx
jmp    1244 <eig2+0x104>
nopl   (%rax)
movsd  0x0(%r13,%r15,8),%xmm0
subsd  %xmm8,%xmm0
movsd  %xmm0,0x0(%r13,%r15,8)
mov    0x10(%rsp),%r14
movsd  %xmm1,(%r14,%r15,8)
mov    (%rsp),%rax
movq   $0x0,(%r14,%rax,8)
mov    0x18(%rsp),%rcx
movdqa 0xdc9(%rip),%xmm2
movsd  0xde1(%rip),%xmm1
mov    0x28(%rsp),%rdx
mov    %r15,%rax
nopw   0x0(%rax,%rax,1)
cmp    %rcx,%rax
jge    1290 <eig2+0x150>
lea    0x1(%rax),%rsi
movdqu 0x0(%r13,%rax,8),%xmm0
pand   %xmm2,%xmm0
pshufd $0xee,%xmm0,%xmm3
addsd  %xmm0,%xmm3
movq   (%r14,%rax,8),%xmm0
pand   %xmm2,%xmm0
addsd  %xmm3,%xmm0
ucomisd %xmm3,%xmm0
mov    %rsi,%rax
jne    1250 <eig2+0x110>
jp     1250 <eig2+0x110>
add    $0xffffffffffffffff,%rsi
jmp    1295 <eig2+0x155>
nopl   0x0(%rax)
mov    0x48(%rsp),%rsi
cmp    %r15,%rsi
mov    0x8(%rsp),%rax
je     11d0 <eig2+0x90>
cmp    $0x1e,%rdx
je     1530 <eig2+0x3f0>
mov    0x20(%rsp),%rax
movsd  0x0(%r13,%rax,8),%xmm0
subsd  0x0(%r13,%r15,8),%xmm0
add    $0x1,%rdx
mov    %rdx,0x28(%rsp)
movsd  (%r14,%r15,8),%xmm2
addsd  %xmm2,%xmm2
divsd  %xmm2,%xmm0
movsd  %xmm0,0x30(%rsp)
mov    %rsi,(%rsp)
call   1040 <pythag@plt>
mov    (%rsp),%rax
movsd  0x0(%r13,%rax,8),%xmm4
subsd  0x0(%r13,%r15,8),%xmm4
movsd  (%r14,%r15,8),%xmm1
movapd %xmm0,%xmm2
andpd  0xcf6(%rip),%xmm2
orpd   0xcfe(%rip),%xmm0
xorpd  %xmm8,%xmm8
xorpd  %xmm3,%xmm3
movsd  0x30(%rsp),%xmm5
cmpnlesd %xmm5,%xmm3
andpd  %xmm3,%xmm0
andnpd %xmm2,%xmm3
orpd   %xmm0,%xmm3
addsd  %xmm5,%xmm3
divsd  %xmm3,%xmm1
addsd  %xmm4,%xmm1
cmp    %r15,%rax
jbe    1200 <eig2+0xc0>
xorpd  %xmm8,%xmm8
movsd  0xccc(%rip),%xmm0
movapd %xmm0,%xmm5
jmp    1371 <eig2+0x231>
nopw   0x0(%rax,%rax,1)
mulsd  %xmm5,%xmm1
subsd  %xmm7,%xmm1
cmp    %r15,%rax
jle    1200 <eig2+0xc0>
movapd %xmm1,0x70(%rsp)
movsd  %xmm5,0x58(%rsp)
movapd %xmm8,0x30(%rsp)
mov    %rax,%r14
movsd  -0x8(%r12,%rax,8),%xmm2
movsd  %xmm2,0x50(%rsp)
mulsd  %xmm2,%xmm0
movapd %xmm0,0x60(%rsp)
call   1040 <pythag@plt>
movsd  %xmm0,(%r12,%r14,8)
ucomisd 0xc77(%rip),%xmm0
jne    13b9 <eig2+0x279>
jnp    1500 <eig2+0x3c0>
lea    -0x1(%r14),%rax
movsd  0x58(%rsp),%xmm7
mulsd  0x50(%rsp),%xmm7
movapd 0x70(%rsp),%xmm5
unpcklpd 0x60(%rsp),%xmm5
unpcklpd %xmm0,%xmm0
divpd  %xmm0,%xmm5
movsd  0x0(%r13,%r14,8),%xmm3
subsd  0x30(%rsp),%xmm3
movsd  0x0(%r13,%rax,8),%xmm1
subsd  %xmm3,%xmm1
movapd %xmm5,%xmm2
addsd  %xmm5,%xmm2
mulsd  %xmm7,%xmm2
movapd %xmm5,%xmm0
unpckhpd %xmm5,%xmm0
mulsd  %xmm0,%xmm1
addsd  %xmm2,%xmm1
movapd %xmm0,%xmm8
mulsd  %xmm1,%xmm8
addsd  %xmm8,%xmm3
movsd  %xmm3,0x0(%r13,%r14,8)
movapd %xmm0,%xmm6
xorpd  0xbdd(%rip),%xmm6
mov    0x8(%rsp),%rsi
cmp    $0x1,%rsi
jne    1450 <eig2+0x310>
xor    %ecx,%ecx
jmp    14ba <eig2+0x37a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movapd %xmm6,%xmm2
unpcklpd %xmm5,%xmm2
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
mov    (%rbx,%rcx,8),%rdx
movsd  (%rdx,%r14,8),%xmm3
unpcklpd %xmm3,%xmm3
mulpd  %xmm2,%xmm3
movsd  (%rdx,%rax,8),%xmm4
unpcklpd %xmm4,%xmm4
mulpd  %xmm5,%xmm4
addpd  %xmm3,%xmm4
movupd %xmm4,(%rdx,%rax,8)
mov    0x8(%rbx,%rcx,8),%rdx
movsd  (%rdx,%r14,8),%xmm3
unpcklpd %xmm3,%xmm3
mulpd  %xmm2,%xmm3
movsd  (%rdx,%rax,8),%xmm4
unpcklpd %xmm4,%xmm4
mulpd  %xmm5,%xmm4
addpd  %xmm3,%xmm4
movupd %xmm4,(%rdx,%rax,8)
add    $0x2,%rcx
cmp    %rcx,%rbp
jne    1460 <eig2+0x320>
test   $0x1,%sil
je     1360 <eig2+0x220>
mov    (%rbx,%rcx,8),%rcx
movsd  (%rcx,%r14,8),%xmm2
unpcklpd %xmm2,%xmm2
unpcklpd %xmm5,%xmm6
mulpd  %xmm2,%xmm6
movsd  (%rcx,%rax,8),%xmm2
unpcklpd %xmm2,%xmm2
mulpd  %xmm5,%xmm2
addpd  %xmm6,%xmm2
movupd %xmm2,(%rcx,%rax,8)
jmp    1360 <eig2+0x220>
cs nopw 0x0(%rax,%rax,1)
nop
movsd  0x0(%r13,%r14,8),%xmm0
subsd  0x30(%rsp),%xmm0
movsd  %xmm0,0x0(%r13,%r14,8)
mov    0x10(%rsp),%r14
jmp    121e <eig2+0xde>
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2aa9(%rip),%rax
mov    (%rax),%edi
lea    0xaf0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x5,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"Iteration count exceeded in eig2\00"
define void @eig2(double* %0, double* %1, i64 %2, double** %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca i64
%8 = alloca double**
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
store double* %0, double** %5
store double* %1, double** %6
store i64 %2, i64* %7
store double** %3, double*** %8
store i64 1, i64* %12
br label %22
22: ; preds = %35, %4
%23 = load i64, i64* %12
%24 = load i64, i64* %7
%25 = icmp slt i64 %23, %24
br i1 %25, label %26, label %38
26: ; preds = %22
%27 = load double*, double** %6
%28 = load i64, i64* %12
%29 = getelementptr inbounds double, double* %27, i64 %28
%30 = load double, double* %29
%31 = load double*, double** %6
%32 = load i64, i64* %12
%33 = sub nsw i64 %32, 1
%34 = getelementptr inbounds double, double* %31, i64 %33
store double %30, double* %34
br label %35
35: ; preds = %26
%36 = load i64, i64* %12
%37 = add nsw i64 %36, 1
store i64 %37, i64* %12
br label %22
38: ; preds = %22
%39 = load double*, double** %6
%40 = load i64, i64* %7
%41 = sub nsw i64 %40, 1
%42 = getelementptr inbounds double, double* %39, i64 %41
store double 0.000000e+00, double* %42
store i64 0, i64* %10
br label %43
43: ; preds = %306, %38
%44 = load i64, i64* %10
%45 = load i64, i64* %7
%46 = icmp slt i64 %44, %45
br i1 %46, label %47, label %309
47: ; preds = %43
store i64 0, i64* %11
br label %48
48: ; preds = %301, %47
%49 = load i64, i64* %10
store i64 %49, i64* %9
br label %50
50: ; preds = %79, %48
%51 = load i64, i64* %9
%52 = load i64, i64* %7
%53 = sub nsw i64 %52, 1
%54 = icmp slt i64 %51, %53
br i1 %54, label %55, label %82
55: ; preds = %50
%56 = load double*, double** %5
%57 = load i64, i64* %9
%58 = getelementptr inbounds double, double* %56, i64 %57
%59 = load double, double* %58
%60 = call double @llvm.fabs.f64(double %59)
%61 = load double*, double** %5
%62 = load i64, i64* %9
%63 = add nsw i64 %62, 1
%64 = getelementptr inbounds double, double* %61, i64 %63
%65 = load double, double* %64
%66 = call double @llvm.fabs.f64(double %65)
%67 = fadd double %60, %66
store double %67, double* %19
%68 = load double*, double** %6
%69 = load i64, i64* %9
%70 = getelementptr inbounds double, double* %68, i64 %69
%71 = load double, double* %70
%72 = call double @llvm.fabs.f64(double %71)
%73 = load double, double* %19
%74 = fadd double %72, %73
%75 = load double, double* %19
%76 = fcmp oeq double %74, %75
br i1 %76, label %77, label %78
77: ; preds = %55
br label %82
78: ; preds = %55
br label %79
79: ; preds = %78
%80 = load i64, i64* %9
%81 = add nsw i64 %80, 1
store i64 %81, i64* %9
br label %50
82: ; preds = %77, %50
%83 = load i64, i64* %9
%84 = load i64, i64* %10
%85 = icmp ne i64 %83, %84
br i1 %85, label %86, label %300
86: ; preds = %82
%87 = load i64, i64* %11
%88 = add nsw i64 %87, 1
store i64 %88, i64* %11
%89 = icmp eq i64 %87, 30
br i1 %89, label %90, label %94
90: ; preds = %86
%91 = load i32, i32* @stderr
%92 = call i32 @fprintf(i32 %91, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%93 = call i32 @exit(i32 5)
unreachable
94: ; preds = %86
%95 = load double*, double** %5
%96 = load i64, i64* %10
%97 = add nsw i64 %96, 1
%98 = getelementptr inbounds double, double* %95, i64 %97
%99 = load double, double* %98
%100 = load double*, double** %5
%101 = load i64, i64* %10
%102 = getelementptr inbounds double, double* %100, i64 %101
%103 = load double, double* %102
%104 = fsub double %99, %103
%105 = load double*, double** %6
%106 = load i64, i64* %10
%107 = getelementptr inbounds double, double* %105, i64 %106
%108 = load double, double* %107
%109 = fmul double 2.000000e+00, %108
%110 = fdiv double %104, %109
store double %110, double* %17
%111 = load double, double* %17
%112 = call double @pythag(double %111, double 1.000000e+00)
store double %112, double* %15
%113 = load double*, double** %5
%114 = load i64, i64* %9
%115 = getelementptr inbounds double, double* %113, i64 %114
%116 = load double, double* %115
%117 = load double*, double** %5
%118 = load i64, i64* %10
%119 = getelementptr inbounds double, double* %117, i64 %118
%120 = load double, double* %119
%121 = fsub double %116, %120
%122 = load double*, double** %6
%123 = load i64, i64* %10
%124 = getelementptr inbounds double, double* %122, i64 %123
%125 = load double, double* %124
%126 = load double, double* %17
%127 = load double, double* %17
%128 = fcmp oge double %127, 0.000000e+00
br i1 %128, label %129, label %132
129: ; preds = %94
%130 = load double, double* %15
%131 = call double @llvm.fabs.f64(double %130)
br label %136
132: ; preds = %94
%133 = load double, double* %15
%134 = call double @llvm.fabs.f64(double %133)
%135 = fneg double %134
br label %136
136: ; preds = %132, %129
%137 = phi double [ %131, %129 ], [ %135, %132 ]
%138 = fadd double %126, %137
%139 = fdiv double %125, %138
%140 = fadd double %121, %139
store double %140, double* %17
store double 1.000000e+00, double* %20
store double 1.000000e+00, double* %14
store double 0.000000e+00, double* %16
%141 = load i64, i64* %9
%142 = sub nsw i64 %141, 1
store i64 %142, i64* %12
br label %143
143: ; preds = %275, %136
%144 = load i64, i64* %12
%145 = load i64, i64* %10
%146 = icmp sge i64 %144, %145
br i1 %146, label %147, label %278
147: ; preds = %143
%148 = load double, double* %14
%149 = load double*, double** %6
%150 = load i64, i64* %12
%151 = getelementptr inbounds double, double* %149, i64 %150
%152 = load double, double* %151
%153 = fmul double %148, %152
store double %153, double* %18
%154 = load double, double* %20
%155 = load double*, double** %6
%156 = load i64, i64* %12
%157 = getelementptr inbounds double, double* %155, i64 %156
%158 = load double, double* %157
%159 = fmul double %154, %158
store double %159, double* %21
%160 = load double, double* %18
%161 = load double, double* %17
%162 = call double @pythag(double %160, double %161)
store double %162, double* %15
%163 = load double*, double** %6
%164 = load i64, i64* %12
%165 = add nsw i64 %164, 1
%166 = getelementptr inbounds double, double* %163, i64 %165
store double %162, double* %166
%167 = load double, double* %15
%168 = fcmp oeq double %167, 0.000000e+00
br i1 %168, label %169, label %180
169: ; preds = %147
%170 = load double, double* %16
%171 = load double*, double** %5
%172 = load i64, i64* %12
%173 = add nsw i64 %172, 1
%174 = getelementptr inbounds double, double* %171, i64 %173
%175 = load double, double* %174
%176 = fsub double %175, %170
store double %176, double* %174
%177 = load double*, double** %6
%178 = load i64, i64* %9
%179 = getelementptr inbounds double, double* %177, i64 %178
store double 0.000000e+00, double* %179
br label %278
180: ; preds = %147
%181 = load double, double* %18
%182 = load double, double* %15
%183 = fdiv double %181, %182
store double %183, double* %14
%184 = load double, double* %17
%185 = load double, double* %15
%186 = fdiv double %184, %185
store double %186, double* %20
%187 = load double*, double** %5
%188 = load i64, i64* %12
%189 = add nsw i64 %188, 1
%190 = getelementptr inbounds double, double* %187, i64 %189
%191 = load double, double* %190
%192 = load double, double* %16
%193 = fsub double %191, %192
store double %193, double* %17
%194 = load double*, double** %5
%195 = load i64, i64* %12
%196 = getelementptr inbounds double, double* %194, i64 %195
%197 = load double, double* %196
%198 = load double, double* %17
%199 = fsub double %197, %198
%200 = load double, double* %14
%201 = load double, double* %20
%202 = fmul double 2.000000e+00, %201
%203 = load double, double* %21
%204 = fmul double %202, %203
%205 = call double @llvm.fmuladd.f64(double %199, double %200, double %204)
store double %205, double* %15
%206 = load double, double* %17
%207 = load double, double* %14
%208 = load double, double* %15
%209 = fmul double %207, %208
store double %209, double* %16
%210 = fadd double %206, %209
%211 = load double*, double** %5
%212 = load i64, i64* %12
%213 = add nsw i64 %212, 1
%214 = getelementptr inbounds double, double* %211, i64 %213
store double %210, double* %214
%215 = load double, double* %20
%216 = load double, double* %15
%217 = load double, double* %21
%218 = fneg double %217
%219 = call double @llvm.fmuladd.f64(double %215, double %216, double %218)
store double %219, double* %17
store i64 0, i64* %13
br label %220
220: ; preds = %271, %180
%221 = load i64, i64* %13
%222 = load i64, i64* %7
%223 = icmp slt i64 %221, %222
br i1 %223, label %224, label %274
224: ; preds = %220
%225 = load double**, double*** %8
%226 = load i64, i64* %13
%227 = getelementptr inbounds double*, double** %225, i64 %226
%228 = load double*, double** %227
%229 = load i64, i64* %12
%230 = add nsw i64 %229, 1
%231 = getelementptr inbounds double, double* %228, i64 %230
%232 = load double, double* %231
store double %232, double* %18
%233 = load double, double* %14
%234 = load double**, double*** %8
%235 = load i64, i64* %13
%236 = getelementptr inbounds double*, double** %234, i64 %235
%237 = load double*, double** %236
%238 = load i64, i64* %12
%239 = getelementptr inbounds double, double* %237, i64 %238
%240 = load double, double* %239
%241 = load double, double* %20
%242 = load double, double* %18
%243 = fmul double %241, %242
%244 = call double @llvm.fmuladd.f64(double %233, double %240, double %243)
%245 = load double**, double*** %8
%246 = load i64, i64* %13
%247 = getelementptr inbounds double*, double** %245, i64 %246
%248 = load double*, double** %247
%249 = load i64, i64* %12
%250 = add nsw i64 %249, 1
%251 = getelementptr inbounds double, double* %248, i64 %250
store double %244, double* %251
%252 = load double, double* %20
%253 = load double**, double*** %8
%254 = load i64, i64* %13
%255 = getelementptr inbounds double*, double** %253, i64 %254
%256 = load double*, double** %255
%257 = load i64, i64* %12
%258 = getelementptr inbounds double, double* %256, i64 %257
%259 = load double, double* %258
%260 = load double, double* %14
%261 = load double, double* %18
%262 = fmul double %260, %261
%263 = fneg double %262
%264 = call double @llvm.fmuladd.f64(double %252, double %259, double %263)
%265 = load double**, double*** %8
%266 = load i64, i64* %13
%267 = getelementptr inbounds double*, double** %265, i64 %266
%268 = load double*, double** %267
%269 = load i64, i64* %12
%270 = getelementptr inbounds double, double* %268, i64 %269
store double %264, double* %270
br label %271
271: ; preds = %224
%272 = load i64, i64* %13
%273 = add nsw i64 %272, 1
store i64 %273, i64* %13
br label %220
274: ; preds = %220
br label %275
275: ; preds = %274
%276 = load i64, i64* %12
%277 = add nsw i64 %276, -1
store i64 %277, i64* %12
br label %143
278: ; preds = %169, %143
%279 = load double, double* %15
%280 = fcmp oeq double %279, 0.000000e+00
br i1 %280, label %281, label %286
281: ; preds = %278
%282 = load i64, i64* %12
%283 = load i64, i64* %10
%284 = icmp sge i64 %282, %283
br i1 %284, label %285, label %286
285: ; preds = %281
br label %301
286: ; preds = %281, %278
%287 = load double, double* %16
%288 = load double*, double** %5
%289 = load i64, i64* %10
%290 = getelementptr inbounds double, double* %288, i64 %289
%291 = load double, double* %290
%292 = fsub double %291, %287
store double %292, double* %290
%293 = load double, double* %17
%294 = load double*, double** %6
%295 = load i64, i64* %10
%296 = getelementptr inbounds double, double* %294, i64 %295
store double %293, double* %296
%297 = load double*, double** %6
%298 = load i64, i64* %9
%299 = getelementptr inbounds double, double* %297, i64 %298
store double 0.000000e+00, double* %299
br label %300
300: ; preds = %286, %82
br label %301
301: ; preds = %300, %285
%302 = load i64, i64* %9
%303 = load i64, i64* %10
%304 = icmp ne i64 %302, %303
br i1 %304, label %48, label %305
305: ; preds = %301
br label %306
306: ; preds = %305
%307 = load i64, i64* %10
%308 = add nsw i64 %307, 1
store i64 %308, i64* %10
br label %43
309: ; preds = %43
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"Iteration count exceeded in eig2\00"
define void @eig2(double* nocapture %0, double* nocapture %1, i64 %2, double** nocapture %3) {
%5 = icmp sgt i64 %2, 1
br i1 %5, label %6, label %14
6: ; preds = %4
%7 = bitcast double* %1 to i8*
%8 = getelementptr double, double* %1, i64 1
%9 = bitcast double* %8 to i8*
%10 = shl i64 %2, 3
%11 = add i64 %10, -8
%12 = add nsw i64 %2, -1
%13 = getelementptr inbounds double, double* %1, i64 %12
store double 0.000000e+00, double* %13
br label %18
14: ; preds = %4
%15 = add nsw i64 %2, -1
%16 = getelementptr inbounds double, double* %1, i64 %15
store double 0.000000e+00, double* %16
%17 = icmp eq i64 %2, 1
br i1 %17, label %18, label %186
18: ; preds = %6, %14
%19 = phi i64 [ %12, %6 ], [ 0, %14 ]
%20 = and i64 %2, 1
%21 = icmp eq i64 %2, 1
%22 = and i64 %2, -2
%23 = icmp eq i64 %20, 0
br label %24
24: ; preds = %18, %184
%25 = phi i64 [ 0, %18 ], [ %27, %184 ]
%26 = call i64 @llvm.smax.i64(i64 %25, i64 %19)
%27 = add nuw nsw i64 %25, 1
%28 = getelementptr inbounds double, double* %0, i64 %27
%29 = getelementptr inbounds double, double* %0, i64 %25
%30 = getelementptr inbounds double, double* %1, i64 %25
br label %31
31: ; preds = %182, %24
%32 = phi i64 [ %54, %182 ], [ 0, %24 ]
br label %33
33: ; preds = %36, %31
%34 = phi i64 [ %25, %31 ], [ %38, %36 ]
%35 = icmp slt i64 %34, %19
br i1 %35, label %36, label %50
36: ; preds = %33
%37 = getelementptr inbounds double, double* %0, i64 %34
%38 = add nuw nsw i64 %34, 1
%39 = bitcast double* %37 to <2 x double>*
%40 = load <2 x double>, <2 x double>* %39
%41 = call <2 x double> @llvm.fabs.v2f64(<2 x double> %40)
%42 = shufflevector <2 x double> %41, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%43 = fadd <2 x double> %41, %42
%44 = extractelement <2 x double> %43, i64 0
%45 = getelementptr inbounds double, double* %1, i64 %34
%46 = load double, double* %45
%47 = tail call double @llvm.fabs.f64(double %46)
%48 = fadd double %47, %44
%49 = fcmp oeq double %48, %44
br i1 %49, label %50, label %33
50: ; preds = %36, %33
%51 = phi i64 [ %34, %36 ], [ %26, %33 ]
%52 = icmp eq i64 %51, %25
br i1 %52, label %184, label %53
53: ; preds = %50
%54 = add nuw nsw i64 %32, 1
%55 = icmp eq i64 %32, 30
br i1 %55, label %56, label %60
56: ; preds = %53
%57 = load i32, i32* @stderr
%58 = tail call i32 @fprintf(i32 %57, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%59 = tail call i32 @exit(i32 5)
unreachable
60: ; preds = %53
%61 = load double, double* %28
%62 = load double, double* %29
%63 = fsub double %61, %62
%64 = load double, double* %30
%65 = fmul double %64, 2.000000e+00
%66 = fdiv double %63, %65
%67 = tail call double @pythag(double %66, double 1.000000e+00)
%68 = getelementptr inbounds double, double* %0, i64 %51
%69 = load double, double* %68
%70 = load double, double* %29
%71 = fsub double %69, %70
%72 = load double, double* %30
%73 = fcmp ult double %66, 0.000000e+00
%74 = tail call double @llvm.fabs.f64(double %67)
%75 = fneg double %74
%76 = select i1 %73, double %75, double %74
%77 = fadd double %66, %76
%78 = fdiv double %72, %77
%79 = fadd double %71, %78
%80 = icmp ugt i64 %51, %25
br i1 %80, label %100, label %177
81: ; preds = %140, %114
%82 = phi i64 [ 0, %114 ], [ %170, %140 ]
br i1 %23, label %98, label %83
83: ; preds = %81
%84 = getelementptr inbounds double*, double** %3, i64 %82
%85 = load double*, double** %84
%86 = getelementptr inbounds double, double* %85, i64 %105
%87 = load double, double* %86
%88 = getelementptr inbounds double, double* %85, i64 %106
%89 = load double, double* %88
%90 = insertelement <2 x double> poison, double %87, i64 0
%91 = shufflevector <2 x double> %90, <2 x double> poison, <2 x i32> zeroinitializer
%92 = shufflevector <2 x double> %136, <2 x double> %119, <2 x i32> <i32 0, i32 2>
%93 = fmul <2 x double> %91, %92
%94 = insertelement <2 x double> poison, double %89, i64 0
%95 = shufflevector <2 x double> %94, <2 x double> poison, <2 x i32> zeroinitializer
%96 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %119, <2 x double> %95, <2 x double> %93)
%97 = bitcast double* %88 to <2 x double>*
store <2 x double> %96, <2 x double>* %97
br label %98
98: ; preds = %81, %83
%99 = icmp sgt i64 %106, %25
br i1 %99, label %100, label %177
100: ; preds = %60, %98
%101 = phi double [ %126, %98 ], [ 1.000000e+00, %60 ]
%102 = phi double [ %134, %98 ], [ %79, %60 ]
%103 = phi double [ %131, %98 ], [ 0.000000e+00, %60 ]
%104 = phi double [ %129, %98 ], [ 1.000000e+00, %60 ]
%105 = phi i64 [ %106, %98 ], [ %51, %60 ]
%106 = add nsw i64 %105, -1
%107 = getelementptr inbounds double, double* %1, i64 %106
%108 = load double, double* %107
%109 = fmul double %104, %108
%110 = fmul double %101, %108
%111 = tail call double @pythag(double %109, double %102)
%112 = getelementptr inbounds double, double* %1, i64 %105
store double %111, double* %112
%113 = fcmp oeq double %111, 0.000000e+00
br i1 %113, label %173, label %114
114: ; preds = %100
%115 = insertelement <2 x double> poison, double %102, i64 0
%116 = insertelement <2 x double> %115, double %109, i64 1
%117 = insertelement <2 x double> poison, double %111, i64 0
%118 = shufflevector <2 x double> %117, <2 x double> poison, <2 x i32> zeroinitializer
%119 = fdiv <2 x double> %116, %118
%120 = getelementptr inbounds double, double* %0, i64 %105
%121 = load double, double* %120
%122 = fsub double %121, %103
%123 = getelementptr inbounds double, double* %0, i64 %106
%124 = load double, double* %123
%125 = fsub double %124, %122
%126 = extractelement <2 x double> %119, i64 0
%127 = fmul double %126, 2.000000e+00
%128 = fmul double %110, %127
%129 = extractelement <2 x double> %119, i64 1
%130 = tail call double @llvm.fmuladd.f64(double %125, double %129, double %128)
%131 = fmul double %129, %130
%132 = fadd double %122, %131
store double %132, double* %120
%133 = fneg double %110
%134 = tail call double @llvm.fmuladd.f64(double %126, double %130, double %133)
%135 = fneg double %129
%136 = insertelement <2 x double> poison, double %135, i64 0
br i1 %21, label %81, label %137
137: ; preds = %114
%138 = shufflevector <2 x double> %136, <2 x double> %119, <2 x i32> <i32 0, i32 2>
%139 = shufflevector <2 x double> %136, <2 x double> %119, <2 x i32> <i32 0, i32 2>
br label %140
140: ; preds = %140, %137
%141 = phi i64 [ 0, %137 ], [ %170, %140 ]
%142 = phi i64 [ 0, %137 ], [ %171, %140 ]
%143 = getelementptr inbounds double*, double** %3, i64 %141
%144 = load double*, double** %143
%145 = getelementptr inbounds double, double* %144, i64 %105
%146 = load double, double* %145
%147 = getelementptr inbounds double, double* %144, i64 %106
%148 = load double, double* %147
%149 = insertelement <2 x double> poison, double %146, i64 0
%150 = shufflevector <2 x double> %149, <2 x double> poison, <2 x i32> zeroinitializer
%151 = fmul <2 x double> %150, %138
%152 = insertelement <2 x double> poison, double %148, i64 0
%153 = shufflevector <2 x double> %152, <2 x double> poison, <2 x i32> zeroinitializer
%154 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %119, <2 x double> %153, <2 x double> %151)
%155 = bitcast double* %147 to <2 x double>*
store <2 x double> %154, <2 x double>* %155
%156 = or i64 %141, 1
%157 = getelementptr inbounds double*, double** %3, i64 %156
%158 = load double*, double** %157
%159 = getelementptr inbounds double, double* %158, i64 %105
%160 = load double, double* %159
%161 = getelementptr inbounds double, double* %158, i64 %106
%162 = load double, double* %161
%163 = insertelement <2 x double> poison, double %160, i64 0
%164 = shufflevector <2 x double> %163, <2 x double> poison, <2 x i32> zeroinitializer
%165 = fmul <2 x double> %164, %139
%166 = insertelement <2 x double> poison, double %162, i64 0
%167 = shufflevector <2 x double> %166, <2 x double> poison, <2 x i32> zeroinitializer
%168 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %119, <2 x double> %167, <2 x double> %165)
%169 = bitcast double* %161 to <2 x double>*
store <2 x double> %168, <2 x double>* %169
%170 = add nuw nsw i64 %141, 2
%171 = add i64 %142, 2
%172 = icmp eq i64 %171, %22
br i1 %172, label %81, label %140
173: ; preds = %100
%174 = getelementptr inbounds double, double* %0, i64 %105
%175 = load double, double* %174
%176 = fsub double %175, %103
store double %176, double* %174
br label %182
177: ; preds = %98, %60
%178 = phi double [ 0.000000e+00, %60 ], [ %131, %98 ]
%179 = phi double [ %79, %60 ], [ %134, %98 ]
%180 = load double, double* %29
%181 = fsub double %180, %178
store double %181, double* %29
store double %179, double* %30
br label %182
182: ; preds = %173, %177
%183 = getelementptr inbounds double, double* %1, i64 %51
store double 0.000000e+00, double* %183
br label %31
184: ; preds = %50
%185 = icmp eq i64 %27, %2
br i1 %185, label %186, label %24
186: ; preds = %184, %14
ret void
}