// File: /workspace/github_cpp_makefile_star2_O1/manikandan5[P]Image-Matching-Stitching-Warping/./CImg.h
// Function: cimg_library::CImg<double>::invert(bool)
CImg<T>& invert(const bool use_LU=true) {
      if (_width!=_height || _depth!=1 || _spectrum!=1)
        throw CImgInstanceException(_cimg_instance
                                    "invert(): Instance is not a square matrix.",
                                    cimg_instance);
#ifdef cimg_use_lapack
      int INFO = (int)use_LU, N = _width, LWORK = 4*N, *const IPIV = new int[N];
      Tfloat
        *const lapA = new Tfloat[N*N],
        *const WORK = new Tfloat[LWORK];
      cimg_forXY(*this,k,l) lapA[k*N+l] = (Tfloat)((*this)(k,l));
      cimg::getrf(N,lapA,IPIV,INFO);
      if (INFO)
        cimg::warn(_cimg_instance
                   "invert(): LAPACK function dgetrf_() returned error code %d.",
                   cimg_instance,
                   INFO);
      else {
        cimg::getri(N,lapA,IPIV,WORK,LWORK,INFO);
        if (INFO)
          cimg::warn(_cimg_instance
                     "invert(): LAPACK function dgetri_() returned error code %d.",
                     cimg_instance,
                     INFO);
      }
      if (!INFO) cimg_forXY(*this,k,l) (*this)(k,l) = (T)(lapA[k*N+l]); else fill(0);
      delete[] IPIV; delete[] lapA; delete[] WORK;
#else
      const double dete = _width>3?-1.0:det();
      if (dete!=0.0 && _width==2) {
        const double
          a = _data[0], c = _data[1],
          b = _data[2], d = _data[3];
        _data[0] = (T)(d/dete); _data[1] = (T)(-c/dete);
        _data[2] = (T)(-b/dete); _data[3] = (T)(a/dete);
      } else if (dete!=0.0 && _width==3) {
        const double
          a = _data[0], d = _data[1], g = _data[2],
          b = _data[3], e = _data[4], h = _data[5],
          c = _data[6], f = _data[7], i = _data[8];
        _data[0] = (T)((i*e-f*h)/dete), _data[1] = (T)((g*f-i*d)/dete), _data[2] = (T)((d*h-g*e)/dete);
        _data[3] = (T)((h*c-i*b)/dete), _data[4] = (T)((i*a-c*g)/dete), _data[5] = (T)((g*b-a*h)/dete);
        _data[6] = (T)((b*f-e*c)/dete), _data[7] = (T)((d*c-a*f)/dete), _data[8] = (T)((a*e-d*b)/dete);
      } else {
        if (use_LU) { // LU-based inverse computation
          CImg<Tfloat> A(*this), indx, col(1,_width);
          bool d;
          A._LU(indx,d);
          cimg_forX(*this,j) {
            col.fill(0);
            col(j) = 1;
            col._solve(A,indx);
            cimg_forX(*this,i) (*this)(j,i) = (T)col(i);
          }
        } else { // SVD-based inverse computation
          CImg<Tfloat> U(_width,_width), S(1,_width), V(_width,_width);
          SVD(U,S,V,false);
          U.transpose();
          cimg_forY(S,k) if (S[k]!=0) S[k]=1/S[k];
          S.diagonal();
          *this = V*S*U;
        }
      }
#endif
      return *this;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdi, %rbx
movl (%rdi), %eax
cmpl 0x4(%rdi), %eax
jne 0x7866
cmpl $0x1, 0x8(%rbx)
jne 0x7866
cmpl $0x1, 0xc(%rbx)
jne 0x7866
movl %esi, %ebp
cmpl $0x3, %eax
jbe 0x73ae
movsd 0x69c64(%rip), %xmm0    # 0x71010
jmp 0x73b6
movq %rbx, %rdi
callq 0x67fa4
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
setp %al
setne %cl
orb %al, %cl
movl (%rbx), %edx
cmpl $0x2, %edx
sete %al
andb %cl, %al
cmpb $0x1, %al
jne 0x7419
movq 0x18(%rbx), %rax
movapd 0x69ce0(%rip), %xmm1    # 0x710c0
movsd 0x8(%rax), %xmm2
movsd 0x10(%rax), %xmm3
movsd 0x18(%rax), %xmm4
xorpd %xmm1, %xmm2
unpcklpd %xmm2, %xmm4            # xmm4 = xmm4[0],xmm2[0]
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
xorpd %xmm1, %xmm3
movhpd (%rax), %xmm3           # xmm3 = xmm3[0],mem[0]
divpd %xmm0, %xmm4
movupd %xmm4, (%rax)
divpd %xmm0, %xmm3
movupd %xmm3, 0x10(%rax)
jmp 0x7851
ucomisd %xmm1, %xmm0
setp %al
setne %cl
orb %al, %cl
cmpl $0x3, %edx
sete %al
andb %cl, %al
cmpb $0x1, %al
jne 0x7566
movq 0x18(%rbx), %rax
movsd (%rax), %xmm7
movsd 0x8(%rax), %xmm8
movupd 0x38(%rax), %xmm1
movsd 0x10(%rax), %xmm6
movapd %xmm1, %xmm9
shufpd $0x1, %xmm6, %xmm9      # xmm9 = xmm9[1],xmm6[0]
movapd %xmm0, %xmm3
unpcklpd %xmm0, %xmm3            # xmm3 = xmm3[0],xmm0[0]
movupd 0x18(%rax), %xmm2
movupd 0x28(%rax), %xmm4
movapd %xmm4, %xmm10
unpcklpd %xmm8, %xmm10           # xmm10 = xmm10[0],xmm8[0]
mulpd %xmm1, %xmm10
movapd %xmm2, %xmm5
movapd %xmm2, %xmm11
shufpd $0x1, %xmm1, %xmm11     # xmm11 = xmm11[1],xmm1[0]
mulpd %xmm9, %xmm11
subpd %xmm10, %xmm11
divpd %xmm3, %xmm11
pshufd $0x4e, %xmm9, %xmm10    # xmm10 = xmm9[2,3,0,1]
pxor 0x69c1a(%rip), %xmm10   # 0x710c0
movupd %xmm11, (%rax)
movapd %xmm2, %xmm9
shufpd $0x1, %xmm2, %xmm9      # xmm9 = xmm9[1],xmm2[0]
mulpd %xmm10, %xmm9
movapd %xmm1, %xmm10
shufpd $0x1, %xmm2, %xmm10     # xmm10 = xmm10[1],xmm2[0]
movapd %xmm2, %xmm11
movapd %xmm2, %xmm12
unpcklpd %xmm8, %xmm12           # xmm12 = xmm12[0],xmm8[0]
mulsd %xmm8, %xmm2
unpcklpd %xmm4, %xmm8            # xmm8 = xmm8[0],xmm4[0]
mulpd %xmm4, %xmm8
addpd %xmm9, %xmm8
unpckhpd %xmm5, %xmm5            # xmm5 = xmm5[1,1]
divpd %xmm3, %xmm8
movupd %xmm8, 0x10(%rax)
movapd %xmm4, %xmm8
shufpd $0x1, %xmm7, %xmm8      # xmm8 = xmm8[1],xmm7[0]
shufpd $0x1, %xmm7, %xmm11     # xmm11 = xmm11[1],xmm7[0]
mulsd %xmm7, %xmm5
unpcklpd %xmm6, %xmm7            # xmm7 = xmm7[0],xmm6[0]
unpcklpd %xmm4, %xmm6            # xmm6 = xmm6[0],xmm4[0]
mulpd %xmm8, %xmm6
mulpd %xmm7, %xmm10
subpd %xmm6, %xmm10
divpd %xmm3, %xmm10
movupd %xmm10, 0x20(%rax)
movapd %xmm4, %xmm6
shufpd $0x1, %xmm1, %xmm6      # xmm6 = xmm6[1],xmm1[0]
mulpd %xmm6, %xmm11
movsd %xmm1, %xmm4            # xmm4 = xmm1[0],xmm4[1]
mulpd %xmm12, %xmm4
subpd %xmm11, %xmm4
divpd %xmm3, %xmm4
movupd %xmm4, 0x30(%rax)
subsd %xmm2, %xmm5
divsd %xmm0, %xmm5
movsd %xmm5, 0x40(%rax)
jmp 0x7851
testb %bpl, %bpl
je 0x76e2
leaq 0x48(%rsp), %rdi
movq %rbx, %rsi
callq 0x8a94
movq $0x0, 0x38(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x20(%rsp)
movb $0x0, 0x30(%rsp)
movl (%rbx), %edx
movq %rsp, %rdi
movl $0x1, %esi
movl $0x1, %ecx
movl $0x1, %r8d
callq 0x86d2
leaq 0x48(%rsp), %rdi
leaq 0x20(%rsp), %rsi
leaq 0x68(%rsp), %rdx
callq 0x68236
cmpl $0x0, (%rbx)
jle 0x7698
xorl %r13d, %r13d
movabsq $0x3ff0000000000000, %rbp # imm = 0x3FF0000000000000
movq %rsp, %r14
leaq 0x48(%rsp), %r15
leaq 0x20(%rsp), %r12
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
sete %dl
movl (%rsp), %ecx
movl 0x4(%rsp), %eax
testl %ecx, %ecx
sete %sil
orb %dl, %sil
testl %eax, %eax
sete %r8b
movl 0x8(%rsp), %edx
testl %edx, %edx
sete %r9b
orb %r8b, %r9b
orb %sil, %r9b
movl 0xc(%rsp), %esi
testl %esi, %esi
sete %r8b
orb %r9b, %r8b
jne 0x7644
movl %ecx, %ecx
movl %eax, %eax
imulq %rcx, %rax
movl %edx, %ecx
movl %esi, %edx
imulq %rcx, %rdx
imulq %rax, %rdx
shlq $0x3, %rdx
xorl %esi, %esi
callq 0x4290
movq 0x18(%rsp), %rax
movq %rbp, (%rax,%r13,8)
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x685ea
movslq (%rbx), %rax
testq %rax, %rax
jle 0x7689
movq 0x18(%rsp), %rcx
movq 0x18(%rbx), %rdx
movl %r13d, %esi
xorl %edi, %edi
movsd (%rcx,%rdi,8), %xmm0
movl %esi, %r8d
movsd %xmm0, (%rdx,%r8,8)
incq %rdi
addl %eax, %esi
cmpq %rdi, %rax
jne 0x7671
incq %r13
movslq (%rbx), %rax
cmpq %rax, %r13
jl 0x75e5
cmpb $0x0, 0x10(%rsp)
jne 0x76ae
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x76ae
callq 0x4680
cmpb $0x0, 0x30(%rsp)
jne 0x76c4
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x76c4
callq 0x4680
cmpb $0x0, 0x58(%rsp)
jne 0x7851
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x7851
jmp 0x784c
leaq 0x48(%rsp), %rdi
movl %edx, %esi
movl $0x1, %ecx
movl $0x1, %r8d
callq 0x86d2
movl (%rbx), %edx
leaq 0x20(%rsp), %rdi
movl $0x1, %esi
movl $0x1, %ecx
movl $0x1, %r8d
callq 0x86d2
movl (%rbx), %edx
movq %rsp, %rdi
movl %edx, %esi
movl $0x1, %ecx
movl $0x1, %r8d
callq 0x86d2
leaq 0x48(%rsp), %rsi
leaq 0x20(%rsp), %rdx
movq %rsp, %rcx
xorpd %xmm0, %xmm0
movq %rbx, %rdi
xorl %r8d, %r8d
movl $0x28, %r9d
callq 0x68708
leaq 0x48(%rsp), %rdi
callq 0x69ecc
movslq 0x24(%rsp), %rax
testq %rax, %rax
jle 0x7797
movq 0x38(%rsp), %rcx
xorl %edx, %edx
xorpd %xmm0, %xmm0
movsd 0x698a3(%rip), %xmm1    # 0x71018
movsd (%rcx,%rdx,8), %xmm2
ucomisd %xmm0, %xmm2
jne 0x7782
jnp 0x778f
movapd %xmm1, %xmm3
divsd %xmm2, %xmm3
movsd %xmm3, (%rcx,%rdx,8)
incq %rdx
cmpq %rdx, %rax
jne 0x7775
leaq 0x20(%rsp), %rdi
callq 0x6a062
leaq 0x88(%rsp), %rdi
movq %rsp, %rsi
leaq 0x20(%rsp), %rdx
callq 0x6a0cc
leaq 0x68(%rsp), %rdi
leaq 0x88(%rsp), %rsi
leaq 0x48(%rsp), %rdx
callq 0x6a0cc
leaq 0x68(%rsp), %rsi
movq %rbx, %rdi
callq 0x6a24e
cmpb $0x0, 0x78(%rsp)
jne 0x77f3
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x77f3
callq 0x4680
cmpb $0x0, 0x98(%rsp)
jne 0x780f
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x780f
callq 0x4680
cmpb $0x0, 0x10(%rsp)
jne 0x7825
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x7825
callq 0x4680
cmpb $0x0, 0x30(%rsp)
jne 0x783b
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x783b
callq 0x4680
cmpb $0x0, 0x58(%rsp)
jne 0x7851
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x7851
callq 0x4680
movq %rbx, %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x4008, %edi           # imm = 0x4008
callq 0x4210
movq %rax, %r14
movl (%rbx), %edx
movl 0x4(%rbx), %ecx
movl 0x8(%rbx), %r8d
movl 0xc(%rbx), %r9d
leaq 0x6bab1(%rip), %rax     # 0x73338
leaq 0x6ce84(%rip), %r10     # 0x74712
cmpb $0x0, 0x10(%rbx)
cmovneq %rax, %r10
subq $0x8, %rsp
leaq 0x8c34e(%rip), %r11     # 0x93bef
leaq 0x9048f(%rip), %rsi     # 0x97d37
movq %r14, %rdi
xorl %eax, %eax
pushq %r11
pushq %r10
pushq 0x18(%rbx)
callq 0xbfd8
addq $0x20, %rsp
leaq 0xa5344(%rip), %rsi     # 0xacc08
movq 0xa5705(%rip), %rdx     # 0xacfd0
movq %r14, %rdi
callq 0x4900
movq %rax, %rbx
cmpb $0x0, 0x78(%rsp)
jne 0x78f4
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x78f4
callq 0x4680
jmp 0x78f4
movq %rax, %rbx
cmpb $0x0, 0x98(%rsp)
jne 0x7968
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x7968
callq 0x4680
jmp 0x7968
jmp 0x7965
movq %rax, %rbx
jmp 0x797e
movq %rax, %rbx
cmpb $0x0, 0x10(%rsp)
jne 0x793c
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x793c
callq 0x4680
jmp 0x793c
movq %rax, %rbx
jmp 0x7994
movq %rax, %rbx
cmpb $0x0, 0x30(%rsp)
jne 0x7952
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x7952
callq 0x4680
cmpb $0x0, 0x58(%rsp)
jne 0x79b7
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x79b7
jmp 0x79a5
movq %rax, %rbx
cmpb $0x0, 0x10(%rsp)
jne 0x797e
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x797e
callq 0x4680
cmpb $0x0, 0x30(%rsp)
jne 0x7994
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x7994
callq 0x4680
cmpb $0x0, 0x58(%rsp)
jne 0x79b7
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x79b7
callq 0x4680
jmp 0x79b7
movq %rax, %rbx
movq %r14, %rdi
callq 0x43b0
movq %rbx, %rdi
callq 0x4950
nop