// File: /workspace/github_c_makefile_star2_O1/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 $0x88, %rsp
movq %rcx, %rbx
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %r12
cmpl $0x2, %edx
jl 0x4c10f
leaq 0x8(%r15), %rdi
leaq 0x10(%r15), %rsi
leal -0x1(%r14), %edx
shlq $0x3, %rdx
callq 0x2200
movslq %r14d, %rax
movq $0x0, (%r15,%rax,8)
movl $0x1, %eax
testl %r14d, %r14d
jle 0x4c495
leal 0x1(%r14), %r13d
movl %r14d, %eax
movl $0x1, %ebp
movl $0x1, %edx
subq %rax, %rdx
movq $0x0, 0x38(%rsp)
movapd 0xb1e3(%rip), %xmm2     # 0x57330
movq %r14, 0x30(%rsp)
movq %rdx, 0x58(%rsp)
xorl %esi, %esi
movq %rbp, 0x20(%rsp)
movq 0x38(%rsp), %rax
movq %rdx, %rcx
addq %rax, %rcx
je 0x4c1a1
movsd 0x8(%r12,%rax,8), %xmm0
movsd 0x10(%r12,%rax,8), %xmm1
andpd %xmm2, %xmm0
andpd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd 0x8(%r15,%rax,8), %xmm0
andpd %xmm2, %xmm0
addsd %xmm1, %xmm0
incq %rax
ucomisd %xmm1, %xmm0
jne 0x4c163
jp 0x4c163
jmp 0x4c1a4
movl %r14d, %eax
movl %eax, %eax
cmpq %rax, %rbp
je 0x4c45f
cmpl $0x12c, %esi            # imm = 0x12C
je 0x4c493
movl %esi, 0x2c(%rsp)
movsd 0x8(%r12,%rbp,8), %xmm0
subsd (%r12,%rbp,8), %xmm0
movsd (%r15,%rbp,8), %xmm1
addsd %xmm1, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x4e58(%rip), %xmm1     # 0x51040
movq %rax, 0x18(%rsp)
callq 0x4b554
movq 0x18(%rsp), %rax
movsd (%r12,%rax,8), %xmm5
subsd (%r12,%rbp,8), %xmm5
movsd (%r15,%rbp,8), %xmm1
movapd %xmm0, %xmm2
andpd 0xb11b(%rip), %xmm2     # 0x57330
movapd %xmm0, %xmm3
orpd 0x4e6f(%rip), %xmm3     # 0x51090
xorpd %xmm7, %xmm7
xorpd %xmm4, %xmm4
movsd 0x10(%rsp), %xmm6
cmpnlesd %xmm6, %xmm4
andpd %xmm4, %xmm3
andnpd %xmm2, %xmm4
orpd %xmm3, %xmm4
addsd %xmm6, %xmm4
divsd %xmm4, %xmm1
addsd %xmm5, %xmm1
cmpq %rax, %rbp
setae %cl
jae 0x4c41e
movb %cl, 0xf(%rsp)
movslq %eax, %rbp
movsd -0x8(%r15,%rbp,8), %xmm0
movapd %xmm0, 0x40(%rsp)
movsd %xmm1, 0x10(%rsp)
callq 0x4b554
movsd %xmm0, (%r15,%rbp,8)
xorpd %xmm7, %xmm7
ucomisd %xmm7, %xmm0
jne 0x4c295
jp 0x4c295
movsd 0x10(%rsp), %xmm9
jmp 0x4c3ee
leaq -0x1(%rbp), %r14
movapd 0x40(%rsp), %xmm8
movapd %xmm8, %xmm3
movsd 0x4d93(%rip), %xmm1     # 0x51040
movsd 0x10(%rsp), %xmm9
movq %rbp, %rax
movq %r14, %rbp
mulsd %xmm1, %xmm3
divsd %xmm0, %xmm8
divsd %xmm0, %xmm9
movsd (%r12,%rax,8), %xmm1
subsd %xmm7, %xmm1
movsd (%r12,%r14,8), %xmm0
subsd %xmm1, %xmm0
movapd %xmm9, %xmm2
addsd %xmm9, %xmm2
mulsd %xmm3, %xmm2
mulsd %xmm8, %xmm0
addsd %xmm2, %xmm0
movapd %xmm8, %xmm7
mulsd %xmm0, %xmm7
addsd %xmm7, %xmm1
movsd %xmm1, (%r12,%rax,8)
movapd %xmm9, %xmm1
mulsd %xmm0, %xmm1
subsd %xmm3, %xmm1
movapd %xmm8, %xmm6
xorpd 0x4d70(%rip), %xmm6     # 0x51090
movl $0x1, %ecx
movq (%rbx,%rcx,8), %rdx
movsd (%rdx,%rax,8), %xmm2
movsd (%rdx,%rbp,8), %xmm3
movapd %xmm9, %xmm4
mulsd %xmm2, %xmm4
movapd %xmm8, %xmm5
mulsd %xmm3, %xmm5
addsd %xmm4, %xmm5
movsd %xmm5, (%rdx,%rax,8)
mulsd %xmm6, %xmm2
mulsd %xmm9, %xmm3
addsd %xmm2, %xmm3
movsd %xmm3, (%rdx,%rbp,8)
incq %rcx
cmpq %rcx, %r13
jne 0x4c325
cmpq 0x20(%rsp), %rbp
setle %cl
jle 0x4c46a
movb %cl, 0xf(%rsp)
leaq -0x1(%rbp), %r14
movsd -0x8(%r15,%rbp,8), %xmm0
movsd %xmm0, 0x60(%rsp)
mulsd %xmm0, %xmm8
movapd %xmm8, 0x40(%rsp)
movapd %xmm8, %xmm0
movsd %xmm1, 0x10(%rsp)
movapd %xmm7, 0x70(%rsp)
movsd %xmm9, 0x68(%rsp)
callq 0x4b554
movsd 0x10(%rsp), %xmm9
movsd 0x60(%rsp), %xmm3
movsd 0x68(%rsp), %xmm1
movapd 0x40(%rsp), %xmm8
movapd 0x70(%rsp), %xmm7
movsd %xmm0, (%r15,%rbp,8)
ucomisd 0x4c7e(%rip), %xmm0     # 0x51060
jne 0x4c2b4
jp 0x4c2b4
movsd (%r12,%rbp,8), %xmm1
subsd %xmm7, %xmm1
movsd %xmm1, (%r12,%rbp,8)
movq 0x18(%rsp), %rax
movq $0x0, (%r15,%rax,8)
movq 0x30(%rsp), %r14
movq 0x20(%rsp), %rbp
movapd %xmm9, %xmm1
movb 0xf(%rsp), %cl
movl 0x2c(%rsp), %esi
incl %esi
testb %cl, %cl
movq 0x58(%rsp), %rdx
movapd 0xaefd(%rip), %xmm2     # 0x57330
jne 0x4c441
ucomisd 0x4c23(%rip), %xmm0     # 0x51060
jne 0x4c441
jnp 0x4c45f
movsd (%r12,%rbp,8), %xmm0
subsd %xmm7, %xmm0
movsd %xmm0, (%r12,%rbp,8)
movsd %xmm1, (%r15,%rbp,8)
movq $0x0, (%r15,%rax,8)
cmpq %rax, %rbp
jne 0x4c15e
jmp 0x4c47b
movq 0x30(%rsp), %r14
movq 0x20(%rsp), %rbp
movq 0x18(%rsp), %rax
jmp 0x4c41e
incq %rbp
incq 0x38(%rsp)
cmpq %r13, %rbp
jne 0x4c157
movl $0x1, %eax
jmp 0x4c495
xorl %eax, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop