// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/classes/files/directory.cpp
// Function: smooth::Directory::GetDirectoriesByPattern(smooth::String const&) const
const S::Array<S::Directory> &S::Directory::GetDirectoriesByPattern(const String &pattern) const
{
	directories.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) && String(findData.cFileName) != kDot && String(findData.cFileName) != kDots) directories.Add(Directory(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 | GLOB_ONLYDIR, 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)) directories.Add(Directory(fileData.gl_pathv[i]));
		}

		globfree(&fileData);
	}
#endif

	return directories;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x300, %rsp            # imm = 0x300
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x2b0(%rbp)
addq $0x30, %rdi
callq 0x65ce0
movq -0x2b0(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x5b330
leaq 0x141304(%rip), %rsi    # 0x1a5e02
leaq -0x58(%rbp), %rdi
callq 0x5c1f0
jmp 0x64b09
leaq 0x122725(%rip), %rsi    # 0x187235
leaq -0x80(%rbp), %rdi
callq 0x5c1f0
jmp 0x64b1b
leaq -0x40(%rbp), %rdi
leaq -0x58(%rbp), %rsi
leaq -0x80(%rbp), %rdx
callq 0x5bd30
movq %rax, -0x2b8(%rbp)
jmp 0x64b35
leaq 0x1226fd(%rip), %rsi    # 0x187239
leaq -0x98(%rbp), %rdi
callq 0x5c1f0
jmp 0x64b4a
leaq 0x1226e7(%rip), %rsi    # 0x187238
leaq -0xb0(%rbp), %rdi
callq 0x5c1f0
jmp 0x64b5f
movq -0x2b8(%rbp), %rdi
leaq -0x98(%rbp), %rsi
leaq -0xb0(%rbp), %rdx
callq 0x5bd30
movq %rax, -0x2c0(%rbp)
jmp 0x64b82
leaq 0x1226b3(%rip), %rsi    # 0x18723c
leaq -0xc8(%rbp), %rdi
callq 0x5c1f0
jmp 0x64b97
leaq 0x12269d(%rip), %rsi    # 0x18723b
leaq -0xe0(%rbp), %rdi
callq 0x5c1f0
jmp 0x64bac
movq -0x2c0(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
leaq -0xe0(%rbp), %rdx
callq 0x5bd30
movq %rax, -0x2c8(%rbp)
jmp 0x64bcf
leaq 0x14b7f8(%rip), %rsi    # 0x1b03ce
leaq -0xf8(%rbp), %rdi
callq 0x5c1f0
jmp 0x64be4
leaq 0x122653(%rip), %rsi    # 0x18723e
leaq -0x110(%rbp), %rdi
callq 0x5c1f0
jmp 0x64bf9
movq -0x2c8(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
leaq -0x110(%rbp), %rdx
callq 0x5bd30
movq %rax, -0x2d0(%rbp)
jmp 0x64c1c
movq -0x2d0(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x5b6d0
jmp 0x64c2e
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 0x1a7346(%rip), %rsi    # 0x20c008
leaq -0x28(%rbp), %rdi
callq 0x5a710
movq %rax, -0x2d8(%rbp)
jmp 0x64cd4
movq -0x2d8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x5a710
movq %rax, -0x2e0(%rbp)
jmp 0x64ced
movq -0x2e0(%rbp), %rdi
leaq 0x140eeb(%rip), %rsi    # 0x1a5be6
callq 0x5c120
movq %rax, -0x2e8(%rbp)
jmp 0x64d09
movq -0x2e8(%rbp), %rdi
movl $0x2002, %esi           # imm = 0x2002
xorl %eax, %eax
movl %eax, %edx
leaq -0x160(%rbp), %rcx
callq 0x5bf20
cmpl $0x0, %eax
jne 0x65012
leaq 0x140eb1(%rip), %rsi    # 0x1a5be6
leaq -0x178(%rbp), %rdi
callq 0x5ddc0
jmp 0x64d43
movq $0x0, -0x180(%rbp)
movq -0x180(%rbp), %rax
cmpq -0x160(%rbp), %rax
jae 0x64fea
movq -0x158(%rbp), %rax
movq -0x180(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq -0x198(%rbp), %rdi
callq 0x5c1f0
jmp 0x64d82
leaq 0x1a727f(%rip), %rsi    # 0x20c008
leaq -0x198(%rbp), %rdi
callq 0x5d6c0
movb %al, -0x2e9(%rbp)
jmp 0x64d9d
leaq -0x198(%rbp), %rdi
callq 0x5df00
movb -0x2e9(%rbp), %al
testb $0x1, %al
jne 0x64db8
jmp 0x64fd1
movq -0x2b0(%rbp), %rax
addq $0x30, %rax
movq %rax, -0x2f8(%rbp)
movq -0x158(%rbp), %rax
movq -0x180(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq -0x290(%rbp), %rdi
callq 0x5c1f0
jmp 0x64dea
leaq -0x2a8(%rbp), %rdi
xorl %esi, %esi
callq 0x5da90
jmp 0x64dfa
leaq -0x278(%rbp), %rdi
leaq -0x290(%rbp), %rsi
leaq -0x2a8(%rbp), %rdx
callq 0x5d860
jmp 0x64e16
movq -0x2f8(%rbp), %rdi
leaq -0x278(%rbp), %rsi
callq 0x65de0
jmp 0x64e2b
leaq -0x278(%rbp), %rdi
callq 0x5df10
leaq -0x2a8(%rbp), %rdi
callq 0x5df00
leaq -0x290(%rbp), %rdi
callq 0x5df00
jmp 0x64fd1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x64f36
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x64f2d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x64f24
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x64f18
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x64f0c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x64f00
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x64ef4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x64ee8
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 0x65046
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x6503d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x65004
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x198(%rbp), %rdi
callq 0x5df00
jmp 0x65004
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x64fc3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x64fb7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x278(%rbp), %rdi
callq 0x5df10
leaq -0x2a8(%rbp), %rdi
callq 0x5df00
leaq -0x290(%rbp), %rdi
callq 0x5df00
jmp 0x65004
jmp 0x64fd3
movq -0x180(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x180(%rbp)
jmp 0x64d4e
leaq -0x160(%rbp), %rdi
callq 0x59330
leaq -0x178(%rbp), %rdi
callq 0x5af60
jmp 0x65012
leaq -0x178(%rbp), %rdi
callq 0x5af60
jmp 0x6503d
movq -0x2b0(%rbp), %rax
addq $0x30, %rax
movq %rax, -0x300(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x5df00
movq -0x300(%rbp), %rax
addq $0x300, %rsp            # imm = 0x300
popq %rbp
retq
leaq -0x28(%rbp), %rdi
callq 0x5df00
movq -0x60(%rbp), %rdi
callq 0x5b6b0
nop