// File: /workspace/github_c_makefile_star2_O3/enzo1982[P]smooth/classes/system/dynamicloader.cpp
// Function: smooth::System::DynamicLoader::DynamicLoader(smooth::String const&)
S::System::DynamicLoader::DynamicLoader(const String &module) : handle(NIL)
{
#if defined __WIN32__
	static String	 dllExt		= ".dll";
	static String	 versionPattern	= dllExt;
#elif defined __APPLE__
	static String	 dllExt		= ".dylib";
	static String	 versionPattern	= String(".*").Append(dllExt);
#else
	static String	 dllExt		= ".so";
	static String	 versionPattern	= String(dllExt).Append(".*");
#endif

#ifdef __WIN32__
	if (module[1] != ':')
	{
		/* Try the supplied module name in application directory.
		 */
		handle = LoadLibrary(GUI::Application::GetApplicationDirectory().Append(module).Append(module.EndsWith(dllExt) ? String() : dllExt));
	}

	if (handle == NIL)
	{
		/* Try the supplied module name system wide.
		 */
		handle = LoadLibrary(String(module).Append(module.EndsWith(dllExt) ? String() : dllExt));
	}
#else
	Int	 dlopenFlags = RTLD_NOW | RTLD_LOCAL;

#if defined __FreeBSD__ || defined __NetBSD__
	dlopenFlags |= RTLD_NODELETE;
#endif

	if (!module.StartsWith("/"))
	{
		/* Try the supplied module name in application directory.
		 */
		handle = dlopen(GUI::Application::GetApplicationDirectory().Append(module).Append(module.EndsWith(dllExt) || module.Contains(String(dllExt).Append(".")) ? String() : dllExt), dlopenFlags);
	}

	if (handle == NIL)
	{
		/* Try the supplied module name system wide.
		 */
		handle = dlopen(String(module).Append(module.EndsWith(dllExt) || module.Contains(String(dllExt).Append(".")) ? String() : dllExt), dlopenFlags);
	}

	if (handle == NIL)
	{
		const Array<String> &directories = GetLibraryDirectories();

		/* Try loading an unversioned library.
		 */
		foreach (const String &path, directories)
		{
			Directory		 directory(path);
			const Array<File>	&files = directory.GetFilesByPattern(String(module.StartsWith("lib") || module.Contains("/") ? String() : "lib").Append(module).Append(module.EndsWith(dllExt) || module.Contains(String(dllExt).Append(".")) ? String() : dllExt));

			if (files.Length() > 0)
			{
				handle = dlopen((String) files.GetFirst(), dlopenFlags);
			}

			if (handle != NIL) return;
		}

		/* Try loading a versioned library.
		 */
		foreach (const String &path, directories)
		{
			Directory		 directory(path);
			const Array<File>	&files = directory.GetFilesByPattern(String(module.StartsWith("lib") || module.Contains("/") ? String() : "lib").Append(module).Append(module.EndsWith(dllExt) || module.Contains(String(dllExt).Append(".")) ? String() : versionPattern));

			if (files.Length() > 0)
			{
				handle = dlopen((String) files.GetFirst(), dlopenFlags);
			}

			if (handle != NIL) return;
		}
	}
#endif
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
movq %rsi, %r14
movq %rdi, %rbx
callq 0x56e70
movq 0xbbc79(%rip), %rax     # 0x16b7b0
addq $0x10, %rax
movq %rax, (%rbx)
movq %rbx, (%rsp)
movq $0x0, 0x38(%rbx)
movb 0xc63d0(%rip), %al      # 0x175f20
testb %al, %al
movq %r14, 0x20(%rsp)
je 0xb0249
movb 0xc63dd(%rip), %al      # 0x175f40
testb %al, %al
je 0xb02a0
leaq 0x43b78(%rip), %rsi     # 0xf36ea
leaq 0x148(%rsp), %rdi
callq 0x579f0
leaq 0x148(%rsp), %rsi
movq %r14, %rdi
callq 0x577d0
movl %eax, %ebx
leaq 0x148(%rsp), %rdi
callq 0x59200
testb %bl, %bl
jne 0xafcaa
leaq 0x148(%rsp), %rdi
callq 0x57a50
leaq 0x148(%rsp), %rdi
movq %r14, %rsi
callq 0x562f0
movq %rax, %r15
leaq 0xc633b(%rip), %rsi     # 0x175f08
movq %r14, %rdi
callq 0x58b10
movl %eax, %ebx
testb %al, %al
jne 0xafc27
leaq 0xc6326(%rip), %rsi     # 0x175f08
leaq 0xe8(%rsp), %rdi
callq 0x570b0
leaq 0x79a8d(%rip), %rsi     # 0x129683
leaq 0xd0(%rsp), %rdi
callq 0x579f0
leaq 0xe8(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0x562f0
movq %r14, %rdi
movq %rax, %rsi
callq 0x55180
testb %al, %al
je 0xafc38
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
callq 0x58e20
xorb $0x1, %bl
jmp 0xafc4b
movb $0x1, %bl
leaq 0xc62c7(%rip), %rsi     # 0x175f08
leaq 0x8(%rsp), %rdi
callq 0x570b0
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x562f0
movq %rax, %rdi
callq 0x585e0
movq %rax, %rdi
movl $0x2, %esi
callq 0x57cf0
movq (%rsp), %rcx
movq %rax, 0x38(%rcx)
leaq 0x8(%rsp), %rdi
callq 0x59200
testb %bl, %bl
je 0xafc9d
leaq 0xd0(%rsp), %rdi
callq 0x59200
leaq 0xe8(%rsp), %rdi
callq 0x59200
leaq 0x148(%rsp), %rdi
callq 0x59200
movq (%rsp), %rax
cmpq $0x0, 0x38(%rax)
jne 0xafdbd
leaq 0x148(%rsp), %rdi
movq %r14, %rsi
callq 0x570b0
leaq 0xc6238(%rip), %rsi     # 0x175f08
movq %r14, %rdi
callq 0x58b10
movl %eax, %ebx
testb %al, %al
jne 0xafd2a
leaq 0xc6223(%rip), %rsi     # 0x175f08
leaq 0xb8(%rsp), %rdi
callq 0x570b0
leaq 0x7998a(%rip), %rsi     # 0x129683
leaq 0xa0(%rsp), %rdi
callq 0x579f0
leaq 0xb8(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x562f0
movq %r14, %rdi
movq %rax, %rsi
callq 0x55180
testb %al, %al
je 0xafd3b
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
callq 0x58e20
xorb $0x1, %bl
jmp 0xafd4e
movb $0x1, %bl
leaq 0xc61c4(%rip), %rsi     # 0x175f08
leaq 0x8(%rsp), %rdi
callq 0x570b0
leaq 0x148(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x562f0
movq %rax, %rdi
callq 0x585e0
movq %rax, %rdi
movl $0x2, %esi
callq 0x57cf0
movq (%rsp), %rcx
movq %rax, 0x38(%rcx)
leaq 0x8(%rsp), %rdi
callq 0x59200
testb %bl, %bl
je 0xafda5
leaq 0xa0(%rsp), %rdi
callq 0x59200
leaq 0xb8(%rsp), %rdi
callq 0x59200
leaq 0x148(%rsp), %rdi
callq 0x59200
movq (%rsp), %rax
cmpq $0x0, 0x38(%rax)
je 0xafdcf
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rsp), %rdi
callq 0x55680
cmpl $0x0, 0xc6171(%rip)     # 0x175f50
jle 0xafdbd
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
leaq 0x58(%rsp), %r15
incl %ebp
leaq 0xc6154(%rip), %rdi     # 0x175f48
movl %ebp, %esi
callq 0x64250
movq %rax, %rbx
leaq 0x8(%rsp), %r12
movq %r12, %rdi
xorl %esi, %esi
callq 0x58e20
leaq 0x148(%rsp), %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x58c60
movq %r12, %rdi
callq 0x59200
movq %r15, %rdi
leaq 0x626d6(%rip), %rsi     # 0x112508
callq 0x579f0
movq %r14, %rdi
movq %r15, %r14
movq %r15, %rsi
callq 0x577d0
movl %eax, %r13d
testb %al, %al
jne 0xafe74
leaq 0x130(%rsp), %rbx
movq %rbx, %rdi
leaq 0x4388c(%rip), %rsi     # 0xf36ea
callq 0x579f0
movq 0x20(%rsp), %rdi
movq %rbx, %rsi
callq 0x55180
testb %al, %al
je 0xafe86
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
callq 0x58e20
xorb $0x1, %r13b
jmp 0xafe9a
movb $0x1, %r13b
leaq 0x8(%rsp), %rdi
leaq 0x62673(%rip), %rsi     # 0x112508
callq 0x579f0
leaq 0x8(%rsp), %rdi
movq 0x20(%rsp), %r15
movq %r15, %rsi
callq 0x562f0
movq %rax, %rbx
movq %r15, %rdi
leaq 0xc604f(%rip), %rsi     # 0x175f08
callq 0x58b10
movl %eax, %r15d
testb %al, %al
jne 0xaff11
leaq 0x88(%rsp), %rdi
leaq 0xc6034(%rip), %rsi     # 0x175f08
callq 0x570b0
leaq 0x118(%rsp), %r12
movq %r12, %rdi
leaq 0x79798(%rip), %rsi     # 0x129683
callq 0x579f0
leaq 0x88(%rsp), %rdi
movq %r12, %rsi
callq 0x562f0
movq 0x20(%rsp), %rdi
movq %rax, %rsi
callq 0x55180
testb %al, %al
je 0xaff23
leaq 0x28(%rsp), %rdi
xorl %esi, %esi
callq 0x58e20
xorb $0x1, %r15b
jmp 0xaff37
movb $0x1, %r15b
leaq 0x28(%rsp), %rdi
leaq 0xc5fd6(%rip), %rsi     # 0x175f08
callq 0x570b0
movq %rbx, %rdi
leaq 0x28(%rsp), %rsi
callq 0x562f0
leaq 0x148(%rsp), %rdi
movq %rax, %rsi
callq 0x56d30
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x59200
testb %r15b, %r15b
je 0xaff80
leaq 0x118(%rsp), %rdi
callq 0x59200
leaq 0x88(%rsp), %rdi
callq 0x59200
leaq 0x8(%rsp), %rdi
callq 0x59200
testb %r13b, %r13b
je 0xaff9c
leaq 0x130(%rsp), %rdi
callq 0x59200
movq %r14, %r15
movq %r14, %rdi
callq 0x59200
cmpl $0x0, 0x8(%rbx)
movq 0x20(%rsp), %r14
jle 0xaffef
movq %rbx, %rdi
callq 0xb0e5a
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x58fa0
movq %rbx, %rdi
callq 0x585e0
movq %rax, %rdi
movl $0x2, %esi
callq 0x57cf0
movq (%rsp), %rcx
movq %rax, 0x38(%rcx)
movq %rbx, %rdi
callq 0x59200
movq (%rsp), %rax
movq 0x38(%rax), %rbx
leaq 0x148(%rsp), %rdi
callq 0x59210
testq %rbx, %rbx
jne 0xafdbd
movl 0xc5f3d(%rip), %eax     # 0x175f50
leal -0x1(%rax), %ecx
cmpl %ecx, %ebp
jl 0xafdeb
testl %eax, %eax
jle 0xafdbd
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
leaq 0x58(%rsp), %r15
incl %ebp
leaq 0xc5f0f(%rip), %rdi     # 0x175f48
movl %ebp, %esi
callq 0x64250
movq %rax, %rbx
leaq 0x8(%rsp), %r12
movq %r12, %rdi
xorl %esi, %esi
callq 0x58e20
leaq 0x148(%rsp), %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x58c60
movq %r12, %rdi
callq 0x59200
movq %r15, %rdi
leaq 0x62491(%rip), %rsi     # 0x112508
callq 0x579f0
movq %r14, %rdi
movq %r15, %rsi
callq 0x577d0
movl %eax, %r13d
testb %al, %al
jne 0xb00b1
leaq 0x28(%rsp), %rbx
movq %rbx, %rdi
leaq 0x4364d(%rip), %rsi     # 0xf36ea
callq 0x579f0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x55180
testb %al, %al
je 0xb00c3
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
callq 0x58e20
xorb $0x1, %r13b
jmp 0xb00d7
movb $0x1, %r13b
leaq 0x8(%rsp), %rdi
leaq 0x62436(%rip), %rsi     # 0x112508
callq 0x579f0
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x562f0
movq %rax, %rbx
movq %r14, %rdi
leaq 0xc5e17(%rip), %rsi     # 0x175f08
callq 0x58b10
movl %eax, %r15d
testb %al, %al
jne 0xb0141
leaq 0x70(%rsp), %rdi
leaq 0xc5dff(%rip), %rsi     # 0x175f08
callq 0x570b0
leaq 0x100(%rsp), %r12
movq %r12, %rdi
leaq 0x79563(%rip), %rsi     # 0x129683
callq 0x579f0
leaq 0x70(%rsp), %rdi
movq %r12, %rsi
callq 0x562f0
movq %r14, %rdi
movq %rax, %rsi
callq 0x55180
testb %al, %al
je 0xb0153
leaq 0x40(%rsp), %rdi
xorl %esi, %esi
callq 0x58e20
xorb $0x1, %r15b
jmp 0xb0167
movb $0x1, %r15b
leaq 0x40(%rsp), %rdi
leaq 0xc5dc6(%rip), %rsi     # 0x175f28
callq 0x570b0
movq %rbx, %rdi
leaq 0x40(%rsp), %rsi
callq 0x562f0
leaq 0x148(%rsp), %rdi
movq %rax, %rsi
callq 0x56d30
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x59200
testb %r15b, %r15b
je 0xb01ad
leaq 0x100(%rsp), %rdi
callq 0x59200
leaq 0x70(%rsp), %rdi
callq 0x59200
leaq 0x8(%rsp), %rdi
callq 0x59200
testb %r13b, %r13b
je 0xb01c6
leaq 0x28(%rsp), %rdi
callq 0x59200
leaq 0x58(%rsp), %r15
movq %r15, %rdi
callq 0x59200
cmpl $0x0, 0x8(%rbx)
jle 0xb0216
movq %rbx, %rdi
callq 0xb0e5a
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x58fa0
movq %rbx, %rdi
callq 0x585e0
movq %rax, %rdi
movl $0x2, %esi
callq 0x57cf0
movq (%rsp), %rcx
movq %rax, 0x38(%rcx)
movq %rbx, %rdi
callq 0x59200
movq (%rsp), %rax
movq 0x38(%rax), %rbx
leaq 0x148(%rsp), %rdi
callq 0x59210
testq %rbx, %rbx
jne 0xafdbd
movl 0xc5d16(%rip), %eax     # 0x175f50
decl %eax
cmpl %eax, %ebp
jl 0xb0030
jmp 0xafdbd
leaq 0xc5cd0(%rip), %rdi     # 0x175f20
callq 0x56120
testl %eax, %eax
je 0xafb5d
leaq 0xc5ca4(%rip), %rdi     # 0x175f08
leaq 0x6337e(%rip), %rsi     # 0x1135e9
callq 0x579f0
movq 0xbbcb9(%rip), %rdi     # 0x16bf30
leaq 0xc5c8a(%rip), %rsi     # 0x175f08
leaq 0xbddfb(%rip), %rdx     # 0x16e080
callq 0x57e10
leaq 0xc5c8f(%rip), %rdi     # 0x175f20
callq 0x56b80
movq 0x20(%rsp), %r14
jmp 0xafb5d
leaq 0xc5c99(%rip), %rdi     # 0x175f40
callq 0x56120
testl %eax, %eax
je 0xafb6b
leaq 0xc5c4d(%rip), %rsi     # 0x175f08
leaq 0x148(%rsp), %rdi
callq 0x570b0
leaq 0x62222(%rip), %rsi     # 0x1124f1
leaq 0x8(%rsp), %rdi
callq 0x579f0
leaq 0x148(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x562f0
leaq 0xc5c36(%rip), %rdi     # 0x175f28
movq %rax, %rsi
callq 0x570b0
leaq 0x8(%rsp), %rdi
callq 0x59200
movq 0xbbc25(%rip), %rbx     # 0x16bf30
leaq 0x148(%rsp), %rdi
callq 0x59200
leaq 0xc5c09(%rip), %rsi     # 0x175f28
leaq 0xbdd5a(%rip), %rdx     # 0x16e080
movq %rbx, %rdi
callq 0x57e10
leaq 0xc5c0b(%rip), %rdi     # 0x175f40
callq 0x56b80
movq 0x20(%rsp), %r14
jmp 0xafb6b
movq %rax, %r14
jmp 0xb0367
movq %rax, %r14
jmp 0xb0374
movq %rax, %r14
leaq 0xc5bc8(%rip), %rdi     # 0x175f20
jmp 0xb037b
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x59200
leaq 0x148(%rsp), %rdi
callq 0x59200
leaq 0xc5bc5(%rip), %rdi     # 0x175f40
callq 0x56420
jmp 0xb05d1
jmp 0xb0559
movq %rax, %r14
jmp 0xb048c
jmp 0xb0516
movq %rax, %r14
jmp 0xb04b5
jmp 0xb0425
jmp 0xb0563
movq %rax, %r14
jmp 0xb0507
jmp 0xb0516
jmp 0xb04dc
movq %rax, %r14
testb %bl, %bl
je 0xb047f
jmp 0xb0519
movq %rax, %r14
jmp 0xb04d2
movq %rax, %r14
testb %r13b, %r13b
je 0xb04d2
jmp 0xb05ba
movq %rax, %r14
testb %r15b, %r15b
je 0xb04a8
jmp 0xb04bf
jmp 0xb0516
movq %rax, %r14
testb %bl, %bl
je 0xb04fa
jmp 0xb0519
jmp 0xb0559
jmp 0xb0544
jmp 0xb0559
jmp 0xb0425
jmp 0xb0568
jmp 0xb0559
movq %rax, %r14
jmp 0xb04bf
jmp 0xb0563
movq %rax, %r14
jmp 0xb047f
jmp 0xb0516
jmp 0xb0516
jmp 0xb0559
jmp 0xb0568
movq %rax, %r14
jmp 0xb04a8
movq %rax, %r14
jmp 0xb04fa
movq %rax, %r14
jmp 0xb0591
jmp 0xb055e
jmp 0xb0563
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x59200
testb %bl, %bl
je 0xb0519
leaq 0xa0(%rsp), %rdi
callq 0x59200
leaq 0xb8(%rsp), %rdi
jmp 0xb050f
movq %rax, %r14
leaq 0x40(%rsp), %rdi
callq 0x59200
testb %r15b, %r15b
je 0xb04bf
leaq 0x100(%rsp), %rdi
callq 0x59200
leaq 0x70(%rsp), %rdi
callq 0x59200
leaq 0x8(%rsp), %rdi
callq 0x59200
testb %r13b, %r13b
je 0xb05ba
leaq 0x28(%rsp), %rdi
jmp 0xb05b5
movq %rax, %r14
leaq 0x8(%rsp), %rdi
jmp 0xb05bf
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x59200
testb %bl, %bl
je 0xb0519
leaq 0xd0(%rsp), %rdi
callq 0x59200
leaq 0xe8(%rsp), %rdi
callq 0x59200
jmp 0xb0519
movq %rax, %r14
leaq 0x148(%rsp), %rdi
jmp 0xb054c
jmp 0xb0559
movq %rax, %r14
jmp 0xb05ad
movq %rax, %r14
testb %r13b, %r13b
je 0xb05ad
jmp 0xb05ba
movq %rax, %r14
testb %r15b, %r15b
je 0xb0584
jmp 0xb059e
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x59200
jmp 0xb05d1
jmp 0xb0559
jmp 0xb055e
jmp 0xb0568
movq %rax, %r14
jmp 0xb05d1
movq %rax, %r14
jmp 0xb059e
movq %rax, %r14
jmp 0xb05ba
movq %rax, %r14
jmp 0xb05c4
movq %rax, %r14
jmp 0xb0584
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x59200
testb %r15b, %r15b
je 0xb059e
leaq 0x118(%rsp), %rdi
callq 0x59200
leaq 0x88(%rsp), %rdi
callq 0x59200
leaq 0x8(%rsp), %rdi
callq 0x59200
testb %r13b, %r13b
je 0xb05ba
leaq 0x130(%rsp), %rdi
callq 0x59200
leaq 0x58(%rsp), %rdi
callq 0x59200
leaq 0x148(%rsp), %rdi
callq 0x59210
movq (%rsp), %rdi
callq 0x55c60
movq %r14, %rdi
callq 0x57090