// File: /workspace/github_c_makefile_star2_O3/ugobas[P]tnm/tqli.c
// Function: tqli
int tqli(double d[], double e[], int n, double **z)
{
  double pythag(double a, double b);
  int m,l,iter,i,k;
  double s,r,p,g,f,dd,c,b;

  for (i=2;i<=n;i++) e[i-1]=e[i];
  e[n]=0.0;
  for (l=1;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++ == 300) return( 0);
	g=(d[l+1]-d[l])/(2.0*e[l]);
	r=pythag(g,1.0);
	g=d[m]-d[l]+e[l]/(g+SIGN(r,g));
	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=1;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);
  }
  return( 1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rcx, %rbx
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %r12
movl %edx, %r13d
cmpl $0x2, %edx
jge 0x4c10c
movslq %r14d, %rax
movq $0x0, (%r15,%rax,8)
movl $0x1, %eax
cmpl $0x1, %r14d
je 0x4c129
jmp 0x4c43a
leaq 0x8(%r15), %rdi
leaq 0x10(%r15), %rsi
leal -0x1(%r14), %edx
shlq $0x3, %rdx
callq 0x2210
movq $0x0, (%r15,%r13,8)
movq %r14, 0x50(%rsp)
leal 0x1(%r14), %ebp
movl $0x1, %eax
movq %rax, 0x8(%rsp)
movl $0x1, %edx
movq %r13, 0x48(%rsp)
subq %r13, %rdx
movq $0x0, 0x28(%rsp)
movsd 0x4fee(%rip), %xmm1     # 0x51148
movdqa 0xb18e(%rip), %xmm6     # 0x572f0
movq %rdx, 0x18(%rsp)
xorl %ecx, %ecx
movq 0x28(%rsp), %r13
movq %rdx, %rax
addq %r13, %rax
je 0x4c1a9
movdqu 0x8(%r12,%r13,8), %xmm0
pand %xmm6, %xmm0
pshufd $0xee, %xmm0, %xmm2     # xmm2 = xmm0[2,3,2,3]
addsd %xmm0, %xmm2
movq 0x8(%r15,%r13,8), %xmm0
pand %xmm6, %xmm0
addsd %xmm2, %xmm0
incq %r13
ucomisd %xmm2, %xmm0
jne 0x4c16e
jp 0x4c16e
movl %r13d, %eax
jmp 0x4c1b3
movq 0x48(%rsp), %rax
movq 0x50(%rsp), %r13
cmpq 0x8(%rsp), %rax
je 0x4c416
cmpl $0x12c, %ecx            # imm = 0x12C
je 0x4c438
movl %ecx, 0x14(%rsp)
movq %rax, 0x20(%rsp)
movq 0x8(%rsp), %r14
movsd 0x8(%r12,%r14,8), %xmm0
subsd (%r12,%r14,8), %xmm0
movsd (%r15,%r14,8), %xmm2
addsd %xmm2, %xmm2
divsd %xmm2, %xmm0
movsd %xmm0, 0x30(%rsp)
callq 0x4b5dc
movapd 0xb0ea(%rip), %xmm6     # 0x572f0
movq 0x20(%rsp), %rax
movsd (%r12,%rax,8), %xmm2
movsd (%r12,%r14,8), %xmm5
subsd %xmm5, %xmm2
movsd (%r15,%r14,8), %xmm7
movapd %xmm0, %xmm3
andpd %xmm6, %xmm3
orpd 0x4e5f(%rip), %xmm0     # 0x51090
xorpd %xmm8, %xmm8
xorpd %xmm4, %xmm4
movsd 0x30(%rsp), %xmm1
cmpnlesd %xmm1, %xmm4
andpd %xmm4, %xmm0
andnpd %xmm3, %xmm4
orpd %xmm0, %xmm4
addsd %xmm1, %xmm4
divsd %xmm4, %xmm7
addsd %xmm2, %xmm7
cmpq %r14, 0x20(%rsp)
movq 0x20(%rsp), %r14
jbe 0x4c3b3
movslq %r13d, %r13
movsd 0x4ed0(%rip), %xmm0     # 0x51148
movapd %xmm0, %xmm3
movapd %xmm7, 0x70(%rsp)
movapd %xmm3, 0x80(%rsp)
movapd %xmm8, 0x30(%rsp)
movsd -0x8(%r15,%r13,8), %xmm1
movsd %xmm1, 0x58(%rsp)
mulsd %xmm1, %xmm0
movapd %xmm0, 0x60(%rsp)
movapd %xmm7, %xmm1
callq 0x4b5dc
movsd %xmm0, (%r15,%r13,8)
ucomisd 0x4eb8(%rip), %xmm0     # 0x51178
jne 0x4c2c8
jnp 0x4c3dc
leaq -0x1(%r13), %rax
movapd 0x80(%rsp), %xmm1
mulsd 0x58(%rsp), %xmm1
movapd 0x70(%rsp), %xmm3
unpcklpd 0x60(%rsp), %xmm3       # xmm3 = xmm3[0],mem[0]
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
divpd %xmm0, %xmm3
movsd (%r12,%r13,8), %xmm4
subsd 0x30(%rsp), %xmm4
movsd (%r12,%rax,8), %xmm7
subsd %xmm4, %xmm7
movapd %xmm3, %xmm2
addsd %xmm3, %xmm2
mulsd %xmm1, %xmm2
movapd %xmm3, %xmm0
unpckhpd %xmm3, %xmm0            # xmm0 = xmm0[1],xmm3[1]
mulsd %xmm0, %xmm7
addsd %xmm2, %xmm7
movapd %xmm0, %xmm8
mulsd %xmm7, %xmm8
addsd %xmm8, %xmm4
movsd %xmm4, (%r12,%r13,8)
mulsd %xmm3, %xmm7
subsd %xmm1, %xmm7
movapd %xmm0, %xmm4
xorpd 0x4d46(%rip), %xmm4     # 0x51090
unpcklpd %xmm3, %xmm4            # xmm4 = xmm4[0],xmm3[0]
movl $0x1, %ecx
movq (%rbx,%rcx,8), %rdx
movsd (%rdx,%r13,8), %xmm1
unpcklpd %xmm1, %xmm1            # xmm1 = xmm1[0,0]
mulpd %xmm4, %xmm1
movsd (%rdx,%rax,8), %xmm2
unpcklpd %xmm2, %xmm2            # xmm2 = xmm2[0,0]
mulpd %xmm3, %xmm2
addpd %xmm1, %xmm2
movupd %xmm2, (%rdx,%rax,8)
incq %rcx
cmpq %rcx, %rbp
jne 0x4c353
movq %rax, %r13
cmpq 0x8(%rsp), %rax
jg 0x4c27c
movq 0x8(%rsp), %rax
movsd (%r12,%rax,8), %xmm5
movq 0x18(%rsp), %rdx
movsd 0x4d9f(%rip), %xmm1     # 0x51148
movapd 0xaf3f(%rip), %xmm6     # 0x572f0
jmp 0x4c3c0
movq 0x18(%rsp), %rdx
movsd 0x4d88(%rip), %xmm1     # 0x51148
movl 0x14(%rsp), %ecx
subsd %xmm8, %xmm5
movq 0x8(%rsp), %rax
movsd %xmm5, (%r12,%rax,8)
movsd %xmm7, (%r15,%rax,8)
jmp 0x4c407
movsd (%r12,%r13,8), %xmm0
subsd 0x30(%rsp), %xmm0
movsd %xmm0, (%r12,%r13,8)
movq 0x18(%rsp), %rdx
movsd 0x4d4d(%rip), %xmm1     # 0x51148
movapd 0xaeed(%rip), %xmm6     # 0x572f0
movl 0x14(%rsp), %ecx
incl %ecx
movq $0x0, (%r15,%r14,8)
jmp 0x4c169
movq 0x8(%rsp), %rcx
incq %rcx
incq 0x28(%rsp)
movq %rcx, 0x8(%rsp)
cmpq %rbp, %rcx
jne 0x4c167
movl $0x1, %eax
jmp 0x4c43a
xorl %eax, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq