// File: /workspace/github_cpp_makefile_star2_O3/manikandan5[P]Image-Matching-Stitching-Warping/./CImg.h
// Function: cimg_library::CImg<double>& cimg_library::CImg<double>::solve<double>(cimg_library::CImg<double> const&)
CImg<T>& solve(const CImg<t>& A) {
      if (_width!=1 || _depth!=1 || _spectrum!=1 || _height!=A._height || A._depth!=1 || A._spectrum!=1)
        throw CImgArgumentException(_cimg_instance
                                    "solve(): Instance and specified matrix (%u,%u,%u,%u,%p) have "
                                    "incompatible dimensions.",
                                    cimg_instance,
                                    A._width,A._height,A._depth,A._spectrum,A._data);
      typedef _cimg_Ttfloat Ttfloat;
      if (A._width==A._height) {
#ifdef cimg_use_lapack
        char TRANS = 'N';
        int INFO, N = _height, LWORK = 4*N, *const IPIV = new int[N];
        Ttfloat
          *const lapA = new Ttfloat[N*N],
          *const lapB = new Ttfloat[N],
          *const WORK = new Ttfloat[LWORK];
        cimg_forXY(A,k,l) lapA[k*N+l] = (Ttfloat)(A(k,l));
        cimg_forY(*this,i) lapB[i] = (Ttfloat)((*this)(i));
        cimg::getrf(N,lapA,IPIV,INFO);
        if (INFO)
          cimg::warn(_cimg_instance
                     "solve(): LAPACK library function dgetrf_() returned error code %d.",
                     cimg_instance,
                     INFO);

        if (!INFO) {
          cimg::getrs(TRANS,N,lapA,IPIV,lapB,INFO);
          if (INFO)
            cimg::warn(_cimg_instance
                       "solve(): LAPACK library function dgetrs_() returned error code %d.",
                       cimg_instance,
                       INFO);
        }
        if (!INFO) cimg_forY(*this,i) (*this)(i) = (T)(lapB[i]); else fill(0);
        delete[] IPIV; delete[] lapA; delete[] lapB; delete[] WORK;
#else
        CImg<Ttfloat> lu(A,false);
        CImg<Ttfloat> indx;
        bool d;
        lu._LU(indx,d);
        _solve(lu,indx);
#endif
      } else { // Least-square solution for non-square systems.
#ifdef cimg_use_lapack
        char TRANS = 'N';
        int INFO, N = A._width, M = A._height, LWORK = -1, LDA = M, LDB = M, NRHS = _width;
        Ttfloat WORK_QUERY;
        Ttfloat
          * const lapA = new Ttfloat[M*N],
          * const lapB = new Ttfloat[M*NRHS];
        cimg::sgels(TRANS, M, N, NRHS, lapA, LDA, lapB, LDB, &WORK_QUERY, LWORK, INFO);
        LWORK = (int) WORK_QUERY;
        Ttfloat *const WORK = new Ttfloat[LWORK];
        cimg_forXY(A,k,l) lapA[k*M+l] = (Ttfloat)(A(k,l));
        cimg_forXY(*this,k,l) lapB[k*M+l] = (Ttfloat)((*this)(k,l));
        cimg::sgels(TRANS, M, N, NRHS, lapA, LDA, lapB, LDB, WORK, LWORK, INFO);
        if (INFO != 0)
          cimg::warn(_cimg_instance
                     "solve(): LAPACK library function sgels() returned error code %d.",
                     cimg_instance,
                     INFO);
        assign(NRHS, N);
        if (!INFO != 0)
          cimg_forXY(*this,k,l) (*this)(k,l) = (T)lapB[k*M+l];
        else
          assign(A.get_pseudoinvert()*(*this));
        delete[] lapA; delete[] lapB; delete[] WORK;
#else
        assign(A.get_pseudoinvert()*(*this));
#endif
      }
      return *this;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %r14
movq %rdi, %rbx
cmpl $0x1, (%rdi)
jne 0x893e
cmpl $0x1, 0x8(%rbx)
jne 0x893e
cmpl $0x1, 0xc(%rbx)
jne 0x893e
movl 0x4(%rbx), %eax
cmpl 0x4(%r14), %eax
jne 0x893e
cmpl $0x1, 0x8(%r14)
jne 0x893e
cmpl $0x1, 0xc(%r14)
jne 0x893e
cmpl %eax, (%r14)
jne 0x88c1
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x3716c
leaq 0x30(%rsp), %rsi
movq $0x0, 0x18(%rsi)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsi)
movb $0x0, 0x10(%rsi)
leaq 0xf(%rsp), %rdx
movq %r15, %rdi
callq 0x65532
leaq 0x10(%rsp), %rsi
leaq 0x30(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rdx
callq 0x658c2
cmpb $0x0, 0x10(%r14)
jne 0x88ae
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x88ae
callq 0x4690
cmpb $0x0, 0x20(%rsp)
jne 0x892c
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x892c
jmp 0x8927
leaq 0x30(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x69b20
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x671b2
movq 0x28(%rsp), %rsi
movl 0x10(%rsp), %edx
movl 0x14(%rsp), %ecx
movl 0x18(%rsp), %r8d
movl 0x1c(%rsp), %r9d
movq %rbx, %rdi
callq 0xb880
cmpb $0x0, 0x20(%rsp)
jne 0x8916
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x8916
callq 0x4690
cmpb $0x0, 0x40(%rsp)
jne 0x892c
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x892c
callq 0x4690
movq %rbx, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x4008, %edi           # imm = 0x4008
callq 0x4210
movq %rax, %r15
movl (%rbx), %edx
movl 0x4(%rbx), %ecx
movl 0x8(%rbx), %r8d
movl 0xc(%rbx), %r9d
leaq 0x65f09(%rip), %rax     # 0x6e868
leaq 0x672dc(%rip), %r10     # 0x6fc42
cmpb $0x0, 0x10(%rbx)
cmovneq %rax, %r10
movl (%r14), %r11d
movl 0x4(%r14), %r12d
movl 0x8(%r14), %r13d
movl 0xc(%r14), %ebp
leaq 0x8a91f(%rip), %rsi     # 0x932a3
movq %r15, %rdi
xorl %eax, %eax
pushq 0x18(%r14)
pushq %rbp
pushq %r13
pushq %r12
pushq %r11
leaq 0x86784(%rip), %r11     # 0x8f11f
pushq %r11
pushq %r10
pushq 0x18(%rbx)
callq 0xc16a
addq $0x40, %rsp
leaq 0x9f29e(%rip), %rsi     # 0xa7c50
movq 0x9f617(%rip), %rdx     # 0xa7fd0
movq %r15, %rdi
callq 0x4910
movq %rax, %rbx
cmpb $0x0, 0x20(%rsp)
jne 0x89df
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x89df
callq 0x4690
jmp 0x89df
movq %rax, %rbx
cmpb $0x0, 0x40(%rsp)
jne 0x8a2e
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x8a2e
jmp 0x8a1c
movq %rax, %rbx
cmpb $0x0, 0x40(%rsp)
jne 0x8a0b
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x8a0b
callq 0x4690
cmpb $0x0, 0x20(%rsp)
jne 0x8a2e
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x8a2e
callq 0x4690
jmp 0x8a2e
movq %rax, %rbx
movq %r15, %rdi
callq 0x43c0
movq %rbx, %rdi
callq 0x4960