// File: /workspace/github_cpp_makefile_star2_O1/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 0x899c
cmpl $0x1, 0x8(%rbx)
jne 0x899c
cmpl $0x1, 0xc(%rbx)
jne 0x899c
movl 0x4(%r14), %eax
cmpl %eax, 0x4(%rbx)
jne 0x899c
cmpl $0x1, 0x8(%r14)
jne 0x899c
cmpl $0x1, 0xc(%r14)
jne 0x899c
cmpl %eax, (%r14)
jne 0x891f
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x38e0e
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 0x68236
leaq 0x10(%rsp), %rsi
leaq 0x30(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rdx
callq 0x685ea
cmpb $0x0, 0x10(%r14)
jne 0x890c
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x890c
callq 0x4680
cmpb $0x0, 0x20(%rsp)
jne 0x898a
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x898a
jmp 0x8985
leaq 0x30(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x6cbbe
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x6a0cc
movq 0x28(%rsp), %rsi
movl 0x10(%rsp), %edx
movl 0x14(%rsp), %ecx
movl 0x18(%rsp), %r8d
movl 0x1c(%rsp), %r9d
movq %rbx, %rdi
callq 0xb8ee
cmpb $0x0, 0x20(%rsp)
jne 0x8974
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x8974
callq 0x4680
cmpb $0x0, 0x40(%rsp)
jne 0x898a
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x898a
callq 0x4680
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 0x6a97b(%rip), %rax     # 0x73338
leaq 0x6bd4e(%rip), %r10     # 0x74712
cmpb $0x0, 0x10(%rbx)
cmovneq %rax, %r10
movl (%r14), %r11d
movl 0x4(%r14), %r12d
movl 0x8(%r14), %r13d
movl 0xc(%r14), %ebp
leaq 0x8f487(%rip), %rsi     # 0x97e69
movq %r15, %rdi
xorl %eax, %eax
pushq 0x18(%r14)
pushq %rbp
pushq %r13
pushq %r12
pushq %r11
leaq 0x8b1f6(%rip), %r11     # 0x93bef
pushq %r11
pushq %r10
pushq 0x18(%rbx)
callq 0xc196
addq $0x40, %rsp
leaq 0xa4210(%rip), %rsi     # 0xacc20
movq 0xa45b9(%rip), %rdx     # 0xacfd0
movq %r15, %rdi
callq 0x4900
movq %rax, %rbx
cmpb $0x0, 0x20(%rsp)
jne 0x8a3d
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x8a3d
callq 0x4680
jmp 0x8a3d
movq %rax, %rbx
cmpb $0x0, 0x40(%rsp)
jne 0x8a8c
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x8a8c
jmp 0x8a7a
movq %rax, %rbx
cmpb $0x0, 0x40(%rsp)
jne 0x8a69
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x8a69
callq 0x4680
cmpb $0x0, 0x20(%rsp)
jne 0x8a8c
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x8a8c
callq 0x4680
jmp 0x8a8c
movq %rax, %rbx
movq %r15, %rdi
callq 0x43b0
movq %rbx, %rdi
callq 0x4950