// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movq %rsi, %r14
movq %rdi, %r15
addq $0x88, %rdi
movq %rdi, 0x8(%rsp)
callq 0x5cdee
leaq 0x100(%rsp), %rdi
movq %r15, %rsi
callq 0x56d90
leaq 0xb7123(%rip), %rsi     # 0x113342
leaq 0xd0(%rsp), %rdi
callq 0x579f0
leaq 0x9801b(%rip), %rsi     # 0xf424e
leaq 0x10(%rsp), %rdi
callq 0x579f0
leaq 0x100(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
leaq 0x10(%rsp), %rdx
callq 0x575f0
movq %rax, %r15
leaq 0x97ff1(%rip), %rsi     # 0xf4252
leaq 0x40(%rsp), %rdi
callq 0x579f0
leaq 0x97fdf(%rip), %rsi     # 0xf4251
leaq 0x28(%rsp), %rdi
callq 0x579f0
leaq 0x40(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq %r15, %rdi
callq 0x575f0
movq %rax, %r15
leaq 0x97fbd(%rip), %rsi     # 0xf4255
leaq 0xa0(%rsp), %rdi
callq 0x579f0
leaq 0x97fa8(%rip), %rsi     # 0xf4254
leaq 0x88(%rsp), %rdi
callq 0x579f0
leaq 0xa0(%rsp), %rsi
leaq 0x88(%rsp), %rdx
movq %r15, %rdi
callq 0x575f0
movq %rax, %r15
leaq 0xc1593(%rip), %rsi     # 0x11d86e
leaq 0x70(%rsp), %rdi
callq 0x579f0
leaq 0x97f6b(%rip), %rsi     # 0xf4257
leaq 0x58(%rsp), %rdi
callq 0x579f0
leaq 0x70(%rsp), %rsi
leaq 0x58(%rsp), %rdx
movq %r15, %rdi
callq 0x575f0
leaq 0xb8(%rsp), %rdi
movq %rax, %rsi
callq 0x570b0
leaq 0x58(%rsp), %rdi
callq 0x59200
leaq 0x70(%rsp), %rdi
callq 0x59200
leaq 0x88(%rsp), %rdi
callq 0x59200
leaq 0xa0(%rsp), %rdi
callq 0x59200
leaq 0x28(%rsp), %rdi
callq 0x59200
leaq 0x40(%rsp), %rdi
callq 0x59200
leaq 0x10(%rsp), %rdi
callq 0x59200
leaq 0xd0(%rsp), %rdi
callq 0x59200
leaq 0x100(%rsp), %r15
movq %r15, %rdi
callq 0x59200
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%r15)
movaps %xmm0, 0x20(%r15)
movaps %xmm0, 0x10(%r15)
movaps %xmm0, (%r15)
movq $0x0, 0x40(%r15)
leaq 0x1131a2(%rip), %rsi    # 0x16f548
leaq 0xb8(%rsp), %rdi
callq 0x562f0
movq %rax, %rdi
movq %r14, %rsi
callq 0x562f0
leaq 0xb6d61(%rip), %rsi     # 0x113126
movq %rax, %rdi
callq 0x57940
leaq 0x100(%rsp), %rcx
movq %rax, %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0x57790
testl %eax, %eax
jne 0x5c4ce
leaq 0xb6d33(%rip), %rsi     # 0x113126
leaq 0x10(%rsp), %rdi
callq 0x590d0
cmpq $0x0, 0x100(%rsp)
je 0x5c4b7
xorl %ebx, %ebx
leaq 0xd0(%rsp), %r14
leaq 0x11312b(%rip), %r15    # 0x16f548
leaq 0x40(%rsp), %r12
leaq 0x28(%rsp), %r13
movq 0x108(%rsp), %rax
movq (%rax,%rbx,8), %rsi
movq %r14, %rdi
callq 0x579f0
movq %r14, %rdi
movq %r15, %rsi
callq 0x58b10
movl %eax, %ebp
movq %r14, %rdi
callq 0x59200
testb %bpl, %bpl
jne 0x5c4a6
movq 0x108(%rsp), %rax
movq (%rax,%rbx,8), %rsi
movq %r12, %rdi
callq 0x579f0
movq %r13, %rdi
xorl %esi, %esi
callq 0x58e20
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x56800
movq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x5d4bc
movq %r14, %rdi
callq 0x59178
movq %r13, %rdi
callq 0x59200
movq %r12, %rdi
callq 0x59200
incq %rbx
cmpq 0x100(%rsp), %rbx
jb 0x5c427
leaq 0x100(%rsp), %rdi
callq 0x55270
leaq 0x10(%rsp), %rdi
callq 0x56a30
leaq 0xb8(%rsp), %rdi
callq 0x59200
movq 0x8(%rsp), %rax
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5c58b
movq %rax, %rbx
jmp 0x5c532
jmp 0x5c4fe
movq %rax, %rbx
jmp 0x5c53c
movq %rax, %rbx
jmp 0x5c549
jmp 0x5c50a
movq %rax, %rbx
jmp 0x5c556
movq %rax, %rbx
jmp 0x5c560
jmp 0x5c516
movq %rax, %rbx
jmp 0x5c56a
movq %rax, %rbx
jmp 0x5c574
movq %rax, %rbx
jmp 0x5c581
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x59200
leaq 0x70(%rsp), %rdi
callq 0x59200
leaq 0x88(%rsp), %rdi
callq 0x59200
leaq 0xa0(%rsp), %rdi
callq 0x59200
leaq 0x28(%rsp), %rdi
callq 0x59200
leaq 0x40(%rsp), %rdi
callq 0x59200
leaq 0x10(%rsp), %rdi
callq 0x59200
leaq 0xd0(%rsp), %rdi
callq 0x59200
leaq 0x100(%rsp), %rdi
jmp 0x5c5e4
movq %rax, %rbx
jmp 0x5c5dc
jmp 0x5c5bd
movq %rax, %rbx
jmp 0x5c5ac
movq %rax, %rbx
jmp 0x5c5b6
movq %rax, %rbx
leaq 0xd0(%rsp), %rdi
callq 0x59178
leaq 0x28(%rsp), %rdi
callq 0x59200
leaq 0x40(%rsp), %rdi
jmp 0x5c5cd
movq %rax, %rbx
jmp 0x5c5d2
movq %rax, %rbx
leaq 0xd0(%rsp), %rdi
callq 0x59200
leaq 0x10(%rsp), %rdi
callq 0x56a30
leaq 0xb8(%rsp), %rdi
callq 0x59200
movq %rbx, %rdi
callq 0x57090
nop