// File: /workspace/github_cpp_makefile_star2_O1/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 0x8a94
movl (%r12), %ebx
addq $0x38, %r15
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
callq 0x8a94
leaq 0x40(%rsp), %rdi
leaq 0x8(%rsp), %rsi
xorps %xmm0, %xmm0
movl $0x78, %edx
callq 0xa93c
movl %ebp, 0x28(%rsp)
cmpb $0x0, 0x18(%rsp)
jne 0xa16e
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xa16e
callq 0x4680
movq (%r14), %rax
movq 0x8(%r14), %rcx
movaps 0x691a4(%rip), %xmm0    # 0x73320
movaps %xmm0, 0x80(%rsp)
movq $0x0, 0x90(%rsp)
movq %rcx, 0x60(%rsp)
cmpq %rcx, %rax
je 0xa305
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 0xa2a8
leaq (%rax,%rcx), %r10
cmpq %r14, %r10
jge 0xa2a8
leaq (%rdi,%rcx), %rbx
cmpq %r14, %rbx
jge 0xa2a8
cmpq %r12, %r15
jge 0xa2a8
cmpq %r12, %r9
jge 0xa2a8
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 0xa249
incq %r11
cmpq $0x5, %r11
jne 0xa1f6
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 0x66fcc(%rip), %xmm0    # 0x712b0
pushq $0x1
pushq $-0x1
callq 0xaa32
addq $0x10, %rsp
movq 0x68(%rsp), %rax
addq $0x50, %rax
cmpq 0x60(%rsp), %rax
jne 0xa1ab
cmpb $0x0, 0x28(%rsp)
je 0xa354
leaq 0x8(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movsd 0x66cea(%rip), %xmm1    # 0x71008
xorps %xmm0, %xmm0
callq 0x79c0
leaq 0x6a373(%rip), %rsi     # 0x746a0
leaq 0x8(%rsp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x6, %ecx
callq 0x7a46
cmpb $0x0, 0x18(%rsp)
jne 0xa39f
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xa39f
jmp 0xa39a
leaq 0x8(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movsd 0x66ca2(%rip), %xmm1    # 0x71008
xorps %xmm0, %xmm0
callq 0x79c0
leaq 0x6a32e(%rip), %rsi     # 0x746a3
leaq 0x8(%rsp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x6, %ecx
callq 0x7a46
cmpb $0x0, 0x18(%rsp)
jne 0xa39f
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xa39f
callq 0x4680
cmpb $0x0, 0x50(%rsp)
jne 0xa3b5
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0xa3b5
callq 0x4680
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
cmpb $0x0, 0x18(%rsp)
jne 0xa417
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xa417
jmp 0xa40b
jmp 0xa414
movq %rax, %rbx
cmpb $0x0, 0x18(%rsp)
jne 0xa417
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xa417
jmp 0xa40b
jmp 0xa414
movq %rax, %rbx
cmpb $0x0, 0x18(%rsp)
jne 0xa417
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xa417
callq 0x4680
jmp 0xa417
jmp 0xa414
movq %rax, %rbx
cmpb $0x0, 0x50(%rsp)
jne 0xa42d
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0xa42d
callq 0x4680
movq %rbx, %rdi
callq 0x4950
nop