// File: /workspace/github_c_makefile_star2_O3/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 0xc59a4(%rip), %al      # 0x175fa0
testb %al, %al
je 0xb0995
cmpl $0x0, 0xc5945(%rip)     # 0x175f50
jne 0xb097c
leaq 0x61edc(%rip), %rsi     # 0x1124f4
leaq 0x48(%rsp), %rdi
callq 0x579f0
leaq 0x20(%rsp), %rdi
xorl %esi, %esi
callq 0x58e20
leaq 0xb8(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x20(%rsp), %rdx
callq 0x58c60
leaq 0xb8(%rsp), %rdi
callq 0x55440
movl %eax, %ebp
leaq 0xb8(%rsp), %rdi
callq 0x59210
leaq 0x20(%rsp), %rdi
callq 0x59200
leaq 0x48(%rsp), %rdi
callq 0x59200
testb %bpl, %bpl
je 0xb06ad
leaq 0x61e73(%rip), %rsi     # 0x1124f4
leaq 0xb8(%rsp), %r14
movq %r14, %rdi
callq 0x579f0
leaq 0xc58b0(%rip), %rdi     # 0x175f48
movq %r14, %rsi
callq 0x642ac
leaq 0xb8(%rsp), %rdi
callq 0x59200
leaq 0x61e49(%rip), %rsi     # 0x1124fd
leaq 0x48(%rsp), %rdi
callq 0x579f0
leaq 0x20(%rsp), %rdi
xorl %esi, %esi
callq 0x58e20
leaq 0xb8(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x20(%rsp), %rdx
callq 0x58c60
leaq 0xb8(%rsp), %rdi
callq 0x55440
movl %eax, %ebp
leaq 0xb8(%rsp), %rdi
callq 0x59210
leaq 0x20(%rsp), %rdi
callq 0x59200
leaq 0x48(%rsp), %rdi
callq 0x59200
testb %bpl, %bpl
je 0xb0749
leaq 0x61de0(%rip), %rsi     # 0x1124fd
leaq 0xb8(%rsp), %r14
movq %r14, %rdi
callq 0x579f0
leaq 0xc5814(%rip), %rdi     # 0x175f48
movq %r14, %rsi
callq 0x642ac
leaq 0xb8(%rsp), %rdi
callq 0x59200
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %r14
movaps %xmm0, 0x10(%r14)
movaps %xmm0, (%r14)
movq 0xbae27(%rip), %rdi     # 0x16b588
movq %r14, %rsi
callq 0x58270
movq (%r14), %rsi
leaq 0x48(%rsp), %rdi
callq 0x579f0
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
callq 0x58e20
leaq 0xb8(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0x56800
leaq 0xb8(%rsp), %rdi
callq 0x580e0
leaq 0xa0(%rsp), %rdi
movq %rax, %rsi
callq 0x570b0
leaq 0xb8(%rsp), %rdi
callq 0x59178
leaq 0x8(%rsp), %rdi
callq 0x59200
leaq 0x48(%rsp), %rdi
callq 0x59200
leaq 0xc576a(%rip), %rdi     # 0x175f48
leaq 0xa0(%rsp), %rsi
callq 0x642ac
leaq 0x61d1a(%rip), %rsi     # 0x11250c
leaq 0x48(%rsp), %rdi
callq 0x579f0
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
callq 0x58e20
leaq 0xb8(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0x56800
leaq 0xb8(%rsp), %rdi
callq 0x56ef0
movl %eax, %ebp
leaq 0xb8(%rsp), %rdi
callq 0x59178
leaq 0x8(%rsp), %rdi
callq 0x59200
leaq 0x48(%rsp), %rdi
callq 0x59200
testb %bpl, %bpl
je 0xb088c
leaq 0x61cb1(%rip), %rsi     # 0x11250c
leaq 0xb8(%rsp), %rdi
callq 0x579f0
leaq 0xc56d9(%rip), %rdx     # 0x175f48
leaq 0xb8(%rsp), %rsi
movq %rbx, %rdi
callq 0x561a0
leaq 0xb8(%rsp), %rdi
callq 0x59200
leaq 0x61c89(%rip), %rdi     # 0x11251c
callq 0x57720
leaq 0xb8(%rsp), %rdi
movq %rax, %rsi
callq 0x579f0
leaq 0x42838(%rip), %rsi     # 0xf30e7
leaq 0x8(%rsp), %rdi
callq 0x579f0
leaq 0x48(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0x57f10
leaq 0x8(%rsp), %rdi
callq 0x59200
leaq 0xb8(%rsp), %rdi
callq 0x59200
cmpl $0x0, 0x50(%rsp)
jle 0xb0965
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
leaq 0x48(%rsp), %r14
leaq 0x8(%rsp), %r15
leaq 0xb8(%rsp), %r12
incl %ebx
movq %r14, %rdi
movl %ebx, %esi
callq 0x64250
movq %rax, %rbp
movq %r15, %rdi
xorl %esi, %esi
callq 0x58e20
movq %r12, %rdi
movq %rbp, %rsi
movq %r15, %rdx
callq 0x58c60
movq %r12, %rdi
callq 0x55440
movl %eax, %r13d
movq %r12, %rdi
callq 0x59210
movq %r15, %rdi
callq 0x59200
testb %r13b, %r13b
je 0xb095b
leaq 0xc55f5(%rip), %rdi     # 0x175f48
movq %rbp, %rsi
callq 0x642ac
movl 0x50(%rsp), %eax
decl %eax
cmpl %eax, %ebx
jl 0xb0905
leaq 0x48(%rsp), %rdi
callq 0x63e3c
leaq 0xa0(%rsp), %rdi
callq 0x59200
leaq 0xc55c5(%rip), %rax     # 0x175f48
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xc5604(%rip), %rdi     # 0x175fa0
callq 0x56120
testl %eax, %eax
je 0xb0604
leaq 0xc5598(%rip), %rdi     # 0x175f48
callq 0x55d90
leaq 0xaf8f4(%rip), %rax     # 0x1602b0
movq %rax, 0xc55c5(%rip)     # 0x175f88
leaq 0xc557e(%rip), %rsi     # 0x175f48
xorps %xmm0, %xmm0
movups %xmm0, 0xc55bc(%rip)    # 0x175f90
leaq 0xaf835(%rip), %rax     # 0x160210
movq %rax, 0xc5566(%rip)     # 0x175f48
leaq -0x4cbad(%rip), %rdi    # 0x63e3c
leaq 0xbd690(%rip), %rdx     # 0x16e080
callq 0x57e10
leaq 0xc55a4(%rip), %rdi     # 0x175fa0
callq 0x56b80
jmp 0xb0604
movq %rax, %rbx
leaq 0xc5590(%rip), %rdi     # 0x175fa0
callq 0x56420
jmp 0xb0b14
jmp 0xb0a3f
jmp 0xb0a83
jmp 0xb0a20
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
jmp 0xb0b0f
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x59200
jmp 0xb0a42
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
jmp 0xb0a77
jmp 0xb0a83
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x59178
jmp 0xb0a63
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x59200
jmp 0xb0a72
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x59200
jmp 0xb0b07
jmp 0xb0a83
movq %rax, %rbx
jmp 0xb0b07
movq %rax, %rbx
jmp 0xb0ac6
jmp 0xb0ab1
jmp 0xb0a95
jmp 0xb0aa7
jmp 0xb0ab1
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x59210
jmp 0xb0aaa
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
jmp 0xb0acb
movq %rax, %rbx
jmp 0xb0ad0
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x59178
leaq 0x8(%rsp), %rdi
callq 0x59200
leaq 0x48(%rsp), %rdi
jmp 0xb0b0f
jmp 0xb0afa
movq %rax, %rbx
jmp 0xb0aee
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x59210
leaq 0x8(%rsp), %rdi
callq 0x59200
jmp 0xb0afd
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x63e3c
leaq 0xa0(%rsp), %rdi
callq 0x59200
movq %rbx, %rdi
callq 0x57090