// File: /workspace/github_c_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %eax
movq %rsp, %rcx
leaq 0xf(,%rax,8), %r8
andq $-0x10, %r8
subq %r8, %rcx
movq %rcx, %rsp
xorl %r9d, %r9d
testl %esi, %esi
movl $0x0, %r8d
cmovgl %esi, %r8d
xorpd %xmm0, %xmm0
movsd 0x71a8(%rip), %xmm1     # 0x4b048
movapd 0xd398(%rip), %xmm2     # 0x51240
cmpq %r8, %r9
je 0x43ef3
xorpd %xmm3, %xmm3
xorl %r10d, %r10d
cmpq %r10, %rax
je 0x43ed4
movq (%rdi,%r9,8), %r11
movsd (%r11,%r10,8), %xmm4
andpd %xmm2, %xmm4
maxsd %xmm3, %xmm4
incq %r10
movapd %xmm4, %xmm3
jmp 0x43eb4
ucomisd %xmm0, %xmm3
jne 0x43ee0
jnp 0x4408f
movapd %xmm1, %xmm4
divsd %xmm3, %xmm4
movsd %xmm4, (%rcx,%r9,8)
incq %r9
jmp 0x43ea8
movss 0x7115(%rip), %xmm0     # 0x4b010
xorl %r9d, %r9d
pushq $0x1
popq %r10
xorpd %xmm3, %xmm3
movsd 0x14052(%rip), %xmm4    # 0x57f60
movaps 0xc94b(%rip), %xmm5     # 0x50860
movq %r10, %rbx
xorl %r14d, %r14d
cmpq %r8, %r9
je 0x44080
xorl %r15d, %r15d
cmpq %r9, %r15
je 0x43f62
movq (%rdi,%r15,8), %r12
movsd (%r12,%r9,8), %xmm6
movq %r10, %r13
cmpq %r15, %r13
jae 0x43f57
movsd (%r12,%r13,8), %xmm7
movq (%rdi,%r13,8), %r11
mulsd (%r11,%r9,8), %xmm7
subsd %xmm7, %xmm6
incq %r13
jmp 0x43f39
movsd %xmm6, (%r12,%r9,8)
incq %r15
jmp 0x43f27
xorpd %xmm6, %xmm6
movq %r9, %r15
cmpq %rax, %r15
je 0x43fdb
movq (%rdi,%r15,8), %r12
movsd (%r12,%r9,8), %xmm7
xorl %r13d, %r13d
cmpq %r13, %r9
je 0x43f9a
movsd (%r12,%r13,8), %xmm8
movq (%rdi,%r13,8), %r11
mulsd (%r11,%r9,8), %xmm8
subsd %xmm8, %xmm7
incq %r13
jmp 0x43f7b
movsd %xmm7, (%r12,%r9,8)
andpd %xmm2, %xmm7
mulsd (%rcx,%r15,8), %xmm7
ucomisd %xmm6, %xmm7
movapd %xmm6, %xmm8
cmpnlesd %xmm7, %xmm8
movapd %xmm8, %xmm9
andnpd %xmm7, %xmm9
andpd %xmm6, %xmm8
orpd %xmm9, %xmm8
cmovael %r15d, %r14d
incq %r15
movapd %xmm8, %xmm6
jmp 0x43f69
movl %r14d, %r11d
cmpq %r11, %r9
je 0x44024
movslq %r14d, %r15
xorl %r12d, %r12d
cmpq %r12, %rax
je 0x44015
movq (%rdi,%r15,8), %r11
movsd (%r11,%r12,8), %xmm6
movq (%rdi,%r9,8), %r13
movsd (%r13,%r12,8), %xmm7
movsd %xmm7, (%r11,%r12,8)
movsd %xmm6, (%r13,%r12,8)
incq %r12
jmp 0x43fe9
xorps %xmm5, %xmm0
movsd (%rcx,%r9,8), %xmm6
movsd %xmm6, (%rcx,%r15,8)
movl %r14d, (%rdx,%r9,4)
movq (%rdi,%r9,8), %r15
movsd (%r15,%r9,8), %xmm7
ucomisd %xmm3, %xmm7
jne 0x4404c
jp 0x4404c
movabsq $0x3bc79ca10c924223, %r11 # imm = 0x3BC79CA10C924223
movq %r11, (%r15,%r9,8)
movapd %xmm4, %xmm7
movapd %xmm1, %xmm6
divsd %xmm7, %xmm6
movq %rbx, %r15
cmpl %esi, %r15d
jge 0x44075
movq (%rdi,%r15,8), %r11
movsd (%r11,%r9,8), %xmm7
mulsd %xmm6, %xmm7
movsd %xmm7, (%r11,%r9,8)
incq %r15
jmp 0x44057
incq %r9
incq %rbx
jmp 0x43f1b
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x13ed2(%rip), %rdi     # 0x57f68
callq 0x2090
pushq $0x8
popq %rdi
callq 0x2270
nop