#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 sqrt(double);
void eig22(double *A, int stride, double *eigre, double *eigim) {
  int N;
  double a11, a12, a21, a22, c, s, c2, s2, cs, t1, t, t2, at11, at12, at21,
      at22;
  N = stride;
  a11 = A[0];
  a12 = A[1];
  a21 = A[N];
  a22 = A[N + 1];
  if ((a12 + a21) == 0) {
    c = 1. / sqrt(2.0);
    s = c;
  } else {
    t1 = (a11 - a22) / (a12 + a21);
    t = t1 / (1. + sqrt(1 + t1 * t1));
    c = 1. / sqrt(1 + t * t);
    s = c * t;
  }
  c2 = c * c;
  s2 = s * s;
  cs = c * s;
  at11 = c2 * a11 + s2 * a22 - cs * (a12 + a21);
  at12 = c2 * a12 - s2 * a21 + cs * (a11 - a22);
  at21 = c2 * a21 - s2 * a12 + cs * (a11 - a22);
  at22 = c2 * a22 + s2 * a11 + cs * (a12 + a21);
  eigre[0] = eigre[1] = at11;
  eigim[0] = sqrt(-at12 * at21);
  eigim[1] = -sqrt(-at12 * at21);
  if (at12 * at21 >= 0) {
    if (at12 == 0) {
      c = 0;
      s = 1;
      c2 = 0;
      s2 = 1;
      cs = 0;
    } else {
      t = sqrt(at21 / at12);
      t2 = t * t;
      cs = t / (1 + t2);
      c2 = (1 + t2);
      s2 = t2 / (1 + t2);
    }
    eigim[0] = eigim[1] = 0.0;
    eigre[0] = at11 - cs * (at12 + at21);
    eigre[1] = at11 + cs * (at12 + at21);
  }
}


x86 assembly (clang, -O0):
<eig22>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x38(%rbp),%xmm0
addsd  -0x40(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11c2 <eig22+0xb2>
jp     11c2 <eig22+0xb2>
movsd  0xe6f(%rip),%xmm0
call   1030 <sqrt@plt>
cvtsi2sd %eax,%xmm1
movsd  0xe56(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
jmp    126f <eig22+0x15f>
movsd  -0x30(%rbp),%xmm0
subsd  -0x48(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
addsd  -0x40(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
movsd  -0x78(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdfe(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movsd  -0xb0(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm2
movsd  0xde1(%rip),%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x80(%rbp),%xmm0
movsd  -0x80(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdbe(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
cvtsi2sd %eax,%xmm1
movsd  0xda9(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
mulsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x50(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x58(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x50(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x60(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
addsd  -0x40(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x60(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
subsd  -0x48(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x60(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
subsd  -0x48(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x60(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
addsd  -0x40(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x98(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0xa0(%rbp),%xmm0
ff
call   1030 <sqrt@plt>
cvtsi2sd %eax,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x98(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0xa0(%rbp),%xmm0
ff
call   1030 <sqrt@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x98(%rbp),%xmm0
ff
mulsd  -0xa0(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     15d9 <eig22+0x4c9>
movsd  -0x98(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    14cc <eig22+0x3bc>
jp     14cc <eig22+0x3bc>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xb5b(%rip),%xmm0
movsd  %xmm0,-0x58(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xb46(%rip),%xmm0
movsd  %xmm0,-0x68(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
jmp    1550 <eig22+0x440>
movsd  -0xa0(%rbp),%xmm0
ff
divsd  -0x98(%rbp),%xmm0
ff
call   1030 <sqrt@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x80(%rbp),%xmm0
mulsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
movsd  0xaf7(%rip),%xmm1
addsd  -0x88(%rbp),%xmm1
ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0xade(%rip),%xmm0
addsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x60(%rbp)
movsd  -0x88(%rbp),%xmm0
ff
movsd  0xac1(%rip),%xmm1
addsd  -0x88(%rbp),%xmm1
ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x20(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x20(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
movsd  -0x90(%rbp),%xmm1
ff
movsd  -0x70(%rbp),%xmm0
movsd  -0x98(%rbp),%xmm2
ff
addsd  -0xa0(%rbp),%xmm2
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x90(%rbp),%xmm1
ff
movsd  -0x70(%rbp),%xmm0
movsd  -0x98(%rbp),%xmm2
ff
addsd  -0xa0(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eig22>:
push   %r14
push   %rbx
sub    $0x78,%rsp
mov    %rcx,%rbx
mov    %rdx,%r14
movsd  (%rdi),%xmm1
movsd  0x8(%rdi),%xmm0
movslq %esi,%rax
movsd  (%rdi,%rax,8),%xmm2
movsd  0x8(%rdi,%rax,8),%xmm4
movapd %xmm0,0x20(%rsp)
movapd %xmm0,%xmm3
movapd %xmm2,0x40(%rsp)
addsd  %xmm2,%xmm3
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm3
movapd %xmm1,0x30(%rsp)
movsd  %xmm4,0x18(%rsp)
movapd %xmm3,0x60(%rsp)
jne    11a3 <eig22+0x93>
jp     11a3 <eig22+0x93>
movsd  0xe9a(%rip),%xmm0
call   1030 <sqrt@plt>
movsd  0x18(%rsp),%xmm1
movapd 0x30(%rsp),%xmm2
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0xe72(%rip),%xmm3
divsd  %xmm0,%xmm3
movapd %xmm2,%xmm6
subsd  %xmm1,%xmm6
movapd %xmm3,%xmm7
jmp    122f <eig22+0x11f>
movapd %xmm1,%xmm0
subsd  %xmm4,%xmm0
movsd  %xmm0,0x58(%rsp)
divsd  %xmm3,%xmm0
movapd %xmm0,(%rsp)
mulsd  %xmm0,%xmm0
movsd  0xe3a(%rip),%xmm2
addsd  %xmm2,%xmm0
call   1030 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0xe22(%rip),%xmm2
addsd  %xmm2,%xmm0
movapd (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,(%rsp)
movapd %xmm1,%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
call   1030 <sqrt@plt>
movsd  0xdf7(%rip),%xmm7
movsd  0x58(%rsp),%xmm6
movsd  0x18(%rsp),%xmm1
movapd (%rsp),%xmm3
movapd 0x30(%rsp),%xmm2
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  %xmm0,%xmm7
mulsd  %xmm7,%xmm3
movapd %xmm3,%xmm0
mulsd  %xmm3,%xmm0
mulsd  %xmm7,%xmm3
mulsd  %xmm7,%xmm7
mulsd  %xmm0,%xmm1
mulsd  %xmm7,%xmm2
addsd  %xmm1,%xmm2
movapd 0x60(%rsp),%xmm1
mulsd  %xmm3,%xmm1
subsd  %xmm1,%xmm2
movapd 0x40(%rsp),%xmm5
movapd %xmm5,%xmm1
movapd 0x20(%rsp),%xmm4
unpcklpd %xmm4,%xmm1
unpcklpd %xmm0,%xmm0
mulpd  %xmm1,%xmm0
unpcklpd %xmm7,%xmm7
unpcklpd %xmm5,%xmm4
mulpd  %xmm7,%xmm4
subpd  %xmm0,%xmm4
mulsd  %xmm6,%xmm3
unpcklpd %xmm3,%xmm3
addpd  %xmm4,%xmm3
movapd %xmm3,(%rsp)
movsd  %xmm2,0x8(%r14)
movapd %xmm2,0x30(%rsp)
movsd  %xmm2,(%r14)
movapd 0xd61(%rip),%xmm0
xorpd  %xmm3,%xmm0
unpckhpd %xmm3,%xmm3
movapd %xmm3,0x20(%rsp)
mulsd  %xmm3,%xmm0
movapd %xmm0,0x40(%rsp)
call   1030 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%rbx)
movaps 0x40(%rsp),%xmm0
call   1030 <sqrt@plt>
movapd 0x20(%rsp),%xmm2
movapd (%rsp),%xmm3
neg    %eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x8(%rbx)
movapd %xmm3,%xmm1
mulsd  %xmm2,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jb     137e <eig22+0x26e>
ucomisd %xmm0,%xmm3
jne    1314 <eig22+0x204>
jnp    1347 <eig22+0x237>
movapd %xmm2,%xmm0
divsd  %xmm3,%xmm0
call   1030 <sqrt@plt>
movapd 0x20(%rsp),%xmm2
movapd (%rsp),%xmm3
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
addsd  0xcbd(%rip),%xmm1
divsd  %xmm1,%xmm0
addsd  %xmm2,%xmm3
movapd 0xcbd(%rip),%xmm1
xorpd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
movupd %xmm2,(%rbx)
unpcklpd %xmm0,%xmm1
unpcklpd %xmm3,%xmm3
mulpd  %xmm1,%xmm3
movapd 0x30(%rsp),%xmm0
unpcklpd %xmm0,%xmm0
addpd  %xmm3,%xmm0
movupd %xmm0,(%r14)
add    $0x78,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @eig22(double* %0, i32 %1, double* %2, double* %3) {
%5 = alloca double*
%6 = alloca i32
%7 = alloca double*
%8 = alloca double*
%9 = alloca i32
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double
%25 = alloca double
store double* %0, double** %5
store i32 %1, i32* %6
store double* %2, double** %7
store double* %3, double** %8
%26 = load i32, i32* %6
store i32 %26, i32* %9
%27 = load double*, double** %5
%28 = getelementptr inbounds double, double* %27, i64 0
%29 = load double, double* %28
store double %29, double* %10
%30 = load double*, double** %5
%31 = getelementptr inbounds double, double* %30, i64 1
%32 = load double, double* %31
store double %32, double* %11
%33 = load double*, double** %5
%34 = load i32, i32* %9
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds double, double* %33, i64 %35
%37 = load double, double* %36
store double %37, double* %12
%38 = load double*, double** %5
%39 = load i32, i32* %9
%40 = add nsw i32 %39, 1
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds double, double* %38, i64 %41
%43 = load double, double* %42
store double %43, double* %13
%44 = load double, double* %11
%45 = load double, double* %12
%46 = fadd double %44, %45
%47 = fcmp oeq double %46, 0.000000e+00
br i1 %47, label %48, label %53
48: ; preds = %4
%49 = call i32 @sqrt(double 2.000000e+00)
%50 = sitofp i32 %49 to double
%51 = fdiv double 1.000000e+00, %50
store double %51, double* %14
%52 = load double, double* %14
store double %52, double* %15
br label %78
53: ; preds = %4
%54 = load double, double* %10
%55 = load double, double* %13
%56 = fsub double %54, %55
%57 = load double, double* %11
%58 = load double, double* %12
%59 = fadd double %57, %58
%60 = fdiv double %56, %59
store double %60, double* %19
%61 = load double, double* %19
%62 = load double, double* %19
%63 = load double, double* %19
%64 = call double @llvm.fmuladd.f64(double %62, double %63, double 1.000000e+00)
%65 = call i32 @sqrt(double %64)
%66 = sitofp i32 %65 to double
%67 = fadd double 1.000000e+00, %66
%68 = fdiv double %61, %67
store double %68, double* %20
%69 = load double, double* %20
%70 = load double, double* %20
%71 = call double @llvm.fmuladd.f64(double %69, double %70, double 1.000000e+00)
%72 = call i32 @sqrt(double %71)
%73 = sitofp i32 %72 to double
%74 = fdiv double 1.000000e+00, %73
store double %74, double* %14
%75 = load double, double* %14
%76 = load double, double* %20
%77 = fmul double %75, %76
store double %77, double* %15
br label %78
78: ; preds = %53, %48
%79 = load double, double* %14
%80 = load double, double* %14
%81 = fmul double %79, %80
store double %81, double* %16
%82 = load double, double* %15
%83 = load double, double* %15
%84 = fmul double %82, %83
store double %84, double* %17
%85 = load double, double* %14
%86 = load double, double* %15
%87 = fmul double %85, %86
store double %87, double* %18
%88 = load double, double* %16
%89 = load double, double* %10
%90 = load double, double* %17
%91 = load double, double* %13
%92 = fmul double %90, %91
%93 = call double @llvm.fmuladd.f64(double %88, double %89, double %92)
%94 = load double, double* %18
%95 = load double, double* %11
%96 = load double, double* %12
%97 = fadd double %95, %96
%98 = fneg double %94
%99 = call double @llvm.fmuladd.f64(double %98, double %97, double %93)
store double %99, double* %22
%100 = load double, double* %16
%101 = load double, double* %11
%102 = load double, double* %17
%103 = load double, double* %12
%104 = fmul double %102, %103
%105 = fneg double %104
%106 = call double @llvm.fmuladd.f64(double %100, double %101, double %105)
%107 = load double, double* %18
%108 = load double, double* %10
%109 = load double, double* %13
%110 = fsub double %108, %109
%111 = call double @llvm.fmuladd.f64(double %107, double %110, double %106)
store double %111, double* %23
%112 = load double, double* %16
%113 = load double, double* %12
%114 = load double, double* %17
%115 = load double, double* %11
%116 = fmul double %114, %115
%117 = fneg double %116
%118 = call double @llvm.fmuladd.f64(double %112, double %113, double %117)
%119 = load double, double* %18
%120 = load double, double* %10
%121 = load double, double* %13
%122 = fsub double %120, %121
%123 = call double @llvm.fmuladd.f64(double %119, double %122, double %118)
store double %123, double* %24
%124 = load double, double* %16
%125 = load double, double* %13
%126 = load double, double* %17
%127 = load double, double* %10
%128 = fmul double %126, %127
%129 = call double @llvm.fmuladd.f64(double %124, double %125, double %128)
%130 = load double, double* %18
%131 = load double, double* %11
%132 = load double, double* %12
%133 = fadd double %131, %132
%134 = call double @llvm.fmuladd.f64(double %130, double %133, double %129)
store double %134, double* %25
%135 = load double, double* %22
%136 = load double*, double** %7
%137 = getelementptr inbounds double, double* %136, i64 1
store double %135, double* %137
%138 = load double*, double** %7
%139 = getelementptr inbounds double, double* %138, i64 0
store double %135, double* %139
%140 = load double, double* %23
%141 = fneg double %140
%142 = load double, double* %24
%143 = fmul double %141, %142
%144 = call i32 @sqrt(double %143)
%145 = sitofp i32 %144 to double
%146 = load double*, double** %8
%147 = getelementptr inbounds double, double* %146, i64 0
store double %145, double* %147
%148 = load double, double* %23
%149 = fneg double %148
%150 = load double, double* %24
%151 = fmul double %149, %150
%152 = call i32 @sqrt(double %151)
%153 = sub nsw i32 0, %152
%154 = sitofp i32 %153 to double
%155 = load double*, double** %8
%156 = getelementptr inbounds double, double* %155, i64 1
store double %154, double* %156
%157 = load double, double* %23
%158 = load double, double* %24
%159 = fmul double %157, %158
%160 = fcmp oge double %159, 0.000000e+00
br i1 %160, label %161, label %206
161: ; preds = %78
%162 = load double, double* %23
%163 = fcmp oeq double %162, 0.000000e+00
br i1 %163, label %164, label %165
164: ; preds = %161
store double 0.000000e+00, double* %14
store double 1.000000e+00, double* %15
store double 0.000000e+00, double* %16
store double 1.000000e+00, double* %17
store double 0.000000e+00, double* %18
br label %184
165: ; preds = %161
%166 = load double, double* %24
%167 = load double, double* %23
%168 = fdiv double %166, %167
%169 = call i32 @sqrt(double %168)
%170 = sitofp i32 %169 to double
store double %170, double* %20
%171 = load double, double* %20
%172 = load double, double* %20
%173 = fmul double %171, %172
store double %173, double* %21
%174 = load double, double* %20
%175 = load double, double* %21
%176 = fadd double 1.000000e+00, %175
%177 = fdiv double %174, %176
store double %177, double* %18
%178 = load double, double* %21
%179 = fadd double 1.000000e+00, %178
store double %179, double* %16
%180 = load double, double* %21
%181 = load double, double* %21
%182 = fadd double 1.000000e+00, %181
%183 = fdiv double %180, %182
store double %183, double* %17
br label %184
184: ; preds = %165, %164
%185 = load double*, double** %8
%186 = getelementptr inbounds double, double* %185, i64 1
store double 0.000000e+00, double* %186
%187 = load double*, double** %8
%188 = getelementptr inbounds double, double* %187, i64 0
store double 0.000000e+00, double* %188
%189 = load double, double* %22
%190 = load double, double* %18
%191 = load double, double* %23
%192 = load double, double* %24
%193 = fadd double %191, %192
%194 = fneg double %190
%195 = call double @llvm.fmuladd.f64(double %194, double %193, double %189)
%196 = load double*, double** %7
%197 = getelementptr inbounds double, double* %196, i64 0
store double %195, double* %197
%198 = load double, double* %22
%199 = load double, double* %18
%200 = load double, double* %23
%201 = load double, double* %24
%202 = fadd double %200, %201
%203 = call double @llvm.fmuladd.f64(double %199, double %202, double %198)
%204 = load double*, double** %7
%205 = getelementptr inbounds double, double* %204, i64 1
store double %203, double* %205
br label %206
206: ; preds = %184, %78
ret void
}

LLVM IR (-O2):
define void @eig22(double* nocapture %0, i32 %1, double* nocapture writeonly %2, double* nocapture writeonly %3) {
%5 = load double, double* %0
%6 = getelementptr inbounds double, double* %0, i64 1
%7 = load double, double* %6
%8 = sext i32 %1 to i64
%9 = getelementptr inbounds double, double* %0, i64 %8
%10 = load double, double* %9
%11 = add nsw i32 %1, 1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds double, double* %0, i64 %12
%14 = load double, double* %13
%15 = fadd double %7, %10
%16 = fcmp oeq double %15, 0.000000e+00
br i1 %16, label %17, label %22
17: ; preds = %4
%18 = tail call i32 @sqrt(double 2.000000e+00)
%19 = sitofp i32 %18 to double
%20 = fdiv double 1.000000e+00, %19
%21 = fsub double %5, %14
br label %35
22: ; preds = %4
%23 = fsub double %5, %14
%24 = fdiv double %23, %15
%25 = tail call double @llvm.fmuladd.f64(double %24, double %24, double 1.000000e+00)
%26 = tail call i32 @sqrt(double %25)
%27 = sitofp i32 %26 to double
%28 = fadd double %27, 1.000000e+00
%29 = fdiv double %24, %28
%30 = tail call double @llvm.fmuladd.f64(double %29, double %29, double 1.000000e+00)
%31 = tail call i32 @sqrt(double %30)
%32 = sitofp i32 %31 to double
%33 = fdiv double 1.000000e+00, %32
%34 = fmul double %33, %29
br label %35
35: ; preds = %22, %17
%36 = phi double [ %23, %22 ], [ %21, %17 ]
%37 = phi double [ %34, %22 ], [ %20, %17 ]
%38 = phi double [ %33, %22 ], [ %20, %17 ]
%39 = fmul double %38, %38
%40 = fmul double %37, %37
%41 = fmul double %37, %38
%42 = fmul double %14, %40
%43 = tail call double @llvm.fmuladd.f64(double %39, double %5, double %42)
%44 = fneg double %41
%45 = tail call double @llvm.fmuladd.f64(double %44, double %15, double %43)
%46 = fneg double %40
%47 = insertelement <2 x double> poison, double %10, i64 0
%48 = insertelement <2 x double> %47, double %7, i64 1
%49 = insertelement <2 x double> poison, double %46, i64 0
%50 = shufflevector <2 x double> %49, <2 x double> poison, <2 x i32> zeroinitializer
%51 = fmul <2 x double> %48, %50
%52 = insertelement <2 x double> poison, double %39, i64 0
%53 = shufflevector <2 x double> %52, <2 x double> poison, <2 x i32> zeroinitializer
%54 = insertelement <2 x double> poison, double %7, i64 0
%55 = insertelement <2 x double> %54, double %10, i64 1
%56 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %53, <2 x double> %55, <2 x double> %51)
%57 = insertelement <2 x double> poison, double %41, i64 0
%58 = shufflevector <2 x double> %57, <2 x double> poison, <2 x i32> zeroinitializer
%59 = insertelement <2 x double> poison, double %36, i64 0
%60 = shufflevector <2 x double> %59, <2 x double> poison, <2 x i32> zeroinitializer
%61 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %58, <2 x double> %60, <2 x double> %56)
%62 = getelementptr inbounds double, double* %2, i64 1
store double %45, double* %62
store double %45, double* %2
%63 = extractelement <2 x double> %61, i64 0
%64 = fneg double %63
%65 = extractelement <2 x double> %61, i64 1
%66 = fmul double %65, %64
%67 = tail call i32 @sqrt(double %66)
%68 = sitofp i32 %67 to double
store double %68, double* %3
%69 = tail call i32 @sqrt(double %66)
%70 = sub nsw i32 0, %69
%71 = sitofp i32 %70 to double
%72 = getelementptr inbounds double, double* %3, i64 1
store double %71, double* %72
%73 = fmul double %63, %65
%74 = fcmp ult double %73, 0.000000e+00
br i1 %74, label %97, label %75
75: ; preds = %35
%76 = fcmp oeq double %63, 0.000000e+00
br i1 %76, label %84, label %77
77: ; preds = %75
%78 = fdiv double %65, %63
%79 = tail call i32 @sqrt(double %78)
%80 = sitofp i32 %79 to double
%81 = fmul double %80, %80
%82 = fadd double %81, 1.000000e+00
%83 = fdiv double %80, %82
br label %84
84: ; preds = %75, %77
%85 = phi double [ %83, %77 ], [ 0.000000e+00, %75 ]
%86 = fadd double %63, %65
%87 = fneg double %85
%88 = bitcast double* %3 to i8*
%89 = insertelement <2 x double> poison, double %87, i64 0
%90 = insertelement <2 x double> %89, double %85, i64 1
%91 = insertelement <2 x double> poison, double %86, i64 0
%92 = shufflevector <2 x double> %91, <2 x double> poison, <2 x i32> zeroinitializer
%93 = insertelement <2 x double> poison, double %45, i64 0
%94 = shufflevector <2 x double> %93, <2 x double> poison, <2 x i32> zeroinitializer
%95 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %90, <2 x double> %92, <2 x double> %94)
%96 = bitcast double* %2 to <2 x double>*
store <2 x double> %95, <2 x double>* %96
br label %97
97: ; preds = %84, %35
ret void
}