// File: manikandan5[P]Image-Matching-Stitching-Warping/./Sift.h
// Function: Sift::compute_sift(cimg_library::CImg<float> const&)
static vector<SiftDescriptor> compute_sift(const CImg<float> &luma)
    {
      bool lowe_compatible = true;
      bool norm = true;
      
      vector<SiftDescriptor> descriptors;

      typedef vector<pair<VL::Sift::Keypoint,VL::float_t> > Keypoints ;

      //      if(lowe_compatible)
      //	luma /= 255.0;
      
      VL::PgmBuffer buffer;
      buffer.height = luma.height();
      buffer.width = luma.width();
      buffer.data = (VL::pixel_t *)luma.data();
      
      // ---------------------------------------------------------------
      //                                            Gaussian scale space
      // ---------------------------------------------------------------    
      int         O      = octaves ;    
      int const   S      = levels ;
      int const   omin   = first ;
      float const sigman = .5 ;
      float const sigma0 = 1.6 * powf(2.0f, 1.0f / S) ;
      

      if(O < 1 || lowe_compatible) {
	O = std::max
	  (int
	   (std::floor
	    (log2
	     (std::min(luma.height(), luma.width()))) - omin -3), 1) ;
      }

      // initialize scalespace
      VL::Sift sift(buffer.data, buffer.width, buffer.height, 
		    sigman, sigma0,
		    O, S,
		    omin, -1, S+1) ;
	
      sift.detectKeypoints(threshold, edgeThreshold) ;


      /* set descriptor options */
      sift.setNormalizeDescriptor( norm || lowe_compatible); //! unnormalized ) ;
      sift.setMagnification( magnif ) ;

      // -------------------------------------------------------------
      //            Run detector, compute orientations and descriptors
      // -------------------------------------------------------------
      
      for( VL::Sift::KeypointsConstIter iter = sift.keypointsBegin() ;
	   iter != sift.keypointsEnd() ; ++iter ) {
	    
	// detect orientations
	VL::float_t angles [4] ;
	int nangles ;
	nangles = sift.computeKeypointOrientations(angles, *iter) ;
	    
	// compute descriptors
	for(int a = 0 ; a < nangles ; ++a) {

	  /* compute descriptor */
	  VL::float_t descr_pt [128] ;
	  sift.computeKeypointDescriptor(descr_pt, *iter, angles[a]) ;

	  if(lowe_compatible)
	    for(int j=0; j<128; j++)
	      descr_pt[j] = (unsigned char)(descr_pt[j] * 512);

	  descriptors.push_back(SiftDescriptor(iter->y, iter->x, iter->sigma, angles[a], descr_pt));

	} // next angle
      } // next keypoint

      return descriptors;
    }

// Assembly:
subq $0x428, %rsp            # imm = 0x428
movq %rdi, 0x88(%rsp)
movq %rdi, %rax
movq %rax, 0x90(%rsp)
movq %rdi, 0x420(%rsp)
movq %rsi, 0x418(%rsp)
movb $0x1, 0x417(%rsp)
movb $0x1, 0x416(%rsp)
movb $0x0, 0x415(%rsp)
callq 0x609f0
movq 0x418(%rsp), %rdi
callq 0x93c00
movl %eax, 0x9c(%rsp)
jmp 0x60b7d
movl 0x9c(%rsp), %eax
movl %eax, 0x404(%rsp)
movq 0x418(%rsp), %rdi
callq 0x93c10
movl %eax, 0x84(%rsp)
jmp 0x60ba1
movl 0x84(%rsp), %eax
movl %eax, 0x400(%rsp)
movq 0x418(%rsp), %rdi
callq 0x93c20
movq %rax, 0x78(%rsp)
jmp 0x60bc3
movq 0x78(%rsp), %rax
movq %rax, 0x408(%rsp)
movl $0x7, 0x3f0(%rsp)
movl $0x3, 0x3ec(%rsp)
movl $0xffffffff, 0x3e8(%rsp) # imm = 0xFFFFFFFF
movss 0x67537(%rip), %xmm0    # 0xc8130
movss %xmm0, 0x3e4(%rsp)
movss 0x67532(%rip), %xmm0    # 0xc813c
movss 0x67552(%rip), %xmm1    # 0xc8164
callq 0x5850
cvtss2sd %xmm0, %xmm1
movsd 0x67415(%rip), %xmm0    # 0xc8038
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x3e0(%rsp)
cmpl $0x1, 0x3f0(%rsp)
jl 0x60c4c
testb $0x1, 0x417(%rsp)
je 0x60d36
movq 0x418(%rsp), %rdi
callq 0x93c00
movl %eax, 0x74(%rsp)
jmp 0x60c5f
movl 0x74(%rsp), %eax
movl %eax, 0x3d8(%rsp)
movq 0x418(%rsp), %rdi
callq 0x93c10
movl %eax, 0x70(%rsp)
jmp 0x60c7d
movl 0x70(%rsp), %eax
movl %eax, 0x3d4(%rsp)
leaq 0x3d8(%rsp), %rdi
leaq 0x3d4(%rsp), %rsi
callq 0x93c90
movq %rax, 0x68(%rsp)
jmp 0x60ca4
movq 0x68(%rsp), %rax
movl (%rax), %edi
callq 0x93c70
movsd %xmm0, 0x60(%rsp)
jmp 0x60cb8
movsd 0x60(%rsp), %xmm0
callq 0x5900
movsd 0x6734d(%rip), %xmm1    # 0xc8018
addsd %xmm1, %xmm0
movsd 0x67369(%rip), %xmm1    # 0xc8040
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, 0x3dc(%rsp)
movl $0x1, 0x3d0(%rsp)
leaq 0x3dc(%rsp), %rdi
leaq 0x3d0(%rsp), %rsi
callq 0x93c30
movq %rax, 0x58(%rsp)
jmp 0x60d0d
movq 0x58(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x3f0(%rsp)
jmp 0x60d36
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3f8(%rsp)
movl %eax, 0x3f4(%rsp)
jmp 0x61115
movq 0x408(%rsp), %rsi
movl 0x400(%rsp), %edx
movl 0x404(%rsp), %ecx
movss 0x3e0(%rsp), %xmm1
movl 0x3f0(%rsp), %r8d
movq %rsp, %rax
movl $0x4, 0x10(%rax)
movl $0xffffffff, 0x8(%rax)  # imm = 0xFFFFFFFF
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
leaq 0x358(%rsp), %rdi
movss 0x673ac(%rip), %xmm0    # 0xc8130
movl $0x3, %r9d
callq 0xc1340
jmp 0x60d91
leaq 0x358(%rsp), %rdi
movss 0x673c7(%rip), %xmm0    # 0xc8168
movss 0x673c3(%rip), %xmm1    # 0xc816c
callq 0xc2110
jmp 0x60db0
movb $0x1, %al
testb $0x1, 0x416(%rsp)
movb %al, 0x57(%rsp)
jne 0x60dcb
movb 0x417(%rsp), %al
movb %al, 0x57(%rsp)
movb 0x57(%rsp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq 0x358(%rsp), %rdi
callq 0x93cd0
jmp 0x60de4
leaq 0x358(%rsp), %rdi
movss 0x67354(%rip), %xmm0    # 0xc8148
callq 0x93cf0
jmp 0x60dfb
leaq 0x358(%rsp), %rdi
callq 0x93d10
movq %rax, 0x48(%rsp)
jmp 0x60e0f
movq 0x48(%rsp), %rax
movq %rax, 0x348(%rsp)
leaq 0x350(%rsp), %rdi
leaq 0x348(%rsp), %rsi
callq 0x93d40
leaq 0x358(%rsp), %rdi
callq 0x93dc0
movq %rax, 0x40(%rsp)
jmp 0x60e45
movq 0x40(%rsp), %rax
movq %rax, 0x340(%rsp)
leaq 0x350(%rsp), %rdi
leaq 0x340(%rsp), %rsi
callq 0x93d80
testb $0x1, %al
jne 0x60e70
jmp 0x610c8
leaq 0x350(%rsp), %rdi
callq 0x93df0
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movaps %xmm1, 0x310(%rsp)
movaps %xmm0, 0x300(%rsp)
movaps 0x300(%rsp), %xmm0
movaps 0x310(%rsp), %xmm1
movq %rsp, %rax
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
leaq 0x358(%rsp), %rdi
leaq 0x330(%rsp), %rsi
callq 0xc43d0
movl %eax, 0x3c(%rsp)
jmp 0x60ec9
movl 0x3c(%rsp), %eax
movl %eax, 0x32c(%rsp)
movl $0x0, 0x2fc(%rsp)
movl 0x2fc(%rsp), %eax
cmpl 0x32c(%rsp), %eax
jge 0x610b4
leaq 0x350(%rsp), %rdi
callq 0x93df0
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movaps %xmm1, 0xe0(%rsp)
movaps %xmm0, 0xd0(%rsp)
movslq 0x2fc(%rsp), %rax
movss 0x330(%rsp,%rax,4), %xmm0
movaps 0xd0(%rsp), %xmm1
movaps 0xe0(%rsp), %xmm2
movq %rsp, %rax
movups %xmm2, 0x10(%rax)
movups %xmm1, (%rax)
leaq 0x358(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
callq 0xc4d60
jmp 0x60f59
testb $0x1, 0x417(%rsp)
je 0x60fe2
movl $0x0, 0xcc(%rsp)
cmpl $0x80, 0xcc(%rsp)
jge 0x60fe0
movslq 0xcc(%rsp), %rax
movss 0xf0(%rsp,%rax,4), %xmm0
movss 0x671dc(%rip), %xmm1    # 0xc8170
mulss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movzbl %al, %eax
cvtsi2ss %eax, %xmm0
movslq 0xcc(%rsp), %rax
movss %xmm0, 0xf0(%rsp,%rax,4)
movl 0xcc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xcc(%rsp)
jmp 0x60f6e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3f8(%rsp)
movl %eax, 0x3f4(%rsp)
jmp 0x610e9
jmp 0x60fe2
leaq 0x350(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x93e30
movq 0x28(%rsp), %rdi
movss 0x14(%rax), %xmm0
movss %xmm0, 0x34(%rsp)
callq 0x93e30
movq 0x28(%rsp), %rdi
movss 0x10(%rax), %xmm0
movss %xmm0, 0x38(%rsp)
callq 0x93e30
movss 0x34(%rsp), %xmm0
movss 0x38(%rsp), %xmm1
movss 0x1c(%rax), %xmm2
movslq 0x2fc(%rsp), %rax
movss 0x330(%rsp,%rax,4), %xmm3
leaq 0xa0(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
callq 0x93e40
jmp 0x61057
movq 0x88(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x93e00
jmp 0x6106e
leaq 0xa0(%rsp), %rdi
callq 0xce40
movl 0x2fc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2fc(%rsp)
jmp 0x60edf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3f8(%rsp)
movl %eax, 0x3f4(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0xce40
jmp 0x610e9
jmp 0x610b6
leaq 0x350(%rsp), %rdi
callq 0x93f10
jmp 0x60e31
movb $0x1, 0x415(%rsp)
leaq 0x358(%rsp), %rdi
callq 0xc1bc0
testb $0x1, 0x415(%rsp)
jne 0x61105
jmp 0x610f8
leaq 0x358(%rsp), %rdi
callq 0xc1bc0
jmp 0x61115
movq 0x88(%rsp), %rdi
callq 0xcc60
movq 0x90(%rsp), %rax
addq $0x428, %rsp            # imm = 0x428
retq
movq 0x88(%rsp), %rdi
callq 0xcc60
movq 0x3f8(%rsp), %rdi
callq 0x5970
nop