// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/classes/files/directory.cpp
// Function: smooth::Directory::GetFilesByPattern(smooth::String const&) const
const S::Array<S::File> &S::Directory::GetFilesByPattern(const String &pattern) const
{
	files.RemoveAll();

#ifdef __WIN32__
	WIN32_FIND_DATA	 findData;
	HANDLE		 handle = FindFirstFile(MakeExtendedPath(*this).Append(kBackslash).Append(pattern), &findData);

	Bool	 success = (handle != INVALID_HANDLE_VALUE);

	while (success)
	{
		if (!(findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) files.Add(File(findData.cFileName, *this));

		success = FindNextFile(handle, &findData);
	}

	FindClose(handle);
#else
	String	 path	  = String(*this).Replace("*", "\\*").Replace("?", "\\?").
					  Replace("[", "\\[").Replace("]", "\\]");
	glob_t	 fileData = { 0 };

	if (glob(path.Append(kSlash).Append(pattern).ConvertTo("UTF-8"), GLOB_MARK, NIL, &fileData) == 0)
	{
		String::InputFormat	 inputFormat("UTF-8");

		for (size_t i = 0; i < fileData.gl_pathc; i++)
		{
			if (!String(fileData.gl_pathv[i]).EndsWith(kSlash)) files.Add(File(fileData.gl_pathv[i]));
		}

		globfree(&fileData);
	}
#endif

	return files;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x250, %rsp            # imm = 0x250
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x200(%rbp)
addq $0x88, %rdi
callq 0x65ae0
movq -0x200(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x5b330
leaq 0x141921(%rip), %rsi    # 0x1a5e02
leaq -0x58(%rbp), %rdi
callq 0x5c1f0
jmp 0x644ec
leaq 0x122d42(%rip), %rsi    # 0x187235
leaq -0x80(%rbp), %rdi
callq 0x5c1f0
jmp 0x644fe
leaq -0x40(%rbp), %rdi
leaq -0x58(%rbp), %rsi
leaq -0x80(%rbp), %rdx
callq 0x5bd30
movq %rax, -0x208(%rbp)
jmp 0x64518
leaq 0x122d1a(%rip), %rsi    # 0x187239
leaq -0x98(%rbp), %rdi
callq 0x5c1f0
jmp 0x6452d
leaq 0x122d04(%rip), %rsi    # 0x187238
leaq -0xb0(%rbp), %rdi
callq 0x5c1f0
jmp 0x64542
movq -0x208(%rbp), %rdi
leaq -0x98(%rbp), %rsi
leaq -0xb0(%rbp), %rdx
callq 0x5bd30
movq %rax, -0x210(%rbp)
jmp 0x64565
leaq 0x122cd0(%rip), %rsi    # 0x18723c
leaq -0xc8(%rbp), %rdi
callq 0x5c1f0
jmp 0x6457a
leaq 0x122cba(%rip), %rsi    # 0x18723b
leaq -0xe0(%rbp), %rdi
callq 0x5c1f0
jmp 0x6458f
movq -0x210(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
leaq -0xe0(%rbp), %rdx
callq 0x5bd30
movq %rax, -0x218(%rbp)
jmp 0x645b2
leaq 0x14be15(%rip), %rsi    # 0x1b03ce
leaq -0xf8(%rbp), %rdi
callq 0x5c1f0
jmp 0x645c7
leaq 0x122c70(%rip), %rsi    # 0x18723e
leaq -0x110(%rbp), %rdi
callq 0x5c1f0
jmp 0x645dc
movq -0x218(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
leaq -0x110(%rbp), %rdx
callq 0x5bd30
movq %rax, -0x220(%rbp)
jmp 0x645ff
movq -0x220(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x5b6d0
jmp 0x64611
leaq -0x110(%rbp), %rdi
callq 0x5df00
leaq -0xf8(%rbp), %rdi
callq 0x5df00
leaq -0xe0(%rbp), %rdi
callq 0x5df00
leaq -0xc8(%rbp), %rdi
callq 0x5df00
leaq -0xb0(%rbp), %rdi
callq 0x5df00
leaq -0x98(%rbp), %rdi
callq 0x5df00
leaq -0x80(%rbp), %rdi
callq 0x5df00
leaq -0x58(%rbp), %rdi
callq 0x5df00
leaq -0x40(%rbp), %rdi
callq 0x5df00
xorps %xmm0, %xmm0
movaps %xmm0, -0x130(%rbp)
movaps %xmm0, -0x140(%rbp)
movaps %xmm0, -0x150(%rbp)
movaps %xmm0, -0x160(%rbp)
movq $0x0, -0x120(%rbp)
leaq 0x1a7963(%rip), %rsi    # 0x20c008
leaq -0x28(%rbp), %rdi
callq 0x5a710
movq %rax, -0x228(%rbp)
jmp 0x646b7
movq -0x228(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x5a710
movq %rax, -0x230(%rbp)
jmp 0x646d0
movq -0x230(%rbp), %rdi
leaq 0x141508(%rip), %rsi    # 0x1a5be6
callq 0x5c120
movq %rax, -0x238(%rbp)
jmp 0x646ec
movq -0x238(%rbp), %rdi
movl $0x2, %esi
xorl %eax, %eax
movl %eax, %edx
leaq -0x160(%rbp), %rcx
callq 0x5bf20
cmpl $0x0, %eax
jne 0x64a05
leaq 0x1414ce(%rip), %rsi    # 0x1a5be6
leaq -0x178(%rbp), %rdi
callq 0x5ddc0
jmp 0x64726
movq $0x0, -0x180(%rbp)
movq -0x180(%rbp), %rax
cmpq -0x160(%rbp), %rax
jae 0x649dd
movq -0x158(%rbp), %rax
movq -0x180(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq -0x198(%rbp), %rdi
callq 0x5c1f0
jmp 0x64765
leaq 0x1a789c(%rip), %rsi    # 0x20c008
leaq -0x198(%rbp), %rdi
callq 0x5d6c0
movb %al, -0x239(%rbp)
jmp 0x64780
movb -0x239(%rbp), %al
xorb $-0x1, %al
movb %al, -0x23a(%rbp)
leaq -0x198(%rbp), %rdi
callq 0x5df00
movb -0x23a(%rbp), %al
testb $0x1, %al
jne 0x647a9
jmp 0x649c4
movq -0x200(%rbp), %rax
addq $0x88, %rax
movq %rax, -0x248(%rbp)
movq -0x158(%rbp), %rax
movq -0x180(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq -0x1e0(%rbp), %rdi
callq 0x5c1f0
jmp 0x647dd
leaq -0x1f8(%rbp), %rdi
xorl %esi, %esi
callq 0x5da90
jmp 0x647ed
leaq -0x1c8(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
leaq -0x1f8(%rbp), %rdx
callq 0x5acf0
jmp 0x64809
movq -0x248(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
callq 0x65c50
jmp 0x6481e
leaq -0x1c8(%rbp), %rdi
callq 0x5de78
leaq -0x1f8(%rbp), %rdi
callq 0x5df00
leaq -0x1e0(%rbp), %rdi
callq 0x5df00
jmp 0x649c4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x64929
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x64920
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x64917
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x6490b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x648ff
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x648f3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x648e7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x648db
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x5df00
leaq -0xf8(%rbp), %rdi
callq 0x5df00
leaq -0xe0(%rbp), %rdi
callq 0x5df00
leaq -0xc8(%rbp), %rdi
callq 0x5df00
leaq -0xb0(%rbp), %rdi
callq 0x5df00
leaq -0x98(%rbp), %rdi
callq 0x5df00
leaq -0x80(%rbp), %rdi
callq 0x5df00
leaq -0x58(%rbp), %rdi
callq 0x5df00
leaq -0x40(%rbp), %rdi
callq 0x5df00
jmp 0x64a3b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x64a32
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x649f7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x198(%rbp), %rdi
callq 0x5df00
jmp 0x649f7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x649b6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x649aa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x1c8(%rbp), %rdi
callq 0x5de78
leaq -0x1f8(%rbp), %rdi
callq 0x5df00
leaq -0x1e0(%rbp), %rdi
callq 0x5df00
jmp 0x649f7
jmp 0x649c6
movq -0x180(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x180(%rbp)
jmp 0x64731
leaq -0x160(%rbp), %rdi
callq 0x59330
leaq -0x178(%rbp), %rdi
callq 0x5af60
jmp 0x64a05
leaq -0x178(%rbp), %rdi
callq 0x5af60
jmp 0x64a32
movq -0x200(%rbp), %rax
addq $0x88, %rax
movq %rax, -0x250(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x5df00
movq -0x250(%rbp), %rax
addq $0x250, %rsp            # imm = 0x250
popq %rbp
retq
leaq -0x28(%rbp), %rdi
callq 0x5df00
movq -0x60(%rbp), %rdi
callq 0x5b6b0
nopw %cs:(%rax,%rax)