// File: /workspace/github_cpp_makefile_star2_O1/manikandan5[P]Image-Matching-Stitching-Warping/./SiftHelpers.h
// Function: Image::randomRanking(bool)
static void randomRanking(bool reduced = false)
	{
		char buf1[1024];
		
		getcwd(buf1, sizeof(buf1));
		
		string directory = string(buf1) + "/part1_images/";
		DIR *dir;
		struct dirent *ent;
		vector<string> imageNames;
		int count = 0;
		if((dir = opendir(directory.c_str())) != nullptr)
		{
			while ((ent = readdir (dir)) != NULL) 
			{
				string fileName = ent->d_name;
				if(	fileName.find(".jpg") != string::npos)
				{
					string name = "part1_images/" + string(ent->d_name);
					imageNames.push_back(name);
				}
			}
			
			closedir(dir);
		}
		else
		{
			cout<<" Error in current directory"<<endl;
			return;
		}
		
		//Sort images based on names
		sort(imageNames.begin(),imageNames.end());
		vector<Image> images;
		for(int i = 0;i < imageNames.size();++i)
		{
			Image I(imageNames[i]);
			images.push_back(I);	
		}
		
		for(int i = 0;i<10;++i)
		{
			srand(time(NULL));
			//Pick random images one from each bin of size 10.
			int randomNumber = (10*i) + rand() % 10;
			
			Image queryImage = images[randomNumber];
			cout<<endl;
			cout<<"Query Image = "<<queryImage.getName()<<endl;
			if(!reduced)
				descriptorMatching1(queryImage,images);
			else
				descriptorMatching2(queryImage,images);
		}
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x528, %rsp            # imm = 0x528
movl %edi, 0x4c(%rsp)
leaq 0x120(%rsp), %rbx
movl $0x400, %esi            # imm = 0x400
movq %rbx, %rdi
callq 0x4230
leaq 0xa0(%rsp), %rax
movq %rax, -0x10(%rax)
movq %rbx, %rdi
callq 0x41e0
leaq (%rsp,%rax), %rdx
addq $0x120, %rdx            # imm = 0x120
leaq 0x90(%rsp), %rdi
movq %rbx, %rsi
callq 0x5d854
leaq 0x8ab52(%rip), %rsi     # 0x93c20
leaq 0x90(%rsp), %rdi
callq 0x4a40
leaq 0x38(%rsp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x9102
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x9108
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x30(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x913a
callq 0x44e0
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
movq $0x0, 0x60(%rsp)
movq 0x28(%rsp), %rdi
callq 0x47f0
testq %rax, %rax
je 0x95d7
movq %rax, %rbx
leaq 0x80(%rsp), %r15
leaq 0x90(%rsp), %r14
leaq 0x70(%rsp), %r12
movq %rbx, %rdi
callq 0x4800
movq %rax, %r13
testq %rax, %rax
je 0x92a6
leaq 0x13(%r13), %rbp
leaq 0xa0(%rsp), %rax
movq %rax, 0x90(%rsp)
movq %rbp, %rdi
callq 0x41e0
leaq (%rax,%r13), %rdx
addq $0x13, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x5d854
movl $0x4, %ecx
movq %r14, %rdi
leaq 0x6b4a3(%rip), %rsi     # 0x7466b
xorl %edx, %edx
callq 0x4940
cmpq $-0x1, %rax
je 0x9283
movq %r15, 0x70(%rsp)
movq %rbp, %rdi
callq 0x41e0
leaq (%rax,%rbp), %rdx
movq %r12, %rdi
movq %rbp, %rsi
callq 0x5d854
movl $0xd, %r8d
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
leaq 0x8aa18(%rip), %rcx     # 0x93c21
callq 0x4590
leaq 0x18(%rsp), %r13
movq %r13, 0x8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x9236
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x923e
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x70(%rsp), %rdi
cmpq %r15, %rdi
je 0x9265
callq 0x44e0
leaq 0x50(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x391e8
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x9283
callq 0x44e0
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x9176
callq 0x44e0
jmp 0x9176
movq %rbx, %rdi
callq 0x4890
movq 0x50(%rsp), %rbx
movq 0x58(%rsp), %r14
cmpq %r14, %rbx
je 0x92ea
movq %r14, %rax
subq %rbx, %rax
sarq $0x5, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x394a7
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3958b
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%rsp)
movq $0x0, 0x80(%rsp)
movq 0x50(%rsp), %rax
cmpq %rax, 0x58(%rsp)
je 0x93e8
leaq 0x110(%rsp), %rbp
movl $0x8, %ebx
xorl %r14d, %r14d
leaq 0x100(%rsp), %r15
leaq 0x90(%rsp), %r12
leaq 0x70(%rsp), %r13
movq %rbp, 0x100(%rsp)
movq -0x8(%rax,%rbx), %rsi
movq (%rax,%rbx), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x39158
movq %r12, %rdi
movq %r15, %rsi
callq 0x97a8
movq 0x100(%rsp), %rdi
cmpq %rbp, %rdi
je 0x936c
callq 0x44e0
movq %r13, %rdi
movq %r12, %rsi
callq 0x99f8
leaq 0xe8(%rsp), %rdi
callq 0xa09a
cmpb $0x0, 0xd8(%rsp)
jne 0x93a0
movq 0xe0(%rsp), %rdi
testq %rdi, %rdi
je 0x93a0
callq 0x4680
leaq 0xb0(%rsp), %rdi
callq 0xa09a
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x93c7
callq 0x44e0
incq %r14
movq 0x50(%rsp), %rax
movq 0x58(%rsp), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
addq $0x20, %rbx
cmpq %r14, %rcx
ja 0x9333
leaq 0xb0(%rsp), %r14
xorl %ebx, %ebx
leaq 0x90(%rsp), %r13
movq 0xa3bb7(%rip), %rbp     # 0xacfb8
movq %r14, %r12
xorl %edi, %edi
callq 0x44c0
movl %eax, %edi
callq 0x4510
callq 0x40f0
cltq
imulq $0x66666667, %rax, %rcx # imm = 0x66666667
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x22, %rcx
addl %edx, %ecx
addl %ecx, %ecx
leal (%rcx,%rcx,4), %ecx
subl %ecx, %eax
cltq
addq %rbx, %rax
movq 0x70(%rsp), %r15
imulq $0x70, %rax, %r14
leaq 0xa0(%rsp), %rax
movq %rax, 0x90(%rsp)
movq (%r15,%r14), %rsi
movq 0x8(%r15,%r14), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x39158
addq %r14, %r15
leaq 0x20(%r15), %rsi
movq %r12, %r14
movq %r12, %rdi
callq 0xa436
leaq 0x38(%r15), %rsi
leaq 0xc8(%rsp), %rdi
callq 0x8a94
addq $0x58, %r15
leaq 0xe8(%rsp), %rdi
movq %r15, %rsi
callq 0xa436
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x4520
movsbl %al, %esi
movq %rbp, %rdi
callq 0x4050
movq %rax, %rdi
callq 0x4370
movl $0xe, %edx
movq %rbp, %rdi
leaq 0x8a777(%rip), %rsi     # 0x93c4b
callq 0x45a0
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x90(%rsp), %rsi
movq 0x98(%rsp), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rdi
callq 0x39158
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %rbp, %rdi
callq 0x45a0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x4520
movsbl %al, %esi
movq %r15, %rdi
callq 0x4050
movq %rax, %rdi
callq 0x4370
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x9550
callq 0x44e0
cmpb $0x0, 0x4c(%rsp)
je 0x9566
movq %r13, %rdi
leaq 0x70(%rsp), %rsi
callq 0x9d5c
jmp 0x9573
movq %r13, %rdi
leaq 0x70(%rsp), %rsi
callq 0x9a60
leaq 0xe8(%rsp), %rdi
callq 0xa09a
cmpb $0x0, 0xd8(%rsp)
jne 0x959c
movq 0xe0(%rsp), %rdi
testq %rdi, %rdi
je 0x959c
callq 0x4680
movq %r14, %rdi
callq 0xa09a
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x95be
callq 0x44e0
addq $0xa, %rbx
cmpl $0x64, %ebx
jne 0x9401
leaq 0x70(%rsp), %rdi
callq 0x9d34
jmp 0x961d
movq 0xa39da(%rip), %rbx     # 0xacfb8
leaq 0x8a64a(%rip), %rsi     # 0x93c2f
movl $0x1b, %edx
movq %rbx, %rdi
callq 0x45a0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x4520
movsbl %al, %esi
movq 0xa39a8(%rip), %rdi     # 0xacfb8
callq 0x4050
movq %rax, %rdi
callq 0x4370
leaq 0x50(%rsp), %rdi
callq 0x39226
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x963b
callq 0x44e0
addq $0x528, %rsp            # imm = 0x528
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
jne 0x979b
jmp 0x97a0
movq %rax, %rbx
jmp 0x97a0
jmp 0x9745
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
jne 0x969c
jmp 0x96a1
movq %rax, %rbx
jmp 0x96a1
movq %rax, %rbx
movq 0x70(%rsp), %rdi
cmpq %r15, %rdi
je 0x96a1
callq 0x44e0
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x9748
callq 0x44e0
jmp 0x9748
jmp 0x96ec
movq %rax, %rbx
movq 0x100(%rsp), %rdi
cmpq %rbp, %rdi
jne 0x9737
jmp 0x973c
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x9a22
jmp 0x973c
jmp 0x9745
movq %rax, %rbx
jmp 0x973c
movq %rax, %rbx
jmp 0x9722
movq %rax, %rbx
jmp 0x971a
movq %rax, %rbx
cmpb $0x0, 0xd8(%rsp)
jne 0x971a
movq 0xe0(%rsp), %rdi
testq %rdi, %rdi
je 0x971a
callq 0x4680
movq %r12, %rdi
callq 0xa09a
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x973c
callq 0x44e0
leaq 0x38(%rsp), %r14
jmp 0x977d
jmp 0x9768
movq %rax, %rbx
leaq 0x38(%rsp), %r14
jmp 0x9787
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x976b
callq 0x44e0
jmp 0x976b
movq %rax, %rbx
leaq 0x38(%rsp), %r14
leaq 0x90(%rsp), %rdi
callq 0x9a22
leaq 0x70(%rsp), %rdi
callq 0x9d34
leaq 0x50(%rsp), %rdi
callq 0x39226
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x97a0
callq 0x44e0
movq %rbx, %rdi
callq 0x4950