// File: /workspace/github_c_makefile_star2_O1/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
movq %rsi, (%rsp)
cmpl $0x2, %esi
jl 0x4b89a
movabsq $0x100000000, %r13      # imm = 0x100000000
movl (%rsp), %ebp
leaq 0x10(%r15), %rax
movq %rax, 0x20(%rsp)
movapd 0xbcfe(%rip), %xmm5     # 0x57330
xorpd %xmm6, %xmm6
movapd 0x5a52(%rip), %xmm7     # 0x51090
leaq -0x1(%rbp), %r14
movq (%r15,%rbp,8), %rax
cmpq $0x2, %rbp
jne 0x4b652
addq $0x8, %rax
jmp 0x4b680
xorpd %xmm4, %xmm4
movl $0x1, %ecx
movsd (%rax,%rcx,8), %xmm0
andpd %xmm5, %xmm0
addsd %xmm0, %xmm4
incq %rcx
cmpq %rcx, %rbp
jne 0x4b65b
ucomisd %xmm6, %xmm4
movq (%r15,%rbp,8), %rax
jne 0x4b6a3
jp 0x4b6a3
leaq (%rax,%r14,8), %rax
movsd (%rax), %xmm0
movsd %xmm0, (%r12,%rbp,8)
xorpd %xmm8, %xmm8
movsd %xmm8, (%rbx,%rbp,8)
cmpq $0x2, %rbp
movq %r14, %rbp
jg 0x4b63e
jmp 0x4b89a
xorpd %xmm8, %xmm8
movl $0x1, %ecx
movsd (%rax,%rcx,8), %xmm0
divsd %xmm4, %xmm0
movsd %xmm0, (%rax,%rcx,8)
mulsd %xmm0, %xmm0
addsd %xmm0, %xmm8
incq %rcx
cmpq %rcx, %rbp
jne 0x4b6ad
movq (%r15,%rbp,8), %rax
movsd (%rax,%r14,8), %xmm9
ucomisd %xmm6, %xmm8
jb 0x4b6e7
xorps %xmm0, %xmm0
sqrtsd %xmm8, %xmm0
jmp 0x4b72d
movapd %xmm8, %xmm0
movsd %xmm8, 0x18(%rsp)
movsd %xmm4, 0x10(%rsp)
movsd %xmm9, 0x8(%rsp)
callq 0x2290
movsd 0x8(%rsp), %xmm9
movsd 0x10(%rsp), %xmm4
movsd 0x18(%rsp), %xmm8
movapd 0x596f(%rip), %xmm7     # 0x51090
xorpd %xmm6, %xmm6
movapd 0xbc03(%rip), %xmm5     # 0x57330
xorpd %xmm1, %xmm1
xorpd %xmm2, %xmm2
cmpnlesd %xmm9, %xmm2
movapd %xmm2, %xmm3
andpd %xmm0, %xmm3
xorpd %xmm7, %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
movl $0x1, %r8d
movabsq $0x300000000, %rdx      # imm = 0x300000000
movq 0x20(%rsp), %rsi
movq %r8, %rdi
movsd (%rax,%r8,8), %xmm0
divsd %xmm8, %xmm0
movq (%r15,%r8,8), %r8
movsd %xmm0, (%r8,%rbp,8)
xorl %r9d, %r9d
xorpd %xmm0, %xmm0
movsd 0x8(%r8,%r9,8), %xmm2
mulsd 0x8(%rax,%r9,8), %xmm2
addsd %xmm2, %xmm0
incq %r9
cmpq %r9, %rdi
jne 0x4b7ae
leaq 0x1(%rdi), %r8
cmpq %rbp, %r8
jge 0x4b7fe
movq %rdx, %r9
xorl %r10d, %r10d
movq (%rsi,%r10), %r11
movsd (%r11,%rdi,8), %xmm2
mulsd (%rcx,%r10), %xmm2
addsd %xmm2, %xmm0
movq %r9, %r11
sarq $0x20, %r11
addq $0x8, %r10
addq %r13, %r9
cmpq %rbp, %r11
jl 0x4b7d7
divsd %xmm8, %xmm0
movsd %xmm0, (%r12,%rdi,8)
mulsd (%rax,%rdi,8), %xmm0
addsd %xmm0, %xmm1
addq $0x8, %rcx
addq $0x8, %rsi
addq %r13, %rdx
cmpq %rbp, %r8
jne 0x4b78f
movapd %xmm8, %xmm0
addsd %xmm8, %xmm0
xorpd %xmm7, %xmm1
divsd %xmm0, %xmm1
movl $0x1, %ecx
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
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
cmpq %rsi, %rcx
jne 0x4b85c
incq %rcx
cmpq %rbp, %rcx
jne 0x4b83d
jmp 0x4b68f
xorl %eax, %eax
movq %rax, 0x8(%rbx)
movq %rax, 0x8(%r12)
movq (%rsp), %r11
testl %r11d, %r11d
jle 0x4b996
incl %r11d
movl $0x1, %eax
xorl %ecx, %ecx
xorpd %xmm0, %xmm0
movapd 0x57c8(%rip), %xmm1     # 0x51090
movabsq $0x3ff0000000000000, %rdx # imm = 0x3FF0000000000000
xorl %esi, %esi
ucomisd (%rbx,%rax,8), %xmm0
setnp %dil
sete %r8b
andb %dil, %r8b
cmpq $0x2, %rax
setb %dil
orb %r8b, %dil
jne 0x4b954
movq (%r15,%rax,8), %rdi
movl $0x1, %r8d
xorpd %xmm2, %xmm2
xorl %r9d, %r9d
movsd 0x8(%rdi,%r9), %xmm3
movq 0x8(%r15,%r9), %r10
mulsd (%r10,%r8,8), %xmm3
addsd %xmm3, %xmm2
addq $0x8, %r9
cmpq %r9, %rsi
jne 0x4b902
xorpd %xmm1, %xmm2
xorl %r9d, %r9d
movq 0x8(%r15,%r9), %r10
movsd (%r10,%rax,8), %xmm3
mulsd %xmm2, %xmm3
addsd (%r10,%r8,8), %xmm3
movsd %xmm3, (%r10,%r8,8)
addq $0x8, %r9
cmpq %r9, %rsi
jne 0x4b928
incq %r8
cmpq %rax, %r8
jne 0x4b8fb
movq (%r15,%rax,8), %rdi
movsd (%rdi,%rax,8), %xmm2
movsd %xmm2, (%rbx,%rax,8)
movq %rdx, (%rdi,%rax,8)
cmpq $0x2, %rax
jb 0x4b986
xorl %r8d, %r8d
movq %rcx, 0x8(%rdi,%r8)
movq 0x8(%r15,%r8), %r9
movq %rcx, (%r9,%rax,8)
addq $0x8, %r8
cmpq %r8, %rsi
jne 0x4b96f
incq %rax
addq $0x8, %rsi
cmpq %r11, %rax
jne 0x4b8d4
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)