// File: /workspace/github_c_makefile_star2_O2/ugobas[P]tnm/tred2.c
// Function: tred2
void tred2(double **a, int n, double d[], double e[])
{
  int l,k,j,i;
  double scale,hh,h,g,f;

  for (i=n;i>=2;i--) {
    l=i-1;
    h=scale=0.0;
    if (l > 1) {
      for (k=1;k<=l;k++)
	scale += fabs(a[i][k]);
      if (scale == 0.0)
	e[i]=a[i][l];
      else {
	for (k=1;k<=l;k++) {
	  a[i][k] /= scale;
	  h += a[i][k]*a[i][k];
	}
	f=a[i][l];
	g=(f >= 0.0 ? -sqrt(h) : sqrt(h));
	e[i]=scale*g;
	h -= f*g;
	a[i][l]=f-g;
	f=0.0;
	for (j=1;j<=l;j++) {
	  a[j][i]=a[i][j]/h;
	  g=0.0;
	  for (k=1;k<=j;k++)
	    g += a[j][k]*a[i][k];
	  for (k=j+1;k<=l;k++)
	    g += a[k][j]*a[i][k];
	  e[j]=g/h;
	  f += e[j]*a[i][j];
	}
	hh=f/(h+h);
	for (j=1;j<=l;j++) {
	  f=a[i][j];
	  e[j]=g=e[j]-hh*f;
	  for (k=1;k<=j;k++)
	    a[j][k] -= (f*e[k]+g*a[i][k]);
	}
      }
    } else
      e[i]=a[i][l];
    d[i]=h;
  }
  d[1]=0.0;
  e[1]=0.0;
  /* Contents of this loop can be omitted if eigenvectors not
     wanted except for statement d[i]=a[i][i]; */
  for (i=1;i<=n;i++) {
    l=i-1;
    if (d[i]) {
      for (j=1;j<=l;j++) {
	g=0.0;
	for (k=1;k<=l;k++)
	  g += a[i][k]*a[k][j];
	for (k=1;k<=l;k++)
	  a[k][j] -= g*a[k][i];
      }
    }
    d[i]=a[i][i];
    a[i][i]=1.0;
    for (j=1;j<=l;j++) a[j][i]=a[i][j]=0.0;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %r12
movq %rdx, %rbx
movq %rdi, %r15
movabsq $0x100000000, %r13      # imm = 0x100000000
movq %rsi, (%rsp)
movslq %esi, %rbp
leaq 0x10(%rdi), %r11
pushq $0x1
popq %rdi
movapd 0xbcb9(%rip), %xmm6     # 0x51240
xorpd %xmm7, %xmm7
movapd 0x5b2d(%rip), %xmm5     # 0x4b0c0
movq %r11, 0x8(%rsp)
cmpq $0x2, %rbp
jl 0x457fe
leaq -0x1(%rbp), %r14
cmpq $0x2, %rbp
jne 0x455bd
movq (%r11), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, 0x10(%r12)
jmp 0x455f7
xorpd %xmm4, %xmm4
movq %rdi, %rax
cmpq %rbp, %rax
jge 0x455df
movq (%r15,%rbp,8), %rcx
movsd (%rcx,%rax,8), %xmm0
andpd %xmm6, %xmm0
addsd %xmm0, %xmm4
incq %rax
jmp 0x455c4
ucomisd %xmm7, %xmm4
jne 0x45607
jp 0x45607
movq (%r15,%rbp,8), %rax
movsd (%rax,%r14,8), %xmm0
movsd %xmm0, (%r12,%rbp,8)
xorpd %xmm8, %xmm8
movsd %xmm8, (%rbx,%rbp,8)
movq %r14, %rbp
jmp 0x45598
movq (%r15,%rbp,8), %rax
xorpd %xmm8, %xmm8
movq %rdi, %rcx
cmpq %rbp, %rcx
jge 0x45634
movsd (%rax,%rcx,8), %xmm0
divsd %xmm4, %xmm0
movsd %xmm0, (%rax,%rcx,8)
mulsd %xmm0, %xmm0
addsd %xmm0, %xmm8
incq %rcx
jmp 0x45613
movsd (%rax,%r14,8), %xmm9
ucomisd %xmm7, %xmm8
jb 0x45648
sqrtsd %xmm8, %xmm0
jmp 0x45696
movapd %xmm8, %xmm0
movsd %xmm8, 0x20(%rsp)
movsd %xmm4, 0x18(%rsp)
movsd %xmm9, 0x10(%rsp)
callq 0x2290
movsd 0x10(%rsp), %xmm9
movsd 0x18(%rsp), %xmm4
movsd 0x20(%rsp), %xmm8
xorpd %xmm7, %xmm7
movapd 0xbbba(%rip), %xmm6     # 0x51240
pushq $0x1
popq %rdi
movq 0x8(%rsp), %r11
movapd 0x5a2a(%rip), %xmm5     # 0x4b0c0
xorpd %xmm1, %xmm1
xorpd %xmm2, %xmm2
cmpnlesd %xmm9, %xmm2
movapd %xmm2, %xmm3
andpd %xmm0, %xmm3
xorpd %xmm5, %xmm0
andnpd %xmm0, %xmm2
orpd %xmm3, %xmm2
mulsd %xmm2, %xmm4
movsd %xmm4, (%r12,%rbp,8)
movapd %xmm9, %xmm0
mulsd %xmm2, %xmm0
subsd %xmm0, %xmm8
subsd %xmm2, %xmm9
movq (%r15,%rbp,8), %rax
movsd %xmm9, (%rax,%r14,8)
leaq 0x10(%rax), %rcx
movq %r11, %rdx
movabsq $0x200000000, %rsi      # imm = 0x200000000
cmpq %rbp, %rdi
jge 0x45786
movsd (%rax,%rdi,8), %xmm0
divsd %xmm8, %xmm0
movq (%r15,%rdi,8), %r8
movsd %xmm0, (%r8,%rbp,8)
xorpd %xmm0, %xmm0
xorl %r9d, %r9d
cmpq %r9, %rdi
je 0x45730
movsd 0x8(%r8,%r9,8), %xmm2
mulsd 0x8(%rax,%r9,8), %xmm2
addsd %xmm2, %xmm0
incq %r9
jmp 0x45714
xorl %r8d, %r8d
movq %rsi, %r9
movq %r9, %r10
sarq $0x20, %r10
cmpq %rbp, %r10
jge 0x4575f
movq (%rdx,%r8), %r10
movsd (%r10,%rdi,8), %xmm2
mulsd (%rcx,%r8), %xmm2
addsd %xmm2, %xmm0
addq %r13, %r9
addq $0x8, %r8
jmp 0x45736
divsd %xmm8, %xmm0
movsd %xmm0, (%r12,%rdi,8)
mulsd (%rax,%rdi,8), %xmm0
incq %rdi
addsd %xmm0, %xmm1
addq %r13, %rsi
addq $0x8, %rcx
addq $0x8, %rdx
jmp 0x456f0
movapd %xmm8, %xmm0
addsd %xmm8, %xmm0
xorpd %xmm5, %xmm1
divsd %xmm0, %xmm1
pushq $0x1
popq %rdi
movq %rdi, %rcx
cmpq %rbp, %rcx
jge 0x455fc
movsd (%rax,%rcx,8), %xmm0
movapd %xmm1, %xmm2
mulsd %xmm0, %xmm2
addsd (%r12,%rcx,8), %xmm2
movsd %xmm2, (%r12,%rcx,8)
movq (%r15,%rcx,8), %rdx
xorl %esi, %esi
cmpq %rsi, %rcx
je 0x457f9
movsd 0x8(%rax,%rsi,8), %xmm3
mulsd %xmm2, %xmm3
movsd 0x8(%r12,%rsi,8), %xmm4
mulsd %xmm0, %xmm4
addsd %xmm3, %xmm4
movsd 0x8(%rdx,%rsi,8), %xmm3
subsd %xmm4, %xmm3
movsd %xmm3, 0x8(%rdx,%rsi,8)
incq %rsi
jmp 0x457c6
incq %rcx
jmp 0x4579e
andq $0x0, 0x8(%rbx)
andq $0x0, 0x8(%r12)
xorl %eax, %eax
movq (%rsp), %r10
testl %r10d, %r10d
cmovlel %eax, %r10d
incl %r10d
pushq $0x1
popq %rcx
xorpd %xmm0, %xmm0
movabsq $0x3ff0000000000000, %rdx # imm = 0x3FF0000000000000
movq %rcx, %rsi
cmpq %r10, %rsi
je 0x458e5
movsd (%rbx,%rsi,8), %xmm1
ucomisd %xmm0, %xmm1
jne 0x45843
jnp 0x458a9
movq %rcx, %rdi
cmpq %rsi, %rdi
je 0x458a9
xorpd %xmm1, %xmm1
xorl %r8d, %r8d
cmpq %r8, %rax
je 0x45877
movq (%r15,%rsi,8), %r9
movsd 0x8(%r9,%r8), %xmm2
movq 0x8(%r15,%r8), %r9
mulsd (%r9,%rdi,8), %xmm2
addsd %xmm2, %xmm1
addq $0x8, %r8
jmp 0x45852
xorpd %xmm5, %xmm1
xorl %r8d, %r8d
cmpq %r8, %rax
je 0x458a4
movq 0x8(%r15,%r8), %r9
movsd (%r9,%rsi,8), %xmm2
mulsd %xmm1, %xmm2
addsd (%r9,%rdi,8), %xmm2
movsd %xmm2, (%r9,%rdi,8)
addq $0x8, %r8
jmp 0x4587e
incq %rdi
jmp 0x45846
movq (%r15,%rsi,8), %rdi
movsd (%rdi,%rsi,8), %xmm1
movsd %xmm1, (%rbx,%rsi,8)
movq %rdx, (%rdi,%rsi,8)
xorl %r8d, %r8d
cmpq %r8, %rax
je 0x458d9
andq $0x0, 0x8(%rdi,%r8)
movq 0x8(%r15,%r8), %r9
andq $0x0, (%r9,%rsi,8)
addq $0x8, %r8
jmp 0x458be
incq %rsi
addq $0x8, %rax
jmp 0x4582d
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq