// File: /workspace/github_c_makefile_star2_O1/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 0xc5c04(%rip), %al      # 0x176fa0
testb %al, %al
je 0xb1735
cmpl $0x0, 0xc5ba5(%rip)     # 0x176f50
jne 0xb171c
leaq 0x61f8c(%rip), %rsi     # 0x113344
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 0xb144d
leaq 0x61f23(%rip), %rsi     # 0x113344
leaq 0xb8(%rsp), %r14
movq %r14, %rdi
callq 0x579f0
leaq 0xc5b10(%rip), %rdi     # 0x176f48
movq %r14, %rsi
callq 0x64280
leaq 0xb8(%rsp), %rdi
callq 0x59200
leaq 0x61ef9(%rip), %rsi     # 0x11334d
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 0xb14e9
leaq 0x61e90(%rip), %rsi     # 0x11334d
leaq 0xb8(%rsp), %r14
movq %r14, %rdi
callq 0x579f0
leaq 0xc5a74(%rip), %rdi     # 0x176f48
movq %r14, %rsi
callq 0x64280
leaq 0xb8(%rsp), %rdi
callq 0x59200
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %r14
movaps %xmm0, 0x10(%r14)
movaps %xmm0, (%r14)
movq 0xbb087(%rip), %rdi     # 0x16c588
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 0xc59ca(%rip), %rdi     # 0x176f48
leaq 0xa0(%rsp), %rsi
callq 0x64280
leaq 0x61dca(%rip), %rsi     # 0x11335c
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 0xb162c
leaq 0x61d61(%rip), %rsi     # 0x11335c
leaq 0xb8(%rsp), %rdi
callq 0x579f0
leaq 0xc5939(%rip), %rdx     # 0x176f48
leaq 0xb8(%rsp), %rsi
movq %rbx, %rdi
callq 0x561a0
leaq 0xb8(%rsp), %rdi
callq 0x59200
leaq 0x61d39(%rip), %rdi     # 0x11336c
callq 0x57720
leaq 0xb8(%rsp), %rdi
movq %rax, %rsi
callq 0x579f0
leaq 0x42a98(%rip), %rsi     # 0xf40e7
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 0xb1705
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 0x64224
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 0xb16fb
leaq 0xc5855(%rip), %rdi     # 0x176f48
movq %rbp, %rsi
callq 0x64280
movl 0x50(%rsp), %eax
decl %eax
cmpl %eax, %ebx
jl 0xb16a5
leaq 0x48(%rsp), %rdi
callq 0x63e08
leaq 0xa0(%rsp), %rdi
callq 0x59200
leaq 0xc5825(%rip), %rax     # 0x176f48
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xc5864(%rip), %rdi     # 0x176fa0
callq 0x56120
testl %eax, %eax
je 0xb13a4
leaq 0xc57f8(%rip), %rdi     # 0x176f48
callq 0x55d90
leaq 0xc57ec(%rip), %rsi     # 0x176f48
leaq 0xafb2d(%rip), %rax     # 0x161290
movq %rax, 0xc581e(%rip)     # 0x176f88
xorps %xmm0, %xmm0
movups %xmm0, 0xc581c(%rip)    # 0x176f90
leaq 0xafa75(%rip), %rax     # 0x1611f0
movq %rax, 0xc57c6(%rip)     # 0x176f48
leaq -0x4d981(%rip), %rdi    # 0x63e08
leaq 0xbd8f0(%rip), %rdx     # 0x16f080
callq 0x57e10
leaq 0xc5804(%rip), %rdi     # 0x176fa0
callq 0x56b80
jmp 0xb13a4
movq %rax, %rbx
leaq 0xc57f0(%rip), %rdi     # 0x176fa0
callq 0x56420
jmp 0xb18b9
jmp 0xb17df
jmp 0xb1823
jmp 0xb17c0
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
jmp 0xb18b4
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x59200
jmp 0xb17e2
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
jmp 0xb1817
jmp 0xb1823
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x59178
jmp 0xb1803
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x59200
jmp 0xb1812
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x59200
jmp 0xb18ac
jmp 0xb1823
movq %rax, %rbx
jmp 0xb18ac
movq %rax, %rbx
jmp 0xb1869
jmp 0xb1854
jmp 0xb1838
jmp 0xb184a
jmp 0xb1854
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x59210
jmp 0xb184d
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
jmp 0xb186e
movq %rax, %rbx
jmp 0xb1873
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x59178
leaq 0x8(%rsp), %rdi
callq 0x59200
leaq 0x48(%rsp), %rdi
jmp 0xb18b4
jmp 0xb187e
jmp 0xb187e
movq %rax, %rbx
jmp 0xb18a2
movq %rax, %rbx
jmp 0xb1898
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x59210
leaq 0x8(%rsp), %rdi
callq 0x59200
leaq 0x48(%rsp), %rdi
callq 0x63e08
leaq 0xa0(%rsp), %rdi
callq 0x59200
movq %rbx, %rdi
callq 0x57090
nop