// File: /workspace/github_c_makefile_star2_O0/dapogon[P]cellcoal/src/eigen.c
// Function: matinv
int matinv( double x[], int n, int m, double space[])
{
/* x[n*m]  ... m>=n
*/
   register int i,j,k;
   int *irow=(int*) space;
   double ee=1.0e-20, t,t1,xmax;
   double det=1.0;

   for (i=0; i<n; i++)  {
      xmax = 0.;
      for (j=i; j<n; j++) {
	 if (xmax < fabs(x[j*m+i]))  {
	    xmax = fabs( x[j*m+i] );
	    irow[i] = j;
	 }
      }
      det *= xmax;
      if (xmax < ee)   {
	 fprintf(stderr,"\nDet becomes zero at %3d!\t\n", i+1);
	 return(-1);
      }
      if (irow[i] != i) {
	 for (j=0; j<m; j++) {
	    t = x[i*m+j];
	    x[i*m+j] = x[irow[i] * m + j];
	    x[ irow[i] * m + j] = t;
	 }
      }
      t = 1./x[i*m+i];
      for (j=0; j<n; j++) {
	 if (j == i) continue;
	 t1 = t*x[j*m+i];
	 for (k=0; k<n; k++)  x[j*m+k] -= t1*x[i*m+k];
	 x[j*m+i] = -t1;
      }
      for (j=0; j<m; j++)   x[i*m+j] *= t;
      x[i*m+i] = t;
   }                            /* i  */
   for (i=n-1; i>=0; i--) {
      if (irow[i] == i) continue;
      for (j=0; j<n; j++)  {
	 t = x[j*m+i];
	 x[j*m+i] = x[ j*m + irow[i] ];
	 x[ j*m + irow[i] ] = t;
      }
   }
   return (0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x38(%rbp)
movsd 0x248b2(%rip), %xmm0    # 0x46fc8
movsd %xmm0, -0x40(%rbp)
movsd 0x1c8fd(%rip), %xmm0    # 0x3f020
movsd %xmm0, -0x60(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x22a25
xorps %xmm0, %xmm0
movsd %xmm0, -0x58(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x227be
movsd -0x58(%rbp), %xmm1
movq -0x10(%rbp), %rax
movl -0x28(%rbp), %ecx
imull -0x18(%rbp), %ecx
addl -0x24(%rbp), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movaps 0x1cc2d(%rip), %xmm2    # 0x3f3a0
pand %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x227b1
movq -0x10(%rbp), %rax
movl -0x28(%rbp), %ecx
imull -0x18(%rbp), %ecx
addl -0x24(%rbp), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movaps 0x1cc06(%rip), %xmm1    # 0x3f3a0
pand %xmm1, %xmm0
movsd %xmm0, -0x58(%rbp)
movl -0x28(%rbp), %edx
movq -0x38(%rbp), %rax
movslq -0x24(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x227b3
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x22749
movsd -0x58(%rbp), %xmm0
mulsd -0x60(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
movsd -0x58(%rbp), %xmm1
movsd -0x40(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x22807
movq 0x2b814(%rip), %rax     # 0x4dff8
movq (%rax), %rdi
movl -0x24(%rbp), %edx
addl $0x1, %edx
leaq 0x24827(%rip), %rsi     # 0x4701b
movb $0x0, %al
callq 0x21b0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x22af7
movq -0x38(%rbp), %rax
movslq -0x24(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x24(%rbp), %eax
je 0x228b0
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0x228ae
movq -0x10(%rbp), %rax
movl -0x24(%rbp), %ecx
imull -0x18(%rbp), %ecx
addl -0x28(%rbp), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq -0x38(%rbp), %rcx
movslq -0x24(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
imull -0x18(%rbp), %ecx
addl -0x28(%rbp), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x10(%rbp), %rax
movl -0x24(%rbp), %ecx
imull -0x18(%rbp), %ecx
addl -0x28(%rbp), %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd -0x48(%rbp), %xmm0
movq -0x10(%rbp), %rax
movq -0x38(%rbp), %rcx
movslq -0x24(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
imull -0x18(%rbp), %ecx
addl -0x28(%rbp), %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x22822
jmp 0x228b0
movq -0x10(%rbp), %rax
movl -0x24(%rbp), %ecx
imull -0x18(%rbp), %ecx
addl -0x24(%rbp), %ecx
movslq %ecx, %rcx
movsd 0x1c757(%rip), %xmm0    # 0x3f020
divsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x48(%rbp)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x229c2
movl -0x28(%rbp), %eax
cmpl -0x24(%rbp), %eax
jne 0x228f3
jmp 0x229b4
movsd -0x48(%rbp), %xmm0
movq -0x10(%rbp), %rax
movl -0x28(%rbp), %ecx
imull -0x18(%rbp), %ecx
addl -0x24(%rbp), %ecx
movslq %ecx, %rcx
mulsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x50(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x22982
movsd -0x50(%rbp), %xmm0
movq -0x10(%rbp), %rax
movl -0x24(%rbp), %ecx
imull -0x18(%rbp), %ecx
addl -0x2c(%rbp), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm2
movq -0x10(%rbp), %rax
movl -0x28(%rbp), %ecx
imull -0x18(%rbp), %ecx
addl -0x2c(%rbp), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm1
movq %xmm0, %rdx
movabsq $-0x8000000000000000, %rsi # imm = 0x8000000000000000
xorq %rsi, %rdx
movq %rdx, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x2291a
movsd -0x50(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movq -0x10(%rbp), %rax
movl -0x28(%rbp), %ecx
imull -0x18(%rbp), %ecx
addl -0x24(%rbp), %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x228da
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0x229fc
movsd -0x48(%rbp), %xmm0
movq -0x10(%rbp), %rax
movl -0x24(%rbp), %ecx
imull -0x18(%rbp), %ecx
addl -0x28(%rbp), %ecx
movslq %ecx, %rcx
mulsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x229c9
movsd -0x48(%rbp), %xmm0
movq -0x10(%rbp), %rax
movl -0x24(%rbp), %ecx
imull -0x18(%rbp), %ecx
addl -0x24(%rbp), %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x2272f
movl -0x14(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jl 0x22af0
movq -0x38(%rbp), %rax
movslq -0x24(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x24(%rbp), %eax
jne 0x22a4d
jmp 0x22ae2
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x22ae0
movq -0x10(%rbp), %rax
movl -0x28(%rbp), %ecx
imull -0x18(%rbp), %ecx
addl -0x24(%rbp), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x48(%rbp)
movq -0x10(%rbp), %rax
movl -0x28(%rbp), %ecx
imull -0x18(%rbp), %ecx
movq -0x38(%rbp), %rdx
movslq -0x24(%rbp), %rsi
addl (%rdx,%rsi,4), %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x10(%rbp), %rax
movl -0x28(%rbp), %ecx
imull -0x18(%rbp), %ecx
addl -0x24(%rbp), %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd -0x48(%rbp), %xmm0
movq -0x10(%rbp), %rax
movl -0x28(%rbp), %ecx
imull -0x18(%rbp), %ecx
movq -0x38(%rbp), %rdx
movslq -0x24(%rbp), %rsi
addl (%rdx,%rsi,4), %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x22a54
jmp 0x22ae2
movl -0x24(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x22a2e
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq