// File: manikandan5[P]Image-Matching-Stitching-Warping/./SiftHelpers.h
// Function: Image::reduceSift(Image&, std::vector<std::vector<float, std::allocator<float>>, std::allocator<std::vector<float, std::allocator<float>>>>&)
static void reduceSift(Image& image,vector<vector<float>>& distributionLists)
	{
		const vector<SiftDescriptor> imageDescriptors = image.getDescriptors();
		//W is set
		float w = 400;
		
		vector<SiftDescriptor> newDescriptors;
		
		for(int i = 0;i<imageDescriptors.size() ;++i)
		{
			vector<float> descriptorValues;
			for(int j = 0;j<distributionLists.size();++j)
			{
				float sum = 0.0;
				for(int k = 0;k<128;++k)
				{
					sum += imageDescriptors[i].descriptor[k] * distributionLists[j][k];
				}
				sum/=w;
				
				descriptorValues.push_back(sum);
			}
			SiftDescriptor newDescriptor(imageDescriptors[i].row,imageDescriptors[i].col,imageDescriptors[i].sigma,imageDescriptors[i].angle,descriptorValues);	
			newDescriptors.push_back(newDescriptor);
		}
		image.setNewDescriptors(newDescriptors);	
	}

// Assembly:
subq $0x118, %rsp            # imm = 0x118
movq %rdi, 0x110(%rsp)
movq %rsi, 0x108(%rsp)
movq 0x110(%rsp), %rsi
leaq 0xf0(%rsp), %rdi
callq 0xcbc0
movss 0x32600(%rip), %xmm0    # 0xc8174
movss %xmm0, 0xec(%rsp)
leaq 0xd0(%rsp), %rdi
callq 0x609f0
movl $0x0, 0xcc(%rsp)
movslq 0xcc(%rsp), %rax
movq %rax, 0x30(%rsp)
leaq 0xf0(%rsp), %rdi
callq 0xccc0
movq %rax, %rcx
movq 0x30(%rsp), %rax
cmpq %rcx, %rax
jae 0x95e77
leaq 0xb0(%rsp), %rdi
callq 0x96010
movl $0x0, 0xac(%rsp)
movslq 0xac(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x108(%rsp), %rdi
callq 0x974d0
movq %rax, %rcx
movq 0x28(%rsp), %rax
cmpq %rcx, %rax
jae 0x95d24
xorps %xmm0, %xmm0
movss %xmm0, 0xa8(%rsp)
movl $0x0, 0xa4(%rsp)
cmpl $0x80, 0xa4(%rsp)
jge 0x95cbd
movslq 0xcc(%rsp), %rsi
leaq 0xf0(%rsp), %rdi
callq 0x978e0
movq %rax, %rdi
addq $0x10, %rdi
movslq 0xa4(%rsp), %rsi
callq 0x97900
movss (%rax), %xmm0
movss %xmm0, 0x24(%rsp)
movq 0x108(%rsp), %rdi
movslq 0xac(%rsp), %rsi
callq 0x97920
movq %rax, %rdi
movslq 0xa4(%rsp), %rsi
callq 0xcd40
movss 0x24(%rsp), %xmm0
movss (%rax), %xmm2
movss 0xa8(%rsp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0xa8(%rsp)
movl 0xa4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xa4(%rsp)
jmp 0x95c1a
movss 0xec(%rsp), %xmm1
movss 0xa8(%rsp), %xmm0
divss %xmm1, %xmm0
movss %xmm0, 0xa8(%rsp)
leaq 0xb0(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x97940
jmp 0x95cf3
jmp 0x95cf5
movl 0xac(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xac(%rsp)
jmp 0x95bd8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x98(%rsp)
movl %eax, 0x94(%rsp)
jmp 0x95e65
movslq 0xcc(%rsp), %rsi
leaq 0xf0(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x978e0
movq 0x10(%rsp), %rdi
movss (%rax), %xmm0
movss %xmm0, 0x8(%rsp)
movslq 0xcc(%rsp), %rsi
callq 0x978e0
movq 0x10(%rsp), %rdi
movss 0x4(%rax), %xmm0
movss %xmm0, 0xc(%rsp)
movslq 0xcc(%rsp), %rsi
callq 0x978e0
movq 0x10(%rsp), %rdi
movss 0x8(%rax), %xmm0
movss %xmm0, 0x1c(%rsp)
movslq 0xcc(%rsp), %rsi
callq 0x978e0
movss 0xc(%rax), %xmm0
movss %xmm0, 0x20(%rsp)
leaq 0x50(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0xdf40
jmp 0x95db3
movss 0x20(%rsp), %xmm3
movss 0x1c(%rsp), %xmm2
movss 0xc(%rsp), %xmm1
movss 0x8(%rsp), %xmm0
leaq 0x68(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x979b0
jmp 0x95ddc
leaq 0x50(%rsp), %rdi
callq 0xf1f0
leaq 0xd0(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x97a20
jmp 0x95dfa
leaq 0x68(%rsp), %rdi
callq 0xce40
leaq 0xb0(%rsp), %rdi
callq 0xf1f0
movl 0xcc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xcc(%rsp)
jmp 0x95b95
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x98(%rsp)
movl %eax, 0x94(%rsp)
leaq 0x50(%rsp), %rdi
callq 0xf1f0
jmp 0x95e65
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x98(%rsp)
movl %eax, 0x94(%rsp)
leaq 0x68(%rsp), %rdi
callq 0xce40
leaq 0xb0(%rsp), %rdi
callq 0xf1f0
jmp 0x95f07
movq 0x110(%rsp), %rax
movq %rax, (%rsp)
leaq 0x38(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0xd4e0
jmp 0x95e97
movq (%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x97a90
jmp 0x95ea7
leaq 0x38(%rsp), %rdi
callq 0xcc60
leaq 0xd0(%rsp), %rdi
callq 0xcc60
leaq 0xf0(%rsp), %rdi
callq 0xcc60
addq $0x118, %rsp            # imm = 0x118
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x98(%rsp)
movl %eax, 0x94(%rsp)
jmp 0x95f07
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x98(%rsp)
movl %eax, 0x94(%rsp)
leaq 0x38(%rsp), %rdi
callq 0xcc60
leaq 0xd0(%rsp), %rdi
callq 0xcc60
leaq 0xf0(%rsp), %rdi
callq 0xcc60
movq 0x98(%rsp), %rdi
callq 0x5970
nop