// File: /workspace/github_c_makefile_star2_O2/enzo1982[P]smooth/classes/system/dynamicloader.cpp
// Function: smooth::System::DynamicLoader::GetLibraryDirectories()
const S::Array<S::String> &S::System::DynamicLoader::GetLibraryDirectories()
{
	static Array<String>	 directories;

#ifndef __WIN32__
	if (directories.Length() == 0)
	{
		/* Look for /usr/lib and /usr/local/lib on all systems.
		 */
		if (Directory("/usr/lib").Exists())	    directories.Add("/usr/lib");
		if (Directory("/usr/local/lib").Exists())   directories.Add("/usr/local/lib");

#if defined __APPLE__
		/* Look for library directories of ports projects.
		 */
		if (Directory("/opt/local/lib").Exists())   directories.Add("/opt/local/lib");
		if (Directory("/sw/lib").Exists())	    directories.Add("/sw/lib");
#elif defined __linux__
		/* Query X11 library path to handle architecture-specific library paths on Linux.
		 */
		Dl_info	 info = { 0 };

		dladdr((void *) &X11::XOpenDisplay, &info);

		const String	 libraryPath = File(info.dli_fname).GetFilePath();

		directories.Add(libraryPath);
#elif defined __HAIKU__
		/* Query smooth library path to handle architecture suffix on Haiku.
		 */
		Dl_info	 info = { 0 };

		dladdr((void *) &S::System::DynamicLoader::GetLibraryDirectories, &info);

		const String	 libraryPath = File(info.dli_fname).GetFilePath();

		directories.Add(libraryPath);

		if	(libraryPath.Contains("/system/non-packaged/")) directories.Add(libraryPath.Replace("/system/non-packaged/", "/system/"));
		else if (libraryPath.Contains("/system/"))		directories.Add(libraryPath.Replace("/system/", "/system/non-packaged/"));
#elif defined __NetBSD__
		/* Packages live in /usr/pkg on NetBSD.
		 */
		if (Directory("/usr/pkg/lib").Exists())	    directories.Add("/usr/pkg/lib");
#endif

		/* Parse /etc/ld.so.conf if it exists.
		 */
		if (File("/etc/ld.so.conf").Exists())	    ParseDirectoryList("/etc/ld.so.conf", directories);

		/* Parse LD_LIBRARY_PATH environment variable.
		 */
		const Array<String>	&paths = String(getenv("LD_LIBRARY_PATH")).Explode(":");

		foreach (const String &path, paths) if (Directory(path).Exists()) directories.Add(path);
	}
#endif

	return directories;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movq %rdi, %rbx
movb 0xc0a02(%rip), %al      # 0x16c160
testb %al, %al
je 0xabaef
cmpl $0x0, 0xc09a3(%rip)     # 0x16c110
jne 0xabad6
leaq 0x56c6a(%rip), %rsi     # 0x1023e4
leaq 0x48(%rsp), %rdi
callq 0x58c40
leaq 0x20(%rsp), %rdi
xorl %esi, %esi
callq 0x5a180
leaq 0xb8(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x20(%rsp), %rdx
callq 0x59fb0
leaq 0xb8(%rsp), %rdi
callq 0x56480
movl %eax, %ebp
leaq 0xb8(%rsp), %rdi
callq 0x5a598
leaq 0x20(%rsp), %rdi
callq 0x5a588
leaq 0x48(%rsp), %rdi
callq 0x5a588
testb %bpl, %bpl
je 0xab80f
leaq 0x56c01(%rip), %rsi     # 0x1023e4
leaq 0xb8(%rsp), %r14
movq %r14, %rdi
callq 0x58c40
leaq 0xc090e(%rip), %rdi     # 0x16c108
movq %r14, %rsi
callq 0x64dee
leaq 0xb8(%rsp), %rdi
callq 0x5a588
leaq 0x56bd7(%rip), %rsi     # 0x1023ed
leaq 0x48(%rsp), %rdi
callq 0x58c40
leaq 0x20(%rsp), %rdi
xorl %esi, %esi
callq 0x5a180
leaq 0xb8(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x20(%rsp), %rdx
callq 0x59fb0
leaq 0xb8(%rsp), %rdi
callq 0x56480
movl %eax, %ebp
leaq 0xb8(%rsp), %rdi
callq 0x5a598
leaq 0x20(%rsp), %rdi
callq 0x5a588
leaq 0x48(%rsp), %rdi
callq 0x5a588
testb %bpl, %bpl
je 0xab8ab
leaq 0x56b6e(%rip), %rsi     # 0x1023ed
leaq 0xb8(%rsp), %r14
movq %r14, %rdi
callq 0x58c40
leaq 0xc0872(%rip), %rdi     # 0x16c108
movq %r14, %rsi
callq 0x64dee
leaq 0xb8(%rsp), %rdi
callq 0x5a588
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %r14
movaps %xmm0, 0x10(%r14)
movaps %xmm0, (%r14)
movq 0xb5cc5(%rip), %rdi     # 0x161588
movq %r14, %rsi
callq 0x59520
movq (%r14), %rsi
leaq 0x48(%rsp), %rdi
callq 0x58c40
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
callq 0x5a180
leaq 0xb8(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0x57940
leaq 0xb8(%rsp), %rdi
callq 0x59370
leaq 0xa0(%rsp), %rdi
movq %rax, %rsi
callq 0x58280
leaq 0xb8(%rsp), %rdi
callq 0x5a500
leaq 0x8(%rsp), %rdi
callq 0x5a588
leaq 0x48(%rsp), %rdi
callq 0x5a588
leaq 0xc07c8(%rip), %rdi     # 0x16c108
leaq 0xa0(%rsp), %rsi
callq 0x64dee
leaq 0x56aa8(%rip), %rsi     # 0x1023fc
leaq 0x48(%rsp), %rdi
callq 0x58c40
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
callq 0x5a180
leaq 0xb8(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0x57940
leaq 0xb8(%rsp), %rdi
callq 0x580a0
movl %eax, %ebp
leaq 0xb8(%rsp), %rdi
callq 0x5a500
leaq 0x8(%rsp), %rdi
callq 0x5a588
leaq 0x48(%rsp), %rdi
callq 0x5a588
testb %bpl, %bpl
je 0xab9ee
leaq 0x56a3f(%rip), %rsi     # 0x1023fc
leaq 0xb8(%rsp), %rdi
callq 0x58c40
leaq 0xc0737(%rip), %rdx     # 0x16c108
leaq 0xb8(%rsp), %rsi
movq %rbx, %rdi
callq 0x57290
leaq 0xb8(%rsp), %rdi
callq 0x5a588
leaq 0x56a17(%rip), %rdi     # 0x10240c
callq 0x58950
leaq 0xb8(%rsp), %rdi
movq %rax, %rsi
callq 0x58c40
leaq 0x376bd(%rip), %rsi     # 0xe30ce
leaq 0x8(%rsp), %rdi
callq 0x58c40
leaq 0x48(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0x591a0
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x5a588
leaq 0xb8(%rsp), %r14
movq %r14, %rdi
callq 0x5a588
xorl %r15d, %r15d
leaq 0x48(%rsp), %r12
leal -0x1(%r15), %eax
movl 0x50(%rsp), %ecx
decl %ecx
cmpl %ecx, %eax
jge 0xababf
movq %r12, %rdi
movl %r15d, %esi
callq 0x64d9c
movq %rax, %rbp
movq %rbx, %rdi
xorl %esi, %esi
callq 0x5a180
movq %r14, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x59fb0
movq %r14, %rdi
callq 0x56480
movl %eax, %r13d
movq %r14, %rdi
callq 0x5a598
movq %rbx, %rdi
callq 0x5a588
testb %r13b, %r13b
je 0xababa
leaq 0xc0656(%rip), %rdi     # 0x16c108
movq %rbp, %rsi
callq 0x64dee
incl %r15d
jmp 0xaba57
leaq 0x48(%rsp), %rdi
callq 0x64988
leaq 0xa0(%rsp), %rdi
callq 0x5a588
leaq 0xc062b(%rip), %rax     # 0x16c108
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xc066a(%rip), %rdi     # 0x16c160
callq 0x57210
testl %eax, %eax
je 0xab766
leaq 0xc05fe(%rip), %rdi     # 0x16c108
callq 0x64972
leaq -0x4718e(%rip), %rdi    # 0x64988
leaq 0xc05eb(%rip), %rsi     # 0x16c108
leaq 0xb871c(%rip), %rdx     # 0x164240
callq 0x590a0
leaq 0xc0630(%rip), %rdi     # 0x16c160
callq 0x57cf0
jmp 0xab766
movq %rax, %rbx
leaq 0xc061c(%rip), %rdi     # 0x16c160
callq 0x57520
jmp 0xabc48
jmp 0xabb73
jmp 0xabbb7
jmp 0xabb54
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
jmp 0xabc43
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x5a588
jmp 0xabb76
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
jmp 0xabbab
jmp 0xabbb7
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x5a500
jmp 0xabb97
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x5a588
jmp 0xabba6
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x5a588
jmp 0xabc3b
jmp 0xabbb7
movq %rax, %rbx
jmp 0xabc3b
movq %rax, %rbx
jmp 0xabbfa
jmp 0xabbe5
jmp 0xabbc9
jmp 0xabbdb
jmp 0xabbe5
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x5a598
jmp 0xabbde
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
jmp 0xabbff
movq %rax, %rbx
jmp 0xabc04
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x5a500
leaq 0x8(%rsp), %rdi
callq 0x5a588
leaq 0x48(%rsp), %rdi
jmp 0xabc43
jmp 0xabc2e
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x5a598
jmp 0xabc22
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x5a588
jmp 0xabc31
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x64988
leaq 0xa0(%rsp), %rdi
callq 0x5a588
movq %rbx, %rdi
callq 0x58260