// File: /workspace/github_cpp_makefile_star2_O2/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), %edx
cmpl 0x4(%rdi), %edx
jne 0x6363
cmpl $0x1, 0x8(%rbx)
jne 0x6363
cmpl $0x1, 0xc(%rbx)
jne 0x6363
movl %esi, %ebp
cmpl $0x3, %edx
jbe 0x6079
testb %bpl, %bpl
je 0x60e8
leaq 0x48(%rsp), %rdi
movq %rbx, %rsi
callq 0x7064
andq $0x0, 0x18(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, (%rsp)
movb $0x0, 0x10(%rsp)
movl (%rbx), %edx
leaq 0x28(%rsp), %rdi
pushq $0x1
popq %rcx
movl %ecx, %esi
movl %ecx, %r8d
callq 0x6caa
leaq 0x48(%rsp), %rdi
movq %rsp, %rsi
leaq 0x68(%rsp), %rdx
callq 0x4c338
movl (%rbx), %eax
xorl %r13d, %r13d
leaq 0x28(%rsp), %r14
movabsq $0x3ff0000000000000, %rbp # imm = 0x3FF0000000000000
leaq 0x48(%rsp), %r15
movq %rsp, %r12
cltq
cmpq %rax, %r13
jge 0x618b
xorpd %xmm0, %xmm0
movq %r14, %rdi
callq 0x2aca6
movq 0x40(%rsp), %rax
movq %rbp, (%rax,%r13,8)
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x4c6de
movl (%rbx), %eax
movq 0x40(%rsp), %rcx
movq 0x18(%rbx), %rdx
testl %eax, %eax
movl $0x0, %esi
cmovgl %eax, %esi
movl %r13d, %edi
xorl %r8d, %r8d
cmpq %r8, %rsi
je 0x6074
movsd (%rcx,%r8,8), %xmm0
movl %edi, %r9d
movsd %xmm0, (%rdx,%r9,8)
incq %r8
addl %eax, %edi
jmp 0x6059
incq %r13
jmp 0x6010
movq %rbx, %rdi
callq 0x4c114
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
movl (%rbx), %edx
setp %al
setne %cl
orb %al, %cl
cmpl $0x2, %edx
sete %al
andb %cl, %al
cmpb $0x1, %al
jne 0x6216
movq 0x18(%rbx), %rax
movapd 0x4e011(%rip), %xmm1    # 0x540c0
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 0x6201
leaq 0x48(%rsp), %rdi
pushq $0x1
popq %rbp
movl %edx, %esi
movl %ebp, %ecx
movl %ebp, %r8d
callq 0x6caa
movl (%rbx), %edx
movq %rsp, %rdi
movl %ebp, %esi
movl %ebp, %ecx
movl %ebp, %r8d
callq 0x6caa
movl (%rbx), %edx
leaq 0x28(%rsp), %rdi
pushq $0x1
popq %rcx
movl %edx, %esi
movl %ecx, %r8d
callq 0x6caa
leaq 0x48(%rsp), %rsi
movq %rsp, %rdx
leaq 0x28(%rsp), %rcx
pushq $0x28
popq %r9
xorpd %xmm0, %xmm0
movq %rbx, %rdi
xorl %r8d, %r8d
callq 0x4c822
leaq 0x48(%rsp), %rdi
callq 0x4dad8
movl 0x4(%rsp), %eax
movq 0x18(%rsp), %rcx
xorl %edx, %edx
testl %eax, %eax
cmovlel %edx, %eax
xorpd %xmm0, %xmm0
movsd 0x4dea9(%rip), %xmm1    # 0x54010
cmpq %rdx, %rax
je 0x618d
movsd (%rcx,%rdx,8), %xmm2
ucomisd %xmm0, %xmm2
jne 0x6179
jnp 0x6186
movapd %xmm1, %xmm3
divsd %xmm2, %xmm3
movsd %xmm3, (%rcx,%rdx,8)
incq %rdx
jmp 0x6167
jmp 0x61e5
movq %rsp, %rdi
callq 0x4dc4e
leaq 0x88(%rsp), %rdi
leaq 0x28(%rsp), %rsi
movq %rsp, %rdx
callq 0x4dca0
leaq 0x68(%rsp), %rdi
leaq 0x88(%rsp), %rsi
leaq 0x48(%rsp), %rdx
callq 0x4dca0
leaq 0x68(%rsp), %rsi
movq %rbx, %rdi
callq 0x4de22
leaq 0x68(%rsp), %rdi
callq 0x6c96
leaq 0x88(%rsp), %rdi
callq 0x6c96
leaq 0x28(%rsp), %rdi
callq 0x6c96
movq %rsp, %rdi
callq 0x6c96
leaq 0x48(%rsp), %rdi
callq 0x6c96
movq %rbx, %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
ucomisd %xmm1, %xmm0
setp %al
setne %cl
orb %al, %cl
cmpl $0x3, %edx
sete %al
andb %cl, %al
cmpb $0x1, %al
jne 0x5fa4
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 0x4de1d(%rip), %xmm10   # 0x540c0
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 0x6201
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 0x4e464(%rip), %rax     # 0x547e8
leaq 0x4f837(%rip), %r10     # 0x55bc2
cmpb $0x0, 0x10(%rbx)
cmovneq %rax, %r10
subq $0x8, %rsp
leaq 0x6ed01(%rip), %r11     # 0x7509f
leaq 0x72e82(%rip), %rsi     # 0x79227
movq %r14, %rdi
xorl %eax, %eax
pushq %r11
pushq %r10
pushq 0x18(%rbx)
callq 0x9bf8
addq $0x20, %rsp
leaq 0x89887(%rip), %rsi     # 0x8fc48
movq 0x89c10(%rip), %rdx     # 0x8ffd8
movq %r14, %rdi
callq 0x4910
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x6c96
jmp 0x63e2
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x6c96
jmp 0x6429
jmp 0x6426
movq %rax, %rbx
jmp 0x6433
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x6c96
jmp 0x640f
movq %rax, %rbx
jmp 0x643b
movq %rax, %rbx
movq %rsp, %rdi
callq 0x6c96
jmp 0x643b
movq %rax, %rbx
movq %r14, %rdi
callq 0x4390
jmp 0x6445
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x6c96
movq %rsp, %rdi
callq 0x6c96
leaq 0x48(%rsp), %rdi
callq 0x6c96
movq %rbx, %rdi
callq 0x4950
nop