// File: /workspace/github_c_makefile_star2_O1/ugobas[P]tnm/ludcmp.c
// Function: ludcmp
float ludcmp(double **a, int n, int *indx)
{
  float d=1.0;
  int i,imax=0,j,k;
  double big,dum,sum,temp;
  double vv[n];
 
  for(i=0;i<n;i++) {
    big=0.0;
    for(j=0;j<n;j++){
      if ((temp=fabs(a[i][j])) > big) big=temp;
    }
    if(big == 0.0){
      printf("ERROR, singular matrix in routine LUDCMP\n"); exit(8);
    }
    vv[i]=1.0/big;
  }
  for (j=0;j<n;j++) {
    for (i=0;i<j;i++) {
      sum=a[i][j];
      for (k=1;k<i;k++) sum -= a[i][k]*a[k][j];
      a[i][j]=sum;
    }
    big=0.0;
    for (i=j;i<n;i++) {
      sum=a[i][j];
      for (k=0;k<j;k++)
	sum -= a[i][k]*a[k][j];
      a[i][j]=sum;
      if ( (dum=vv[i]*fabs(sum)) >= big) {
	big=dum;
	imax=i;
      }
    }
    if(j != imax) {
      for (k=0; k<n;k++) {
	dum=a[imax][k];
	a[imax][k]=a[j][k];
	a[j][k]=dum;
      }
      d = -d;
      vv[imax]=vv[j];
    }
    indx[j]=imax;
    if (a[j][j] == 0.0) a[j][j]=TINY;
    if (j != n) {
      dum=1.0/(a[j][j]);
      for (i=j+1;i< n;i++) a[i][j] *= dum;
    }
  }
  return(d);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %eax
movq %rsp, %rcx
leaq 0xf(,%rax,8), %r8
andq $-0x10, %r8
subq %r8, %rcx
movq %rcx, %rsp
testl %esi, %esi
jle 0x49e94
xorl %r8d, %r8d
movapd 0xd4ef(%rip), %xmm0     # 0x57330
xorpd %xmm1, %xmm1
movsd 0x71f3(%rip), %xmm2     # 0x51040
movq (%rdi,%r8,8), %r9
xorl %r10d, %r10d
xorpd %xmm3, %xmm3
movapd %xmm3, %xmm4
movsd (%r9,%r10,8), %xmm3
andpd %xmm0, %xmm3
maxsd %xmm4, %xmm3
incq %r10
cmpq %r10, %rax
jne 0x49e58
ucomisd %xmm1, %xmm3
jne 0x49e7e
jnp 0x4a04f
movapd %xmm2, %xmm4
divsd %xmm3, %xmm4
movsd %xmm4, (%rcx,%r8,8)
incq %r8
cmpq %rax, %r8
jne 0x49e4d
testl %esi, %esi
jle 0x4a03a
xorl %r9d, %r9d
movss 0x7169(%rip), %xmm0     # 0x51010
movapd 0xd481(%rip), %xmm1     # 0x57330
xorpd %xmm2, %xmm2
movabsq $0x3bc79ca10c924223, %rsi # imm = 0x3BC79CA10C924223
movsd 0x717b(%rip), %xmm3     # 0x51040
movapd 0xca63(%rip), %xmm4     # 0x56930
movq %rax, %r8
movq %rdi, %r10
xorl %r11d, %r11d
testq %r9, %r9
je 0x49f1d
xorl %ebx, %ebx
movq (%rdi,%rbx,8), %r14
movsd (%r14,%r9,8), %xmm5
cmpq $0x2, %rbx
jb 0x49f0f
movl $0x1, %r15d
movsd (%r14,%r15,8), %xmm6
movq (%rdi,%r15,8), %r12
mulsd (%r12,%r9,8), %xmm6
subsd %xmm6, %xmm5
incq %r15
cmpq %r15, %rbx
jne 0x49ef3
movsd %xmm5, (%r14,%r9,8)
incq %rbx
cmpq %r9, %rbx
jne 0x49edd
xorpd %xmm5, %xmm5
movq %r9, %rbx
movq (%rdi,%rbx,8), %r14
movsd (%r14,%r9,8), %xmm6
testq %r9, %r9
je 0x49f52
xorl %r15d, %r15d
movsd (%r14,%r15,8), %xmm7
movq (%rdi,%r15,8), %r12
mulsd (%r12,%r9,8), %xmm7
subsd %xmm7, %xmm6
incq %r15
cmpq %r15, %r9
jne 0x49f36
movsd %xmm6, (%r14,%r9,8)
andpd %xmm1, %xmm6
mulsd (%rcx,%rbx,8), %xmm6
ucomisd %xmm5, %xmm6
movapd %xmm5, %xmm7
cmpnlesd %xmm6, %xmm7
movapd %xmm7, %xmm8
andnpd %xmm6, %xmm8
andpd %xmm5, %xmm7
cmovael %ebx, %r11d
orpd %xmm8, %xmm7
incq %rbx
movapd %xmm7, %xmm5
cmpq %rax, %rbx
jne 0x49f24
movl %r11d, %ebx
cmpq %rbx, %r9
je 0x49fd6
movslq %r11d, %rbx
movq (%rdi,%rbx,8), %r14
movq (%rdi,%r9,8), %r15
xorl %r12d, %r12d
movsd (%r14,%r12,8), %xmm5
movsd (%r15,%r12,8), %xmm6
movsd %xmm6, (%r14,%r12,8)
movsd %xmm5, (%r15,%r12,8)
incq %r12
cmpq %r12, %rax
jne 0x49fa7
xorpd %xmm4, %xmm0
movsd (%rcx,%r9,8), %xmm5
movsd %xmm5, (%rcx,%rbx,8)
movl %r11d, (%rdx,%r9,4)
movq (%rdi,%r9,8), %r14
movsd (%r14,%r9,8), %xmm5
ucomisd %xmm2, %xmm5
jne 0x49ff0
jp 0x49ff0
movq %rsi, (%r14,%r9,8)
leaq 0x1(%r9), %rbx
cmpq %rax, %rbx
jae 0x4a025
movapd %xmm3, %xmm5
divsd (%r14,%r9,8), %xmm5
movl $0x1, %r14d
movq (%r10,%r14,8), %r15
movsd (%r15,%r9,8), %xmm6
mulsd %xmm5, %xmm6
movsd %xmm6, (%r15,%r9,8)
incq %r14
cmpq %r14, %r8
jne 0x4a009
addq $0x8, %r10
decq %r8
movq %rbx, %r9
cmpq %rax, %rbx
jne 0x49ed6
jmp 0x4a042
movss 0x6fce(%rip), %xmm0     # 0x51010
leaq -0x20(%rbp), %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x13fc4(%rip), %rdi     # 0x5e01a
callq 0x2090
movl $0x8, %edi
callq 0x2270
nopl (%rax)