// File: /workspace/github_cpp_makefile_star2_O2/manikandan5[P]Image-Matching-Stitching-Warping/./SiftHelpers.h
// Function: Image::DrawImage(Image const&, Image const&, std::vector<std::pair<SiftDescriptor, SiftDescriptor>, std::allocator<std::pair<SiftDescriptor, SiftDescriptor>>>&, bool)
static void DrawImage(const Image& queryImage,const Image& image,SiftDescriptorMap& mapping,bool reduced = false)
	{
		CImg<double> queryImageData = queryImage.getImageData();
		int queryHeight = queryImageData.height();
		int queryWidth = queryImageData.width();
		queryImageData.append(image.getImageData());
		
		SiftDescriptorMap::iterator mStart = mapping.begin();
		SiftDescriptorMap::iterator mEnd = mapping.end();
		
		
		const double yellow[] = {255.0,255.0,0.0};
		while(mStart != mEnd)
		{
			const int y0 = mStart->first.row;
			const int x0 = mStart->first.col;
			const int y1 = mStart->second.row;
			const int x1 = queryWidth + mStart->second.col;
			
			for(int j=0; j<5; j++)
				for(int k=0; k<5; k++)
					if(j==2 || k==2)
						if(x0+k < queryImageData.width() && x1+k < queryImageData.width() && y0+j < queryImageData.height() && y1+j < queryImageData.height())
						{	
							queryImageData(x0+k, y0+j, 0, 0)=queryImageData(x1+k, y1+j, 0, 1)=255;
							queryImageData(x0+k, y0+j, 0, 1)= queryImageData(x0+k, y0+j, 0, 2) =queryImageData(x1+k, y1+j, 0, 0)=queryImageData(x1+k, y1+j, 0, 2)= 0;
						}
						
			queryImageData.draw_line(x0,y0,x1,y1,yellow);
			++mStart;
	
		}
		if(!reduced)
			queryImageData.get_normalize(0,255).save("sift.png");
		else
			queryImageData.get_normalize(0,255).save("newsift.png");
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %r15
leaq 0x38(%rdi), %rsi
leaq 0x40(%rsp), %r12
movq %r12, %rdi
callq 0x7064
movl (%r12), %ebx
addq $0x38, %r15
leaq 0x20(%rsp), %rdi
movq %r15, %rsi
callq 0x7064
movl %ebp, 0x8(%rsp)
leaq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rsi
pushq $0x78
popq %rdx
xorps %xmm0, %xmm0
callq 0x8740
leaq 0x20(%rsp), %rdi
callq 0x6c96
movq (%r14), %r15
movq 0x8(%r14), %rax
movq %rax, 0x60(%rsp)
leaq 0x80(%rsp), %rax
andq $0x0, 0x10(%rax)
movaps 0x4c784(%rip), %xmm0    # 0x547d0
cvtsi2ss %ebx, %xmm1
movss %xmm1, 0xc(%rsp)
movaps %xmm0, (%rax)
movabsq $0x406fe00000000000, %rbp # imm = 0x406FE00000000000
cmpq 0x60(%rsp), %r15
je 0x81be
cvttss2si (%r15), %ecx
cvttss2si 0x4(%r15), %esi
cvttss2si 0x28(%r15), %edx
movss 0x2c(%r15), %xmm0
addss 0xc(%rsp), %xmm0
cvttss2si %xmm0, %eax
movl %eax, 0x10(%rsp)
cltq
movl %esi, 0x14(%rsp)
movslq %esi, %rdi
movl %edx, 0x18(%rsp)
movslq %edx, %rdx
movq %rdx, 0x70(%rsp)
movl %ecx, 0x1c(%rsp)
movslq %ecx, %rcx
movq %rcx, 0x68(%rsp)
xorl %r11d, %r11d
movq %r15, 0x78(%rsp)
cmpq $0x5, %r11
je 0x8184
movslq 0x40(%rsp), %rbx
movq 0x68(%rsp), %rcx
leaq (%r11,%rcx), %r15
movl 0x44(%rsp), %ecx
movl 0x48(%rsp), %r14d
movslq %ecx, %r13
movq 0x70(%rsp), %rdx
leaq (%r11,%rdx), %r12
movq 0x58(%rsp), %rdx
movl %r12d, %esi
movl %ebx, %r8d
imulq %r8, %rsi
imulq %rcx, %r14
imulq %r8, %r14
leaq (%rdx,%rsi,8), %r9
movl %r15d, %ecx
imulq %r8, %rcx
leaq (%rdx,%rcx,8), %rdx
leaq (%r14,%r14), %r8
xorl %esi, %esi
cmpq $0x5, %rsi
je 0x8177
cmpq $0x2, %r11
setne %cl
cmpq $0x2, %rsi
setne %r10b
testb %r10b, %cl
jne 0x8172
leaq (%rdi,%rsi), %rcx
cmpq %rbx, %rcx
jge 0x8172
leaq (%rax,%rsi), %r10
cmpq %rbx, %r10
jge 0x8172
cmpq %r13, %r15
jge 0x8172
cmpq %r13, %r12
jge 0x8172
movl %r10d, %r10d
leaq (%r9,%r10,8), %r10
movq %rbp, (%r10,%r14,8)
movl %ecx, %ecx
leaq (%rdx,%rcx,8), %rcx
movq %rbp, (%rcx)
andq $0x0, (%r10,%r8,8)
andq $0x0, (%r10)
andq $0x0, (%rcx,%r8,8)
andq $0x0, (%rcx,%r14,8)
incq %rsi
jmp 0x8115
incq %r11
movq 0x78(%rsp), %r15
jmp 0x80bc
leaq 0x40(%rsp), %rdi
movl 0x14(%rsp), %esi
movl 0x1c(%rsp), %edx
movl 0x10(%rsp), %ecx
movl 0x18(%rsp), %r8d
leaq 0x80(%rsp), %r9
movss 0x4c076(%rip), %xmm0    # 0x54220
pushq $0x1
pushq $-0x1
callq 0x8802
popq %rcx
popq %rdx
addq $0x50, %r15
jmp 0x8063
cmpb $0x0, 0x8(%rsp)
je 0x81f8
leaq 0x20(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movsd 0x4be31(%rip), %xmm1    # 0x54008
xorps %xmm0, %xmm0
callq 0x644e
leaq 0x4d96a(%rip), %rsi     # 0x55b50
leaq 0x20(%rsp), %rdi
pushq $-0x1
popq %rdx
pushq $0x6
popq %rcx
callq 0x64bc
jmp 0x8229
leaq 0x20(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movsd 0x4bdfe(%rip), %xmm1    # 0x54008
xorps %xmm0, %xmm0
callq 0x644e
leaq 0x4d93a(%rip), %rsi     # 0x55b53
leaq 0x20(%rsp), %rdi
pushq $-0x1
popq %rdx
pushq $0x6
popq %rcx
callq 0x64bc
leaq 0x20(%rsp), %rdi
callq 0x6c96
leaq 0x40(%rsp), %rdi
callq 0x6c96
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x8257
jmp 0x8268
jmp 0x8257
jmp 0x8268
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x6c96
jmp 0x826b
jmp 0x8268
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x6c96
movq %rbx, %rdi
callq 0x4950
nop