// File: /workspace/github_cpp_makefile_star2_O3/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rsi, %r14
movq %rdi, 0x48(%rsp)
leaq 0x20(%rdi), %rsi
leaq 0x18(%rsp), %rbx
movq %rbx, %rdi
callq 0xa3da
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
movq (%rbx), %rdx
cmpq %rdx, 0x8(%rbx)
je 0x5a093
xorl %r15d, %r15d
leaq 0x98(%rsp), %r12
leaq 0x50(%rsp), %rbx
movabsq $-0x5555555555555555, %rbp # imm = 0xAAAAAAAAAAAAAAAB
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
movq (%r14), %rax
movq 0x8(%r14), %rcx
cmpq %rax, %rcx
je 0x59ff7
leaq (%r15,%r15,4), %r12
xorl %r13d, %r13d
movl $0x0, 0x50(%rsp)
movq 0x18(%rsp), %rdx
movq 0x10(%rdx,%r12,8), %rdx
leaq (,%r13,2), %rsi
addq %r13, %rsi
movq (%rax,%rsi,8), %rsi
xorps %xmm0, %xmm0
xorl %edi, %edi
movss (%rdx,%rdi,4), %xmm1
mulss (%rsi,%rdi,4), %xmm1
addss %xmm1, %xmm0
movss %xmm0, 0x50(%rsp)
incq %rdi
cmpq $0x80, %rdi
jne 0x59f75
divss 0x1436f(%rip), %xmm0    # 0x6e30c
movss %xmm0, 0x50(%rsp)
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x59fbe
movss %xmm0, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x59fd0
movq %rsp, %rdi
movq %rbx, %rdx
callq 0x5a726
movq (%r14), %rax
movq 0x8(%r14), %rcx
incq %r13
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x3, %rdx
imulq %rbp, %rdx
cmpq %r13, %rdx
ja 0x59f4f
movq 0x18(%rsp), %rdx
leaq 0x98(%rsp), %r12
leaq (%r15,%r15,4), %rax
movups (%rdx,%rax,8), %xmm0
movaps %xmm0, 0xb0(%rsp)
movq %r12, %rdi
movq %rsp, %rsi
callq 0xa53c
movaps 0xb0(%rsp), %xmm0
movaps %xmm0, 0x50(%rsp)
leaq 0x60(%rsp), %rdi
movq %r12, %rsi
callq 0xa53c
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0x5a03e
callq 0x44f0
leaq 0x30(%rsp), %rdi
movq %rbx, %rsi
callq 0x5a6ec
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x5a05a
callq 0x44f0
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x5a068
callq 0x44f0
incq %r15
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rax
subq %rdx, %rax
sarq $0x3, %rax
movabsq $-0x3333333333333333, %rcx # imm = 0xCCCCCCCCCCCCCCCD
imulq %rcx, %rax
cmpq %r15, %rax
ja 0x59f28
leaq 0x80(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0xa3da
movq 0x48(%rsp), %rdi
addq $0x58, %rdi
leaq 0x80(%rsp), %rsi
callq 0x5a976
leaq 0x80(%rsp), %rdi
callq 0xa038
leaq 0x30(%rsp), %rdi
callq 0xa038
leaq 0x18(%rsp), %rdi
callq 0xa038
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0xa038
jmp 0x5a139
movq %rax, %rbx
jmp 0x5a139
movq %rax, %rbx
movq 0x60(%rsp), %rdi
jmp 0x5a11a
movq %rax, %rbx
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0x5a12b
callq 0x44f0
jmp 0x5a12b
jmp 0x5a128
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x5a139
callq 0x44f0
leaq 0x30(%rsp), %rdi
callq 0xa038
leaq 0x18(%rsp), %rdi
callq 0xa038
movq %rbx, %rdi
callq 0x4960
nop