// File: /workspace/github_c_makefile_star2_O1/dapogon[P]cellcoal/src/eigen.c
// Function: cmatinv
int cmatinv( complex x[], int n, int m, double space[])
{
/* x[n*m]  ... m>=n
*/
   int i,j,k, *irow=(int*) space;
   double xmaxsize, ee=1e-20;
   complex xmax, t,t1;

   FOR(i,n)  {
       xmaxsize = 0.;
       for (j=i; j<n; j++) {
          if ( xmaxsize < csize (x[j*m+i]))  {
               xmaxsize = csize (x[j*m+i]);
               xmax = x[j*m+i];
               irow[i] = j;
          }
       }
       if (xmaxsize < ee)   {
           fprintf(stderr,"\nDet goes to zero at %8d!\t\n", i+1);
           return(-1);
       }
       if (irow[i] != i) {
           FOR(j,m) {
                t = x[i*m+j];
                x[i*m+j] = x[irow[i]*m+j];
                x[ irow[i]*m+j] = t;
           }
       }
       t = cdiv (compl(1,0), x[i*m+i]);
       FOR(j,n) {
           if (j == i) continue;
           t1 = cby (t,x[j*m+i]);
           FOR(k,m)  x[j*m+k] = cminus (x[j*m+k], cby(t1,x[i*m+k]));
           x[j*m+i] = cfactor (t1, -1);
       }
       FOR(j,m)   x[i*m+j] = cby (x[i*m+j], t);
       x[i*m+i] = t;
   }
   for (i=n-1; i>=0; i--) {
        if (irow[i] == i) continue;
        FOR(j,n)  {
           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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rcx, %rbx
movslq %edx, %r11
movl %esi, %ebp
movl %esi, 0x8(%rsp)
testl %esi, %esi
jle 0x1d574
movl %r11d, %r8d
leaq 0x8(%rdi), %r9
movq %r11, %r10
shlq $0x4, %r10
leaq 0x10(%r10), %rax
movq %rax, 0x10(%rsp)
movq %r8, %r14
shlq $0x4, %r14
xorl %r12d, %r12d
movapd 0x1eb63(%rip), %xmm3    # 0x3be40
movq %r9, %rcx
xorl %r13d, %r13d
movq %rdi, 0x38(%rsp)
movq %r11, 0x30(%rsp)
movl %edx, 0xc(%rsp)
movq %r8, 0x28(%rsp)
movq %r9, 0x20(%rsp)
movq %r10, 0x18(%rsp)
movl %r12d, %eax
shlq $0x4, %rax
leaq (%r9,%rax), %r15
addq %rdi, %rax
movq %rcx, 0x50(%rsp)
movq %r13, %rsi
xorpd %xmm0, %xmm0
movsd -0x8(%rcx), %xmm2
movsd (%rcx), %xmm1
andpd %xmm3, %xmm2
andpd %xmm3, %xmm1
addsd %xmm2, %xmm1
ucomisd %xmm0, %xmm1
jbe 0x1d33d
movl %esi, (%rbx,%r13,4)
movapd %xmm1, %xmm0
incq %rsi
addq %r10, %rcx
cmpq %rsi, %rbp
jne 0x1d31a
movsd 0x1eac8(%rip), %xmm1    # 0x3be18
ucomisd %xmm0, %xmm1
ja 0x1d5ef
movq %r12, 0x48(%rsp)
testl %edx, %edx
setle %cl
movl (%rbx,%r13,4), %esi
cmpq %rsi, %r13
sete %sil
orb %cl, %sil
jne 0x1d3b2
xorl %ecx, %ecx
movupd (%rax), %xmm0
movslq (%rbx,%r13,4), %rsi
imulq %r11, %rsi
addq %rcx, %rsi
shlq $0x4, %rsi
movupd (%rdi,%rsi), %xmm1
movupd %xmm1, (%rax)
movslq (%rbx,%r13,4), %rsi
imulq %r11, %rsi
addq %rcx, %rsi
shlq $0x4, %rsi
movupd %xmm0, (%rdi,%rsi)
incq %rcx
addq $0x10, %rax
cmpq %rcx, %r8
jne 0x1d376
movl %r13d, %eax
imull %edx, %eax
cltq
movq %r13, %r12
shlq $0x4, %r12
addq %rdi, %r12
shlq $0x4, %rax
leaq (%r12,%rax), %rcx
movq %rcx, 0x40(%rsp)
movsd (%rax,%r12), %xmm2
movsd 0x8(%rax,%r12), %xmm3
xorpd %xmm1, %xmm1
movsd 0x16c1e(%rip), %xmm0    # 0x34008
callq 0x1cfbd
movl 0xc(%rsp), %edx
movq 0x30(%rsp), %r11
movapd %xmm1, %xmm2
movapd 0x16cbb(%rip), %xmm10   # 0x340c0
xorpd %xmm10, %xmm2
xorl %eax, %eax
xorl %ecx, %ecx
movq 0x20(%rsp), %r9
movq 0x18(%rsp), %r10
cmpq %r13, %rcx
je 0x1d4df
movq %rcx, %r8
imulq %r11, %r8
shlq $0x4, %r8
movsd (%r12,%r8), %xmm5
movsd 0x8(%r12,%r8), %xmm4
movapd %xmm4, %xmm6
mulsd %xmm2, %xmm6
movapd %xmm0, %xmm3
mulsd %xmm5, %xmm3
addsd %xmm6, %xmm3
mulsd %xmm1, %xmm5
mulsd %xmm0, %xmm4
addsd %xmm5, %xmm4
testl %edx, %edx
jle 0x1d4ce
movl %eax, %esi
shlq $0x4, %rsi
addq %r9, %rsi
movapd %xmm4, %xmm5
xorpd %xmm10, %xmm5
xorl %edi, %edi
movsd -0x8(%r15,%rdi), %xmm6
movsd (%r15,%rdi), %xmm7
movapd %xmm7, %xmm8
mulsd %xmm5, %xmm8
movapd %xmm3, %xmm9
mulsd %xmm6, %xmm9
addsd %xmm8, %xmm9
mulsd %xmm4, %xmm6
mulsd %xmm3, %xmm7
addsd %xmm6, %xmm7
movsd -0x8(%rsi,%rdi), %xmm6
subsd %xmm9, %xmm6
movsd (%rsi,%rdi), %xmm8
subsd %xmm7, %xmm8
movsd %xmm6, -0x8(%rsi,%rdi)
movsd %xmm8, (%rsi,%rdi)
addq $0x10, %rdi
cmpq %rdi, %r14
jne 0x1d471
addq %r12, %r8
unpcklpd %xmm4, %xmm3            # xmm3 = xmm3[0],xmm4[0]
xorpd %xmm10, %xmm3
movupd %xmm3, (%r8)
incq %rcx
addl %edx, %eax
cmpq %rbp, %rcx
jne 0x1d418
testl %edx, %edx
jle 0x1d536
xorl %eax, %eax
movsd -0x8(%r15,%rax), %xmm2
movsd (%r15,%rax), %xmm3
movapd %xmm1, %xmm4
mulsd %xmm3, %xmm4
movapd %xmm2, %xmm5
mulsd %xmm0, %xmm5
subsd %xmm4, %xmm5
mulsd %xmm0, %xmm3
mulsd %xmm1, %xmm2
addsd %xmm3, %xmm2
movsd %xmm5, -0x8(%r15,%rax)
movsd %xmm2, (%r15,%rax)
addq $0x10, %rax
cmpq %rax, %r14
jne 0x1d4f3
movq 0x40(%rsp), %rax
movsd %xmm0, (%rax)
movsd %xmm1, 0x8(%rax)
incq %r13
movq 0x50(%rsp), %rcx
addq 0x10(%rsp), %rcx
movq 0x48(%rsp), %r12
addl %edx, %r12d
cmpq %rbp, %r13
movq 0x38(%rsp), %rdi
movq 0x28(%rsp), %r8
movapd 0x1e8d2(%rip), %xmm3    # 0x3be40
jne 0x1d300
xorl %eax, %eax
cmpl $0x0, 0x8(%rsp)
jle 0x1d5e0
movq %rbp, %rcx
shlq $0x4, %rcx
addq $-0x10, %rcx
shlq $0x4, %r11
movq %rbp, %rdx
leaq -0x1(%rdx), %rsi
movl -0x4(%rbx,%rdx,4), %r8d
cmpq %r8, %rsi
je 0x1d5d3
movq %rbp, %r10
movq %rdi, %r8
movupd (%r8,%rcx), %xmm0
movslq (%rbx,%rsi,4), %r9
shlq $0x4, %r9
movupd (%r8,%r9), %xmm1
movupd %xmm1, (%r8,%rcx)
movslq (%rbx,%rsi,4), %r9
shlq $0x4, %r9
movupd %xmm0, (%r8,%r9)
addq %r11, %r8
decq %r10
jne 0x1d5a3
addq $-0x10, %rcx
cmpq $0x1, %rdx
movq %rsi, %rdx
jg 0x1d58f
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r13, %rdi
callq 0x5693
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x1d5e0
nop