// File: /workspace/github_c_makefile_star2_O3/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
movss 0x7262(%rip), %xmm0     # 0x5111c
testl %esi, %esi
jle 0x4a0c3
xorl %r8d, %r8d
movapd 0xd423(%rip), %xmm1     # 0x572f0
xorpd %xmm3, %xmm3
movsd 0x726f(%rip), %xmm2     # 0x51148
movq (%rdi,%r8,8), %r9
xorl %r10d, %r10d
xorpd %xmm4, %xmm4
movapd %xmm4, %xmm5
movsd (%r9,%r10,8), %xmm4
andpd %xmm1, %xmm4
maxsd %xmm5, %xmm4
incq %r10
cmpq %r10, %rax
jne 0x49ee4
ucomisd %xmm3, %xmm4
jne 0x49f0a
jnp 0x4a0d0
movapd %xmm2, %xmm5
divsd %xmm4, %xmm5
movsd %xmm5, (%rcx,%r8,8)
incq %r8
cmpq %rax, %r8
jne 0x49ed9
testl %esi, %esi
jle 0x4a0c3
xorl %r10d, %r10d
movss 0x71e9(%rip), %xmm0     # 0x5111c
xorpd %xmm3, %xmm3
movabsq $0x3bc79ca10c924223, %rsi # imm = 0x3BC79CA10C924223
movsd 0x140a7(%rip), %xmm4    # 0x5dff0
movapd 0x70df(%rip), %xmm5     # 0x51030
movq %rax, %r8
movq %rdi, %r9
xorl %r11d, %r11d
testq %r10, %r10
je 0x49fa1
xorl %ebx, %ebx
movq (%rdi,%rbx,8), %r14
movsd (%r14,%r10,8), %xmm6
cmpq $0x2, %rbx
jb 0x49f93
movl $0x1, %r15d
movsd (%r14,%r15,8), %xmm7
movq (%rdi,%r15,8), %r12
mulsd (%r12,%r10,8), %xmm7
subsd %xmm7, %xmm6
incq %r15
cmpq %r15, %rbx
jne 0x49f77
movsd %xmm6, (%r14,%r10,8)
incq %rbx
cmpq %r10, %rbx
jne 0x49f61
xorpd %xmm6, %xmm6
movq %r10, %rbx
movq (%rdi,%rbx,8), %r14
movsd (%r14,%r10,8), %xmm7
testq %r10, %r10
je 0x49fd7
xorl %r15d, %r15d
movsd (%r14,%r15,8), %xmm8
movq (%rdi,%r15,8), %r12
mulsd (%r12,%r10,8), %xmm8
subsd %xmm8, %xmm7
incq %r15
cmpq %r15, %r10
jne 0x49fba
movsd %xmm7, (%r14,%r10,8)
andpd %xmm1, %xmm7
mulsd (%rcx,%rbx,8), %xmm7
ucomisd %xmm6, %xmm7
movapd %xmm6, %xmm8
cmpnlesd %xmm7, %xmm8
movapd %xmm8, %xmm9
andnpd %xmm7, %xmm9
andpd %xmm6, %xmm8
cmovael %ebx, %r11d
orpd %xmm9, %xmm8
incq %rbx
movapd %xmm8, %xmm6
cmpq %rax, %rbx
jne 0x49fa8
movl %r11d, %ebx
cmpq %rbx, %r10
je 0x4a05f
movslq %r11d, %rbx
movq (%rdi,%rbx,8), %r14
movq (%rdi,%r10,8), %r15
xorl %r12d, %r12d
movsd (%r14,%r12,8), %xmm6
movsd (%r15,%r12,8), %xmm7
movsd %xmm7, (%r14,%r12,8)
movsd %xmm6, (%r15,%r12,8)
incq %r12
cmpq %r12, %rax
jne 0x4a030
xorpd %xmm5, %xmm0
movsd (%rcx,%r10,8), %xmm6
movsd %xmm6, (%rcx,%rbx,8)
movl %r11d, (%rdx,%r10,4)
movq (%rdi,%r10,8), %rbx
movsd (%rbx,%r10,8), %xmm7
ucomisd %xmm3, %xmm7
jne 0x4a07d
jp 0x4a07d
movq %rsi, (%rbx,%r10,8)
movapd %xmm4, %xmm7
leaq 0x1(%r10), %rbx
cmpq %rax, %rbx
jae 0x4a0b0
movapd %xmm2, %xmm6
divsd %xmm7, %xmm6
movl $0x1, %r14d
movq (%r9,%r14,8), %r15
movsd (%r15,%r10,8), %xmm7
mulsd %xmm6, %xmm7
movsd %xmm7, (%r15,%r10,8)
incq %r14
cmpq %r14, %r8
jne 0x4a094
addq $0x8, %r9
decq %r8
movq %rbx, %r10
cmpq %rax, %rbx
jne 0x49f5a
leaq -0x20(%rbp), %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x13f21(%rip), %rdi     # 0x5dff8
callq 0x2090
movl $0x8, %edi
callq 0x2280
nop