// File: /workspace/github_cpp_makefile_star2_O1/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 $0xb8, %rsp
movq %rdx, %rbp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x2ab8(%rip), %rdx      # 0x51ac
leaq 0x8(%rsp), %rdi
movq %rdx, %rsi
callq 0x2d2a
leaq 0x38(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq 0x28(%rsp), %rdi
callq 0x2c9a
movq (%rbp), %rsi
movq 0x8(%rbp), %rdx
leaq 0x28(%rsp), %rdi
callq 0x2060
movq (%r15), %rdi
callq 0x2190
testq %rax, %rax
je 0x28dd
movq %rax, %r12
movq %rbp, 0xa8(%rsp)
movq %rbx, 0xb0(%rsp)
movq $0x0, (%rsp)
leaq 0x88(%rsp), %rbp
leaq 0x68(%rsp), %rbx
movq %r12, %rdi
callq 0x21a0
movq %rax, %r14
testq %rax, %rax
je 0x2896
leaq 0x58(%rsp), %rax
movq %rax, 0x48(%rsp)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq 0x48(%rsp), %r13
movq %r13, %rdi
callq 0x2c9a
addq $0x13, %r14
movq %r13, %rdi
movq %r14, %rsi
callq 0x2250
leaq 0x98(%rsp), %rax
movq %rax, 0x88(%rsp)
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
addq %rsi, %rdx
movq %rbp, %rdi
callq 0x2c9a
leaq 0x78(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x2c9a
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x2520
movl %eax, %r13d
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x281b
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x2110
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x2840
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x2110
testb %r13b, %r13b
je 0x2871
movq 0x10(%rsp), %r13
movq %r14, %rdi
callq 0x2070
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %r14, %rcx
movq %rax, %r8
callq 0x21c0
movq (%rsp), %rax
incl %eax
movq %rax, (%rsp)
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x2769
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2110
jmp 0x2769
movq %r12, %rdi
callq 0x21f0
cmpl $0x0, (%rsp)
leaq 0x18(%rsp), %r14
leaq 0x38(%rsp), %r13
movq 0xb0(%rsp), %rbx
movq 0xa8(%rsp), %rbp
jle 0x28dd
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq 0x8(%rsp), %rcx
cmpq %r14, %rcx
je 0x28ed
movq %rcx, (%rbx)
movq 0x18(%rsp), %rax
movq %rax, 0x10(%rbx)
jmp 0x28f4
movq %rbx, %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x2c3f
jmp 0x2910
movups (%r14), %xmm0
movups %xmm0, (%rax)
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rbx)
movq %r14, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movb $0x0, 0x18(%rsp)
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x2927
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2110
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x293e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2110
movq %rbx, %rax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2955
movq %rax, %rbx
jmp 0x29dd
movq %rax, %rbx
jmp 0x29f9
movq %rax, %rbx
jmp 0x2989
movq %rax, %rbx
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x2989
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x2110
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x29bc
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x2110
jmp 0x29bc
jmp 0x29b4
jmp 0x29b9
movq %rax, %rbx
jmp 0x29d8
movq %rax, %rbx
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x29d8
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2110
leaq 0x38(%rsp), %r13
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
leaq 0x18(%rsp), %r14
je 0x29f9
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2110
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x2a10
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2110
movq %rbx, %rdi
callq 0x2230