// File: /workspace/github_cpp_makefile_star2_O3/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 0x8a36
movl (%r12), %ebx
addq $0x38, %r15
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
callq 0x8a36
leaq 0x40(%rsp), %rdi
leaq 0x8(%rsp), %rsi
xorps %xmm0, %xmm0
movl $0x78, %edx
callq 0xa8e0
movl %ebp, 0x28(%rsp)
cmpb $0x0, 0x18(%rsp)
jne 0xa112
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xa112
callq 0x4690
movq (%r14), %rax
movq 0x8(%r14), %rcx
movaps 0x64730(%rip), %xmm0    # 0x6e850
movaps %xmm0, 0x80(%rsp)
movq $0x0, 0x90(%rsp)
movq %rcx, 0x60(%rsp)
cmpq %rcx, %rax
je 0xa2a9
xorps %xmm0, %xmm0
cvtsi2ss %ebx, %xmm0
movss %xmm0, 0x2c(%rsp)
cvttss2si (%rax), %ecx
cvttss2si 0x4(%rax), %esi
cvttss2si 0x28(%rax), %edx
movq %rax, 0x68(%rsp)
movss 0x2c(%rax), %xmm0
addss 0x2c(%rsp), %xmm0
cvttss2si %xmm0, %edi
movl %esi, 0x34(%rsp)
movslq %esi, %rax
movl %edi, 0x30(%rsp)
movslq %edi, %rdi
movl %ecx, 0x3c(%rsp)
movslq %ecx, %rcx
movq %rcx, 0x78(%rsp)
movl %edx, 0x38(%rsp)
movslq %edx, %rcx
movq %rcx, 0x70(%rsp)
xorl %r11d, %r11d
movslq 0x40(%rsp), %r14
movq 0x78(%rsp), %rcx
leaq (%r11,%rcx), %r15
movl 0x44(%rsp), %ecx
movl 0x48(%rsp), %r13d
movslq %ecx, %r12
movq 0x70(%rsp), %rdx
leaq (%r11,%rdx), %r9
movq 0x58(%rsp), %rsi
movl %r9d, %edx
movl %r14d, %r8d
imulq %r8, %rdx
imulq %rcx, %r13
imulq %r8, %r13
leaq (%rsi,%rdx,8), %rdx
movl %r15d, %ecx
imulq %r8, %rcx
leaq (%rsi,%rcx,8), %r8
leaq (,%r13,2), %rsi
xorl %ecx, %ecx
cmpq $0x2, %r11
setne %r10b
cmpq $0x2, %rcx
setne %bl
testb %bl, %r10b
jne 0xa24c
leaq (%rax,%rcx), %r10
cmpq %r14, %r10
jge 0xa24c
leaq (%rdi,%rcx), %rbx
cmpq %r14, %rbx
jge 0xa24c
cmpq %r12, %r15
jge 0xa24c
cmpq %r12, %r9
jge 0xa24c
movl %ebx, %ebx
leaq (%rdx,%rbx,8), %rbx
movabsq $0x406fe00000000000, %rbp # imm = 0x406FE00000000000
movq %rbp, (%rbx,%r13,8)
movl %r10d, %r10d
leaq (%r8,%r10,8), %r10
movq %rbp, (%r10)
xorl %ebp, %ebp
movq %rbp, (%rbx,%rsi,8)
movq %rbp, (%rbx)
movq %rbp, (%r10,%rsi,8)
movq %rbp, (%r10,%r13,8)
incq %rcx
cmpq $0x5, %rcx
jne 0xa1ed
incq %r11
cmpq $0x5, %r11
jne 0xa19a
leaq 0x40(%rsp), %rdi
movl 0x34(%rsp), %esi
movl 0x3c(%rsp), %edx
movl 0x30(%rsp), %ecx
movl 0x38(%rsp), %r8d
leaq 0x80(%rsp), %r9
movss 0x64028(%rip), %xmm0    # 0x6e2b0
pushq $0x1
pushq $-0x1
callq 0xa9d6
addq $0x10, %rsp
movq 0x68(%rsp), %rax
addq $0x50, %rax
cmpq 0x60(%rsp), %rax
jne 0xa14f
cmpb $0x0, 0x28(%rsp)
je 0xa2f8
leaq 0x8(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movsd 0x63d46(%rip), %xmm1    # 0x6e008
xorps %xmm0, %xmm0
callq 0x79b4
leaq 0x658ff(%rip), %rsi     # 0x6fbd0
leaq 0x8(%rsp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x6, %ecx
callq 0x7a3a
cmpb $0x0, 0x18(%rsp)
jne 0xa343
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xa343
jmp 0xa33e
leaq 0x8(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movsd 0x63cfe(%rip), %xmm1    # 0x6e008
xorps %xmm0, %xmm0
callq 0x79b4
leaq 0x658ba(%rip), %rsi     # 0x6fbd3
leaq 0x8(%rsp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x6, %ecx
callq 0x7a3a
cmpb $0x0, 0x18(%rsp)
jne 0xa343
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xa343
callq 0x4690
cmpb $0x0, 0x50(%rsp)
jne 0xa359
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0xa359
callq 0x4690
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
cmpb $0x0, 0x18(%rsp)
jne 0xa3bb
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xa3bb
jmp 0xa3af
jmp 0xa3b8
movq %rax, %rbx
cmpb $0x0, 0x18(%rsp)
jne 0xa3bb
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xa3bb
jmp 0xa3af
jmp 0xa3b8
movq %rax, %rbx
cmpb $0x0, 0x18(%rsp)
jne 0xa3bb
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xa3bb
callq 0x4690
jmp 0xa3bb
jmp 0xa3b8
movq %rax, %rbx
cmpb $0x0, 0x50(%rsp)
jne 0xa3d1
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0xa3d1
callq 0x4690
movq %rbx, %rdi
callq 0x4960
nop