// File: /workspace/github_c_makefile_star2_O2/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, %r9
xorl %r11d, %r11d
testl %r9d, %r9d
movl $0x0, %r15d
cmovgl %r9d, %r15d
testl %esi, %esi
movl $0x0, %r10d
cmovgl %esi, %r10d
movl %esi, 0x8(%rsp)
movl %esi, %esi
movq %r9, %rbp
shlq $0x4, %rbp
leaq 0x10(%rbp), %rax
movq %rax, 0x18(%rsp)
movq %r15, 0x10(%rsp)
shlq $0x4, %r15
movdqa 0xd813(%rip), %xmm3     # 0x26e60
movq %rdi, %r14
movq %rdi, %r8
xorl %r13d, %r13d
movq %rdi, 0x38(%rsp)
movq %r10, 0x30(%rsp)
movl %edx, 0xc(%rsp)
movq %r9, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
cmpq %r10, %r13
je 0x198c3
xorpd %xmm0, %xmm0
movq %r8, %rax
movq %r13, %rcx
cmpq %rcx, %rsi
je 0x196ad
movdqu (%rax), %xmm2
pand %xmm3, %xmm2
pshufd $0xee, %xmm2, %xmm1     # xmm1 = xmm2[2,3,2,3]
addsd %xmm2, %xmm1
ucomisd %xmm0, %xmm1
jbe 0x196a5
movl %ecx, (%rbx,%r13,4)
movapd %xmm1, %xmm0
incq %rcx
addq %rbp, %rax
jmp 0x19681
movsd 0xd783(%rip), %xmm1     # 0x26e38
ucomisd %xmm0, %xmm1
ja 0x1992b
movq %r8, 0x48(%rsp)
movl (%rbx,%r13,4), %eax
cmpq %rax, %r13
jne 0x1987a
movq %r11, 0x50(%rsp)
movq %r13, %rax
imulq %r9, %rax
shlq $0x4, %rax
movq %r13, %r12
shlq $0x4, %r12
addq %rdi, %r12
leaq (%r12,%rax), %rcx
movq %rcx, 0x40(%rsp)
movsd (%rax,%r12), %xmm2
movsd 0x8(%rax,%r12), %xmm3
xorpd %xmm1, %xmm1
movsd 0x59a3(%rip), %xmm0     # 0x1f0b0
callq 0x19312
movq 0x28(%rsp), %r9
movq 0x38(%rsp), %rdi
movapd %xmm1, %xmm2
movapd 0x5927(%rip), %xmm9     # 0x1f050
xorpd %xmm9, %xmm2
movq %rdi, %rax
xorl %ecx, %ecx
movq 0x30(%rsp), %r10
movq 0x48(%rsp), %r8
cmpq %r10, %rcx
je 0x197f6
cmpq %r13, %rcx
je 0x197eb
movq %rcx, %rsi
imulq %r9, %rsi
shlq $0x4, %rsi
leaq (%r12,%rsi), %rdx
movsd (%r12,%rsi), %xmm5
movsd 0x8(%r12,%rsi), %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
movapd %xmm3, %xmm6
unpcklpd %xmm3, %xmm6            # xmm6 = xmm6[0],xmm3[0]
unpcklpd %xmm5, %xmm4            # xmm4 = xmm4[0],xmm5[0]
xorl %esi, %esi
cmpq %rsi, %r15
je 0x197dd
movupd (%r14,%rsi), %xmm7
movapd %xmm7, %xmm8
mulpd %xmm4, %xmm8
shufpd $0x1, %xmm8, %xmm8      # xmm8 = xmm8[1,0]
mulpd %xmm6, %xmm7
addpd %xmm8, %xmm7
movupd (%rax,%rsi), %xmm8
subpd %xmm7, %xmm8
movupd %xmm8, (%rax,%rsi)
addq $0x10, %rsi
jmp 0x197a2
xorpd %xmm9, %xmm3
movlpd %xmm3, (%rdx)
movsd %xmm5, 0x8(%rdx)
incq %rcx
addq %rbp, %rax
jmp 0x1973d
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
movl 0xc(%rsp), %edx
movq 0x50(%rsp), %r11
movq 0x20(%rsp), %rsi
cmpq %rax, %r15
je 0x19851
movsd (%r14,%rax), %xmm4
movsd 0x8(%r14,%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, (%r14,%rax)
addq $0x10, %rax
jmp 0x19816
movq 0x40(%rsp), %rax
movsd %xmm0, (%rax)
movsd %xmm1, 0x8(%rax)
incq %r13
addq 0x18(%rsp), %r8
addq %rbp, %r11
addq %rbp, %r14
movdqa 0xd5eb(%rip), %xmm3     # 0x26e60
jmp 0x1966e
movq 0x10(%rsp), %rcx
movq %rdi, %r8
subq $0x1, %rcx
jb 0x196d1
imull %edx, %eax
cltq
shlq $0x4, %rax
movupd (%r8,%r11), %xmm0
movupd (%r8,%rax), %xmm1
movupd %xmm1, (%r8,%r11)
movl (%rbx,%r13,4), %eax
movl %eax, %esi
imull %edx, %esi
movslq %esi, %rsi
shlq $0x4, %rsi
movupd %xmm0, (%r8,%rsi)
addq $0x10, %r8
jmp 0x19882
movslq 0x8(%rsp), %rax
movq %rax, %rcx
shlq $0x4, %rcx
addq $-0x10, %rcx
testq %rax, %rax
jle 0x1991a
decq %rax
movl (%rbx,%rax,4), %edx
cmpl %eax, %edx
je 0x198cf
movq %rdi, %rsi
movq %r10, %r9
subq $0x1, %r9
jb 0x198cf
movslq %edx, %rdx
shlq $0x4, %rdx
movupd (%rsi,%rcx), %xmm0
movupd (%rsi,%rdx), %xmm1
movupd %xmm1, (%rsi,%rcx)
movslq (%rbx,%rax,4), %rdx
movq %rdx, %r8
shlq $0x4, %r8
movupd %xmm0, (%rsi,%r8)
addq %rbp, %rsi
jmp 0x198e8
xorl %eax, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x166c6(%rip), %rax     # 0x2fff8
movq (%rax), %rdi
incl %r13d
leaq 0xd595(%rip), %rsi      # 0x26ed4
movl %r13d, %edx
xorl %eax, %eax
callq 0x21c0
pushq $-0x1
popq %rax
jmp 0x1991c
nop