// File: /workspace/github_c_makefile_star2_O3/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:
testl %esi, %esi
jle 0x1d971
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl %edx, %r15d
movslq %edx, %r8
movl %esi, 0x14(%rsp)
movl %esi, %r13d
movl %r8d, %r9d
movq %r8, %r12
shlq $0x4, %r12
leaq 0x10(%r12), %rax
movq %rax, 0x18(%rsp)
movq %r9, %rbp
shlq $0x4, %rbp
xorl %r10d, %r10d
movdqa 0xd88c(%rip), %xmm3     # 0x2af00
movq %rdi, %r11
xorl %r14d, %r14d
movq %rcx, 0x38(%rsp)
movq %rdi, 0x8(%rsp)
movq %r12, 0x30(%rsp)
movq %r8, 0x28(%rsp)
movq %r9, 0x20(%rsp)
movl %r10d, %ebx
shlq $0x4, %rbx
addq %rdi, %rbx
movq %r11, %rax
movq %r14, %rdx
xorpd %xmm0, %xmm0
movdqu (%rax), %xmm2
pand %xmm3, %xmm2
pshufd $0xee, %xmm2, %xmm1     # xmm1 = xmm2[2,3,2,3]
addsd %xmm2, %xmm1
ucomisd %xmm0, %xmm1
jbe 0x1d6c6
movl %edx, (%rcx,%r14,4)
movapd %xmm1, %xmm0
incq %rdx
addq %r12, %rax
cmpq %rdx, %r13
jne 0x1d6a7
movsd 0xd7ff(%rip), %xmm1     # 0x2aed8
ucomisd %xmm0, %xmm1
ja 0x1d974
movq %r11, 0x48(%rsp)
movq %r10, 0x50(%rsp)
testl %r15d, %r15d
setle %sil
movl (%rcx,%r14,4), %eax
cmpq %rax, %r14
sete %dl
orb %sil, %dl
jne 0x1d749
movq %rbx, %r8
xorl %edx, %edx
imull %r15d, %eax
cltq
addq %rdx, %rax
shlq $0x4, %rax
movupd (%r8), %xmm0
movupd (%rdi,%rax), %xmm1
movupd %xmm1, (%r8)
movl (%rcx,%r14,4), %eax
movl %eax, %esi
imull %r15d, %esi
movslq %esi, %rsi
addq %rdx, %rsi
shlq $0x4, %rsi
movupd %xmm0, (%rdi,%rsi)
incq %rdx
addq $0x10, %r8
cmpq %rdx, %r9
jne 0x1d708
movl %r14d, %eax
imull %r15d, %eax
cltq
movq %r14, %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 0x597e(%rip), %xmm0     # 0x23100
callq 0x1d366
movapd %xmm1, %xmm2
movapd 0x58ac(%rip), %xmm9     # 0x23040
xorpd %xmm9, %xmm2
xorl %eax, %eax
xorl %ecx, %ecx
movq 0x28(%rsp), %r8
movq 0x50(%rsp), %r10
movq 0x48(%rsp), %r11
cmpq %r14, %rcx
je 0x1d85d
movq %rcx, %rdx
imulq %r8, %rdx
shlq $0x4, %rdx
movsd (%r12,%rdx), %xmm5
movsd 0x8(%r12,%rdx), %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
movapd %xmm4, %xmm5
xorpd %xmm9, %xmm5
testl %r15d, %r15d
jle 0x1d84c
movl %eax, %esi
shlq $0x4, %rsi
addq 0x8(%rsp), %rsi
movapd %xmm3, %xmm6
unpcklpd %xmm3, %xmm6            # xmm6 = xmm6[0],xmm3[0]
unpcklpd %xmm5, %xmm4            # xmm4 = xmm4[0],xmm5[0]
xorl %edi, %edi
movupd (%rbx,%rdi), %xmm7
movapd %xmm7, %xmm8
mulpd %xmm4, %xmm8
shufpd $0x1, %xmm8, %xmm8      # xmm8 = xmm8[1,0]
mulpd %xmm6, %xmm7
addpd %xmm8, %xmm7
movupd (%rsi,%rdi), %xmm8
subpd %xmm7, %xmm8
movupd %xmm8, (%rsi,%rdi)
addq $0x10, %rdi
cmpq %rdi, %rbp
jne 0x1d814
addq %r12, %rdx
xorpd %xmm9, %xmm3
movlpd %xmm3, (%rdx)
movsd %xmm5, 0x8(%rdx)
incq %rcx
addl %r15d, %eax
cmpq %r13, %rcx
jne 0x1d7ac
testl %r15d, %r15d
jle 0x1d8b9
movapd %xmm1, %xmm2
unpcklpd %xmm0, %xmm2            # xmm2 = xmm2[0],xmm0[0]
movapd %xmm0, %xmm3
unpcklpd %xmm1, %xmm3            # xmm3 = xmm3[0],xmm1[0]
xorl %eax, %eax
movsd (%rbx,%rax), %xmm4
movsd 0x8(%rbx,%rax), %xmm5
movapd %xmm5, %xmm6
xorpd %xmm9, %xmm6
unpcklpd %xmm5, %xmm6            # xmm6 = xmm6[0],xmm5[0]
mulpd %xmm2, %xmm6
unpcklpd %xmm4, %xmm4            # xmm4 = xmm4[0,0]
mulpd %xmm3, %xmm4
addpd %xmm6, %xmm4
movupd %xmm4, (%rbx,%rax)
addq $0x10, %rax
cmpq %rax, %rbp
jne 0x1d883
movq 0x40(%rsp), %rax
movsd %xmm0, (%rax)
movsd %xmm1, 0x8(%rax)
incq %r14
addq 0x18(%rsp), %r11
addl %r15d, %r10d
cmpq %r13, %r14
movq 0x38(%rsp), %rcx
movq 0x8(%rsp), %rdi
movq 0x30(%rsp), %r12
movq 0x20(%rsp), %r9
movdqa 0xd60f(%rip), %xmm3     # 0x2af00
jne 0x1d693
xorl %eax, %eax
cmpl $0x0, 0x14(%rsp)
jle 0x1d962
movq %r13, %r11
shlq $0x4, %r11
addq $-0x10, %r11
movq %r13, %rdx
leaq -0x1(%rdx), %rsi
movl -0x4(%rcx,%rdx,4), %edi
cmpq %rdi, %rsi
je 0x1d955
movq %r13, %r8
movq 0x8(%rsp), %r9
movslq %edi, %rdi
shlq $0x4, %rdi
movupd (%r9,%r11), %xmm0
movupd (%r9,%rdi), %xmm1
movupd %xmm1, (%r9,%r11)
movslq (%rcx,%rsi,4), %rdi
movq %rdi, %r10
shlq $0x4, %r10
movupd %xmm0, (%r9,%r10)
addq %r12, %r9
decq %r8
jne 0x1d923
addq $-0x10, %r11
cmpq $0x1, %rdx
movq %rsi, %rdx
jg 0x1d90e
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
retq
movl %r14d, %edi
callq 0x569c
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x1d962
nop