// File: /workspace/github_cpp_makefile_star2_O2/BleuLlama[P]msf-tools/DiskUtils.cpp
// Function: DiskUtils::LFNFrom83(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
std::string DiskUtils::LFNFrom83( std::string _path, std::string eightthree )
{
	int foundcount = 0;
	std::string foundname( "" );


	// expand out the full path
	std::string e3_fullpath( _path );
	e3_fullpath.append( eightthree );

	// okay. let's now search the directory for the LFN with the same size.
	DIR * theDir = opendir( _path.c_str() );
	struct dirent * entry;
	if( theDir ) {

		// check each entry
		while(( entry = readdir( theDir )) != NULL ) {

			// build a full path to the file
			std::string lfn_fullpath( _path );
			lfn_fullpath.append( entry->d_name );

			// are they similar?
			bool isSimilar = DiskUtils::IsSimilarFile( e3_fullpath, lfn_fullpath );

			// WE GOT ONE!!!
			if( isSimilar ) {
				foundcount++;
				foundname.assign( entry->d_name );
			}
		}


		closedir( theDir );
	}

	// okay. there was a match. return it.
	if( foundcount >= 1 ) {
		return foundname;
	}

	return _path + eightthree;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x1ba3(%rip), %rsi      # 0x41ac
leaq 0x20(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0x2956
leaq 0x48(%rsp), %rdi
movq %r15, 0x10(%rsp)
movq %r15, %rsi
callq 0x2170
movq %rbx, 0x18(%rsp)
leaq 0x48(%rsp), %rdi
movq %r14, 0x40(%rsp)
movq %r14, %rsi
callq 0x2250
movq 0x10(%rsp), %rax
movq (%rax), %rdi
callq 0x2190
testq %rax, %rax
je 0x2733
movq %rax, %r12
movl $0x0, 0xc(%rsp)
leaq 0xa8(%rsp), %r13
leaq 0x88(%rsp), %rbp
leaq 0x68(%rsp), %rbx
movq %r12, %rdi
callq 0x21a0
movq %rax, %r14
testq %rax, %rax
je 0x26fc
movq %r13, %rdi
movq 0x10(%rsp), %rsi
callq 0x2170
addq $0x13, %r14
movq %r13, %rdi
movq %r14, %rsi
callq 0x2220
movq %rbp, %rdi
leaq 0x48(%rsp), %rsi
callq 0x2170
movq %rbx, %rdi
movq %r13, %rsi
callq 0x2170
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x24a2
movl %eax, %r15d
movq %rbx, %rdi
callq 0x2060
movq %rbp, %rdi
callq 0x2060
testb %r15b, %r15b
je 0x26ef
leaq 0x20(%rsp), %rdi
movq %r14, %rsi
callq 0x2230
incl 0xc(%rsp)
movq %r13, %rdi
callq 0x2060
jmp 0x2677
movq %r12, %rdi
callq 0x21e0
cmpl $0x0, 0xc(%rsp)
jle 0x2733
movq 0x18(%rsp), %rbx
leaq 0x10(%rbx), %rcx
movq %rcx, (%rbx)
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdx
cmpq %rax, %rdx
je 0x274c
movq %rdx, (%rbx)
movq 0x30(%rsp), %rcx
movq %rcx, 0x10(%rbx)
jmp 0x2752
movq 0x18(%rsp), %rbx
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
movq 0x40(%rsp), %rdx
callq 0x2991
jmp 0x276b
movups (%rax), %xmm0
movups %xmm0, (%rcx)
movq 0x28(%rsp), %rcx
movq %rcx, 0x8(%rbx)
movq %rax, 0x20(%rsp)
andq $0x0, 0x28(%rsp)
movb $0x0, 0x30(%rsp)
leaq 0x48(%rsp), %rdi
callq 0x2060
leaq 0x20(%rsp), %rdi
callq 0x2060
movq %rbx, %rax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x27c2
jmp 0x27c2
movq %rax, %rbx
jmp 0x27e1
movq %rax, %rbx
jmp 0x27af
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x2060
leaq 0x88(%rsp), %rdi
callq 0x2060
jmp 0x27ca
jmp 0x27c2
jmp 0x27c7
movq %rax, %rbx
jmp 0x27d7
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x2060
leaq 0x48(%rsp), %rdi
callq 0x2060
leaq 0x20(%rsp), %rdi
callq 0x2060
movq %rbx, %rdi
callq 0x2200
nop