// File: manikandan5[P]Image-Matching-Stitching-Warping/./CImg.h
// Function: cimg_library::CImg<double>& cimg_library::CImg<double>::_quicksort<int>(int, int, cimg_library::CImg<int>&, bool, bool)
CImg<T>& _quicksort(const int indm, const int indM, CImg<t>& permutations,
                        const bool is_increasing, const bool is_permutations) {
      if (indm<indM) {
        const int mid = (indm + indM)/2;
        if (is_increasing) {
          if ((*this)[indm]>(*this)[mid]) {
            cimg::swap((*this)[indm],(*this)[mid]);
            if (is_permutations) cimg::swap(permutations[indm],permutations[mid]);
          }
          if ((*this)[mid]>(*this)[indM]) {
            cimg::swap((*this)[indM],(*this)[mid]);
            if (is_permutations) cimg::swap(permutations[indM],permutations[mid]);
          }
          if ((*this)[indm]>(*this)[mid]) {
            cimg::swap((*this)[indm],(*this)[mid]);
            if (is_permutations) cimg::swap(permutations[indm],permutations[mid]);
          }
        } else {
          if ((*this)[indm]<(*this)[mid]) {
            cimg::swap((*this)[indm],(*this)[mid]);
            if (is_permutations) cimg::swap(permutations[indm],permutations[mid]);
          }
          if ((*this)[mid]<(*this)[indM]) {
            cimg::swap((*this)[indM],(*this)[mid]);
            if (is_permutations) cimg::swap(permutations[indM],permutations[mid]);
          }
          if ((*this)[indm]<(*this)[mid]) {
            cimg::swap((*this)[indm],(*this)[mid]);
            if (is_permutations) cimg::swap(permutations[indm],permutations[mid]);
          }
        }
        if (indM - indm>=3) {
          const T pivot = (*this)[mid];
          int i = indm, j = indM;
          if (is_increasing) {
            do {
              while ((*this)[i]<pivot) ++i;
              while ((*this)[j]>pivot) --j;
              if (i<=j) {
                if (is_permutations) cimg::swap(permutations[i],permutations[j]);
                cimg::swap((*this)[i++],(*this)[j--]);
              }
            } while (i<=j);
          } else {
            do {
              while ((*this)[i]>pivot) ++i;
              while ((*this)[j]<pivot) --j;
              if (i<=j) {
                if (is_permutations) cimg::swap(permutations[i],permutations[j]);
                cimg::swap((*this)[i++],(*this)[j--]);
              }
            } while (i<=j);
          }
          if (indm<j) _quicksort(indm,j,permutations,is_increasing,is_permutations);
          if (i<indM) _quicksort(i,indM,permutations,is_increasing,is_permutations);
        }
      }
      return *this;
    }

// Assembly:
subq $0x108, %rsp            # imm = 0x108
movl %r8d, 0xbc(%rsp)
movq %rcx, %rax
movl 0xbc(%rsp), %ecx
movq %rax, 0xc0(%rsp)
movl %edx, %eax
movq 0xc0(%rsp), %rdx
movl %eax, 0xc8(%rsp)
movl %esi, %eax
movl 0xc8(%rsp), %esi
movl %eax, 0xcc(%rsp)
movq %rdi, %r8
movl 0xcc(%rsp), %edi
movb %r9b, %al
movq %r8, 0x100(%rsp)
movl %edi, 0xfc(%rsp)
movl %esi, 0xf8(%rsp)
movq %rdx, 0xf0(%rsp)
andb $0x1, %cl
movb %cl, 0xef(%rsp)
andb $0x1, %al
movb %al, 0xee(%rsp)
movq 0x100(%rsp), %rax
movq %rax, 0xd0(%rsp)
movl 0xfc(%rsp), %eax
cmpl 0xf8(%rsp), %eax
jge 0xbbce9
movl 0xfc(%rsp), %eax
addl 0xf8(%rsp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, 0xe8(%rsp)
testb $0x1, 0xef(%rsp)
je 0xbb660
movq 0xd0(%rsp), %rdi
callq 0x5cf30
movq 0xd0(%rsp), %rdi
movslq 0xfc(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0xb0(%rsp)
callq 0x5cf30
movsd 0xb0(%rsp), %xmm0
movslq 0xe8(%rsp), %rcx
ucomisd (%rax,%rcx,8), %xmm0
jbe 0xbb477
movq 0xd0(%rsp), %rdi
callq 0x5cf30
movq 0xd0(%rsp), %rdi
movslq 0xfc(%rsp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, 0xa8(%rsp)
callq 0x5cf30
movq 0xa8(%rsp), %rdi
movq %rax, %rsi
movslq 0xe8(%rsp), %rax
shlq $0x3, %rax
addq %rax, %rsi
callq 0xbaf90
testb $0x1, 0xee(%rsp)
je 0xbb475
movq 0xf0(%rsp), %rdi
callq 0xbb2a0
movslq 0xfc(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0xa0(%rsp)
movq 0xf0(%rsp), %rdi
callq 0xbb2a0
movq 0xa0(%rsp), %rdi
movq %rax, %rsi
movslq 0xe8(%rsp), %rax
shlq $0x2, %rax
addq %rax, %rsi
callq 0x327e0
jmp 0xbb477
movq 0xd0(%rsp), %rdi
callq 0x5cf30
movq 0xd0(%rsp), %rdi
movslq 0xe8(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x98(%rsp)
callq 0x5cf30
movsd 0x98(%rsp), %xmm0
movslq 0xf8(%rsp), %rcx
ucomisd (%rax,%rcx,8), %xmm0
jbe 0xbb56f
movq 0xd0(%rsp), %rdi
callq 0x5cf30
movq 0xd0(%rsp), %rdi
movslq 0xf8(%rsp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, 0x90(%rsp)
callq 0x5cf30
movq 0x90(%rsp), %rdi
movq %rax, %rsi
movslq 0xe8(%rsp), %rax
shlq $0x3, %rax
addq %rax, %rsi
callq 0xbaf90
testb $0x1, 0xee(%rsp)
je 0xbb56d
movq 0xf0(%rsp), %rdi
callq 0xbb2a0
movslq 0xf8(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x88(%rsp)
movq 0xf0(%rsp), %rdi
callq 0xbb2a0
movq 0x88(%rsp), %rdi
movq %rax, %rsi
movslq 0xe8(%rsp), %rax
shlq $0x2, %rax
addq %rax, %rsi
callq 0x327e0
jmp 0xbb56f
movq 0xd0(%rsp), %rdi
callq 0x5cf30
movq 0xd0(%rsp), %rdi
movslq 0xfc(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x80(%rsp)
callq 0x5cf30
movsd 0x80(%rsp), %xmm0
movslq 0xe8(%rsp), %rcx
ucomisd (%rax,%rcx,8), %xmm0
jbe 0xbb65b
movq 0xd0(%rsp), %rdi
callq 0x5cf30
movq 0xd0(%rsp), %rdi
movslq 0xfc(%rsp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, 0x78(%rsp)
callq 0x5cf30
movq 0x78(%rsp), %rdi
movq %rax, %rsi
movslq 0xe8(%rsp), %rax
shlq $0x3, %rax
addq %rax, %rsi
callq 0xbaf90
testb $0x1, 0xee(%rsp)
je 0xbb659
movq 0xf0(%rsp), %rdi
callq 0xbb2a0
movslq 0xfc(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x70(%rsp)
movq 0xf0(%rsp), %rdi
callq 0xbb2a0
movq 0x70(%rsp), %rdi
movq %rax, %rsi
movslq 0xe8(%rsp), %rax
shlq $0x2, %rax
addq %rax, %rsi
callq 0x327e0
jmp 0xbb65b
jmp 0xbb920
movq 0xd0(%rsp), %rdi
callq 0x5cf30
movq 0xd0(%rsp), %rdi
movslq 0xfc(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x68(%rsp)
callq 0x5cf30
movsd 0x68(%rsp), %xmm1
movslq 0xe8(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xbb74a
movq 0xd0(%rsp), %rdi
callq 0x5cf30
movq 0xd0(%rsp), %rdi
movslq 0xfc(%rsp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, 0x60(%rsp)
callq 0x5cf30
movq 0x60(%rsp), %rdi
movq %rax, %rsi
movslq 0xe8(%rsp), %rax
shlq $0x3, %rax
addq %rax, %rsi
callq 0xbaf90
testb $0x1, 0xee(%rsp)
je 0xbb748
movq 0xf0(%rsp), %rdi
callq 0xbb2a0
movslq 0xfc(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x58(%rsp)
movq 0xf0(%rsp), %rdi
callq 0xbb2a0
movq 0x58(%rsp), %rdi
movq %rax, %rsi
movslq 0xe8(%rsp), %rax
shlq $0x2, %rax
addq %rax, %rsi
callq 0x327e0
jmp 0xbb74a
movq 0xd0(%rsp), %rdi
callq 0x5cf30
movq 0xd0(%rsp), %rdi
movslq 0xe8(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x50(%rsp)
callq 0x5cf30
movsd 0x50(%rsp), %xmm1
movslq 0xf8(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xbb834
movq 0xd0(%rsp), %rdi
callq 0x5cf30
movq 0xd0(%rsp), %rdi
movslq 0xf8(%rsp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, 0x48(%rsp)
callq 0x5cf30
movq 0x48(%rsp), %rdi
movq %rax, %rsi
movslq 0xe8(%rsp), %rax
shlq $0x3, %rax
addq %rax, %rsi
callq 0xbaf90
testb $0x1, 0xee(%rsp)
je 0xbb832
movq 0xf0(%rsp), %rdi
callq 0xbb2a0
movslq 0xf8(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x40(%rsp)
movq 0xf0(%rsp), %rdi
callq 0xbb2a0
movq 0x40(%rsp), %rdi
movq %rax, %rsi
movslq 0xe8(%rsp), %rax
shlq $0x2, %rax
addq %rax, %rsi
callq 0x327e0
jmp 0xbb834
movq 0xd0(%rsp), %rdi
callq 0x5cf30
movq 0xd0(%rsp), %rdi
movslq 0xfc(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x38(%rsp)
callq 0x5cf30
movsd 0x38(%rsp), %xmm1
movslq 0xe8(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xbb91e
movq 0xd0(%rsp), %rdi
callq 0x5cf30
movq 0xd0(%rsp), %rdi
movslq 0xfc(%rsp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, 0x30(%rsp)
callq 0x5cf30
movq 0x30(%rsp), %rdi
movq %rax, %rsi
movslq 0xe8(%rsp), %rax
shlq $0x3, %rax
addq %rax, %rsi
callq 0xbaf90
testb $0x1, 0xee(%rsp)
je 0xbb91c
movq 0xf0(%rsp), %rdi
callq 0xbb2a0
movslq 0xfc(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x28(%rsp)
movq 0xf0(%rsp), %rdi
callq 0xbb2a0
movq 0x28(%rsp), %rdi
movq %rax, %rsi
movslq 0xe8(%rsp), %rax
shlq $0x2, %rax
addq %rax, %rsi
callq 0x327e0
jmp 0xbb91e
jmp 0xbb920
movl 0xf8(%rsp), %eax
subl 0xfc(%rsp), %eax
cmpl $0x3, %eax
jl 0xbbce7
movq 0xd0(%rsp), %rdi
callq 0x5cf30
movslq 0xe8(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0xe0(%rsp)
movl 0xfc(%rsp), %eax
movl %eax, 0xdc(%rsp)
movl 0xf8(%rsp), %eax
movl %eax, 0xd8(%rsp)
testb $0x1, 0xef(%rsp)
je 0xbbae6
jmp 0xbb986
jmp 0xbb988
movq 0xd0(%rsp), %rdi
callq 0x5cf30
movslq 0xdc(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm1
movsd 0xe0(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xbb9c4
movl 0xdc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xdc(%rsp)
jmp 0xbb988
jmp 0xbb9c6
movq 0xd0(%rsp), %rdi
callq 0x5cf30
movslq 0xd8(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
ucomisd 0xe0(%rsp), %xmm0
jbe 0xbb9fe
movl 0xd8(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0xd8(%rsp)
jmp 0xbb9c6
movl 0xdc(%rsp), %eax
cmpl 0xd8(%rsp), %eax
jg 0xbbacb
testb $0x1, 0xee(%rsp)
je 0xbba66
movq 0xf0(%rsp), %rdi
callq 0xbb2a0
movslq 0xdc(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x20(%rsp)
movq 0xf0(%rsp), %rdi
callq 0xbb2a0
movq 0x20(%rsp), %rdi
movq %rax, %rsi
movslq 0xd8(%rsp), %rax
shlq $0x2, %rax
addq %rax, %rsi
callq 0x327e0
movq 0xd0(%rsp), %rdi
callq 0x5cf30
movq 0xd0(%rsp), %rdi
movl 0xdc(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0xdc(%rsp)
movslq %ecx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, 0x18(%rsp)
callq 0x5cf30
movq 0x18(%rsp), %rdi
movq %rax, %rsi
movl 0xd8(%rsp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, 0xd8(%rsp)
cltq
shlq $0x3, %rax
addq %rax, %rsi
callq 0xbaf90
jmp 0xbbacd
movl 0xdc(%rsp), %eax
cmpl 0xd8(%rsp), %eax
jle 0xbb986
jmp 0xbbc45
jmp 0xbbae8
jmp 0xbbaea
movq 0xd0(%rsp), %rdi
callq 0x5cf30
movslq 0xdc(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
ucomisd 0xe0(%rsp), %xmm0
jbe 0xbbb22
movl 0xdc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xdc(%rsp)
jmp 0xbbaea
jmp 0xbbb24
movq 0xd0(%rsp), %rdi
callq 0x5cf30
movslq 0xd8(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm1
movsd 0xe0(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xbbb60
movl 0xd8(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0xd8(%rsp)
jmp 0xbbb24
movl 0xdc(%rsp), %eax
cmpl 0xd8(%rsp), %eax
jg 0xbbc2d
testb $0x1, 0xee(%rsp)
je 0xbbbc8
movq 0xf0(%rsp), %rdi
callq 0xbb2a0
movslq 0xdc(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x10(%rsp)
movq 0xf0(%rsp), %rdi
callq 0xbb2a0
movq 0x10(%rsp), %rdi
movq %rax, %rsi
movslq 0xd8(%rsp), %rax
shlq $0x2, %rax
addq %rax, %rsi
callq 0x327e0
movq 0xd0(%rsp), %rdi
callq 0x5cf30
movq 0xd0(%rsp), %rdi
movl 0xdc(%rsp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, 0xdc(%rsp)
movslq %ecx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, 0x8(%rsp)
callq 0x5cf30
movq 0x8(%rsp), %rdi
movq %rax, %rsi
movl 0xd8(%rsp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, 0xd8(%rsp)
cltq
shlq $0x3, %rax
addq %rax, %rsi
callq 0xbaf90
jmp 0xbbc2f
movl 0xdc(%rsp), %eax
cmpl 0xd8(%rsp), %eax
jle 0xbbae8
jmp 0xbbc45
movl 0xfc(%rsp), %eax
cmpl 0xd8(%rsp), %eax
jge 0xbbc95
movq 0xd0(%rsp), %rdi
movl 0xfc(%rsp), %esi
movl 0xd8(%rsp), %edx
movq 0xf0(%rsp), %rcx
movb 0xef(%rsp), %r8b
movb 0xee(%rsp), %al
andb $0x1, %r8b
andb $0x1, %al
movzbl %r8b, %r8d
movzbl %al, %r9d
callq 0xbb2b0
movl 0xdc(%rsp), %eax
cmpl 0xf8(%rsp), %eax
jge 0xbbce5
movq 0xd0(%rsp), %rdi
movl 0xdc(%rsp), %esi
movl 0xf8(%rsp), %edx
movq 0xf0(%rsp), %rcx
movb 0xef(%rsp), %r8b
movb 0xee(%rsp), %al
andb $0x1, %r8b
andb $0x1, %al
movzbl %r8b, %r8d
movzbl %al, %r9d
callq 0xbb2b0
jmp 0xbbce7
jmp 0xbbce9
movq 0xd0(%rsp), %rax
addq $0x108, %rsp            # imm = 0x108
retq
nopl (%rax)