// File: /workspace/github_c_makefile_star2_O1/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, %r15
movq %rdi, %r14
callq 0x56e70
movq 0xbbeb9(%rip), %rax     # 0x16c7b0
addq $0x10, %rax
movq %rax, (%r14)
movq $0x0, 0x38(%r14)
movb 0xc6614(%rip), %al      # 0x176f20
testb %al, %al
movq %r15, 0x18(%rsp)
movq %r14, 0x20(%rsp)
je 0xb101a
movb 0xc661c(%rip), %al      # 0x176f40
testb %al, %al
je 0xb1076
leaq 0x43d55(%rip), %rsi     # 0xf4688
leaq 0x148(%rsp), %rdi
callq 0x579f0
leaq 0x148(%rsp), %rsi
movq %r15, %rdi
callq 0x577d0
movl %eax, %ebx
leaq 0x148(%rsp), %rdi
callq 0x59200
testb %bl, %bl
jne 0xb0a6f
leaq 0x148(%rsp), %rdi
callq 0x57a50
leaq 0x148(%rsp), %rdi
movq %r15, %rsi
callq 0x562f0
movq %rax, %rbx
leaq 0xc657a(%rip), %rsi     # 0x176f08
movq %r15, %rdi
callq 0x58b10
movl %eax, %ebp
testb %al, %al
jne 0xb09ed
leaq 0xc6565(%rip), %rsi     # 0x176f08
leaq 0xe8(%rsp), %rdi
callq 0x570b0
leaq 0x79aac(%rip), %rsi     # 0x12a463
leaq 0xd0(%rsp), %rdi
callq 0x579f0
movb $0x1, %r15b
leaq 0xe8(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0x562f0
movq 0x18(%rsp), %rdi
movq %rax, %rsi
callq 0x55180
testb %al, %al
je 0xb0a00
xorb $0x1, %bpl
movq %rsp, %rdi
movl %ebp, %r15d
xorl %esi, %esi
callq 0x58e20
jmp 0xb0a12
movb $0x1, %r15b
leaq 0xc64fe(%rip), %rsi     # 0x176f08
movq %rsp, %rdi
callq 0x570b0
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x562f0
movq %rax, %rdi
callq 0x585e0
movq %rax, %rdi
movl $0x2, %esi
callq 0x57cf0
movq %rax, 0x38(%r14)
movq %rsp, %rdi
callq 0x59200
testb %r15b, %r15b
je 0xb0a5d
leaq 0xd0(%rsp), %rdi
callq 0x59200
leaq 0xe8(%rsp), %rdi
callq 0x59200
leaq 0x148(%rsp), %rdi
callq 0x59200
movq 0x18(%rsp), %r15
cmpq $0x0, 0x38(%r14)
jne 0xb0b6e
leaq 0x148(%rsp), %rdi
movq %r15, %rsi
callq 0x570b0
leaq 0xc6477(%rip), %rsi     # 0x176f08
movq %r15, %rdi
callq 0x58b10
movl %eax, %ebx
testb %al, %al
jne 0xb0aee
leaq 0xc6462(%rip), %rsi     # 0x176f08
leaq 0xb8(%rsp), %rdi
callq 0x570b0
leaq 0x799a9(%rip), %rsi     # 0x12a463
leaq 0xa0(%rsp), %rdi
callq 0x579f0
movb $0x1, %bpl
leaq 0xb8(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x562f0
movq %r15, %rdi
movq %rax, %rsi
callq 0x55180
testb %al, %al
je 0xb0aff
xorb $0x1, %bl
movq %rsp, %rdi
movl %ebx, %ebp
xorl %esi, %esi
callq 0x58e20
jmp 0xb0b11
movb $0x1, %bpl
leaq 0xc63ff(%rip), %rsi     # 0x176f08
movq %rsp, %rdi
callq 0x570b0
leaq 0x148(%rsp), %rdi
movq %rsp, %rsi
callq 0x562f0
movq %rax, %rdi
callq 0x585e0
movq %rax, %rdi
movl $0x2, %esi
callq 0x57cf0
movq %rax, 0x38(%r14)
movq %rsp, %rdi
callq 0x59200
testb %bpl, %bpl
je 0xb0b61
leaq 0xa0(%rsp), %rdi
callq 0x59200
leaq 0xb8(%rsp), %rdi
callq 0x59200
leaq 0x148(%rsp), %rdi
callq 0x59200
cmpq $0x0, 0x38(%r14)
je 0xb0b87
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x20(%rsp), %rdi
callq 0x55680
cmpl $0x0, 0xc63b8(%rip)     # 0x176f50
jle 0xb0ddb
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
leaq 0x58(%rsp), %r14
incl %ebp
leaq 0xc6397(%rip), %rdi     # 0x176f48
movl %ebp, %esi
callq 0x64224
movq %rax, %rbx
movq %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 %r14, %rdi
leaq 0x6276b(%rip), %rsi     # 0x113358
callq 0x579f0
movq %r15, %rdi
movq %r14, %r12
movq %r14, %rsi
callq 0x577d0
movl %eax, %r13d
testb %al, %al
jne 0xb0c30
leaq 0x130(%rsp), %rbx
movq %rbx, %rdi
leaq 0x43a6f(%rip), %rsi     # 0xf4688
callq 0x579f0
movb $0x1, %r14b
movq %r15, %rdi
movq %rbx, %rsi
callq 0x55180
testb %al, %al
je 0xb0c43
xorb $0x1, %r13b
movl %r13d, %r14d
movq %rsp, %rdi
xorl %esi, %esi
callq 0x58e20
jmp 0xb0c58
movb $0x1, %r14b
movq %rsp, %rdi
leaq 0x62708(%rip), %rsi     # 0x113358
callq 0x579f0
movb $0x1, %r13b
movq %rsp, %rdi
movq %r15, %rsi
callq 0x562f0
movq %rax, %rbx
movq %r15, %rdi
leaq 0xc6298(%rip), %rsi     # 0x176f08
callq 0x58b10
movl %eax, %r15d
testb %al, %al
jne 0xb0ccb
leaq 0x88(%rsp), %rdi
leaq 0xc627d(%rip), %rsi     # 0x176f08
callq 0x570b0
leaq 0x118(%rsp), %r14
movq %r14, %rdi
leaq 0x797c1(%rip), %rsi     # 0x12a463
callq 0x579f0
movq %r14, %rsi
movb $0x1, %r14b
leaq 0x88(%rsp), %rdi
callq 0x562f0
movq 0x18(%rsp), %rdi
movq %rax, %rsi
callq 0x55180
testb %al, %al
je 0xb0ce0
xorb $0x1, %r15b
movl %r15d, %r14d
leaq 0x28(%rsp), %rdi
xorl %esi, %esi
callq 0x58e20
jmp 0xb0cf7
movb $0x1, %r14b
leaq 0x28(%rsp), %rdi
leaq 0xc6219(%rip), %rsi     # 0x176f08
callq 0x570b0
movb $0x1, %r15b
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
leaq 0x118(%rsp), %rdi
je 0xb0d40
callq 0x59200
leaq 0x88(%rsp), %rdi
callq 0x59200
movq %rsp, %rdi
callq 0x59200
testb %r13b, %r13b
movq 0x18(%rsp), %r15
je 0xb0d5f
leaq 0x130(%rsp), %rdi
callq 0x59200
movq %r12, %r14
movq %r12, %rdi
callq 0x59200
cmpl $0x0, 0x8(%rbx)
jle 0xb0dac
movq %rbx, %rdi
callq 0xb1c3a
movq %rsp, %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x58fa0
movq %rbx, %rdi
callq 0x585e0
movq %rax, %rdi
movl $0x2, %esi
callq 0x57cf0
movq 0x20(%rsp), %rcx
movq %rax, 0x38(%rcx)
movq %rbx, %rdi
callq 0x59200
movq 0x20(%rsp), %rax
movq 0x38(%rax), %rbx
leaq 0x148(%rsp), %rdi
callq 0x59210
testq %rbx, %rbx
jne 0xb0b75
movl 0xc617f(%rip), %eax     # 0x176f50
decl %eax
cmpl %eax, %ebp
jl 0xb0ba8
cmpl $0x0, 0xc616e(%rip)     # 0x176f50
jle 0xb0b75
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
leaq 0x58(%rsp), %r14
incl %ebp
leaq 0xc614d(%rip), %rdi     # 0x176f48
movl %ebp, %esi
callq 0x64224
movq %rax, %rbx
movq %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 %r14, %rdi
leaq 0x62521(%rip), %rsi     # 0x113358
callq 0x579f0
movq %r15, %rdi
movq %r14, %rsi
callq 0x577d0
movl %eax, %r13d
testb %al, %al
jne 0xb0e74
leaq 0x28(%rsp), %rbx
movq %rbx, %rdi
leaq 0x4382b(%rip), %rsi     # 0xf4688
callq 0x579f0
movb $0x1, %r14b
movq %r15, %rdi
movq %rbx, %rsi
callq 0x55180
testb %al, %al
je 0xb0e87
xorb $0x1, %r13b
movl %r13d, %r14d
movq %rsp, %rdi
xorl %esi, %esi
callq 0x58e20
jmp 0xb0e9c
movb $0x1, %r14b
movq %rsp, %rdi
leaq 0x624c4(%rip), %rsi     # 0x113358
callq 0x579f0
movb $0x1, %r13b
movq %rsp, %rdi
movq %r15, %rsi
callq 0x562f0
movq %rax, %rbx
movq %r15, %rdi
leaq 0xc6054(%rip), %rsi     # 0x176f08
callq 0x58b10
movl %eax, %r14d
testb %al, %al
jne 0xb0f09
leaq 0x70(%rsp), %rdi
leaq 0xc603c(%rip), %rsi     # 0x176f08
callq 0x570b0
leaq 0x100(%rsp), %r12
movq %r12, %rdi
leaq 0x79580(%rip), %rsi     # 0x12a463
callq 0x579f0
movb $0x1, %r15b
leaq 0x70(%rsp), %rdi
movq %r12, %rsi
callq 0x562f0
movq 0x18(%rsp), %rdi
movq %rax, %rsi
callq 0x55180
testb %al, %al
je 0xb0f1e
xorb $0x1, %r14b
movl %r14d, %r15d
leaq 0x40(%rsp), %rdi
xorl %esi, %esi
callq 0x58e20
jmp 0xb0f35
movb $0x1, %r15b
leaq 0x40(%rsp), %rdi
leaq 0xc5ffb(%rip), %rsi     # 0x176f28
callq 0x570b0
movb $0x1, %r14b
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 %r14b, %r14b
movq 0x18(%rsp), %r15
je 0xb0f80
leaq 0x100(%rsp), %rdi
callq 0x59200
leaq 0x70(%rsp), %rdi
callq 0x59200
movq %rsp, %rdi
callq 0x59200
testb %r13b, %r13b
leaq 0x58(%rsp), %r14
je 0xb0f9c
leaq 0x28(%rsp), %rdi
callq 0x59200
movq %r14, %rdi
callq 0x59200
cmpl $0x0, 0x8(%rbx)
jle 0xb0fe6
movq %rbx, %rdi
callq 0xb1c3a
movq %rsp, %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x58fa0
movq %rbx, %rdi
callq 0x585e0
movq %rax, %rdi
movl $0x2, %esi
callq 0x57cf0
movq 0x20(%rsp), %rcx
movq %rax, 0x38(%rcx)
movq %rbx, %rdi
callq 0x59200
movq 0x20(%rsp), %rax
movq 0x38(%rax), %rbx
leaq 0x148(%rsp), %rdi
callq 0x59210
testq %rbx, %rbx
jne 0xb0b75
movl 0xc5f45(%rip), %eax     # 0x176f50
decl %eax
cmpl %eax, %ebp
jl 0xb0df2
jmp 0xb0b75
leaq 0xc5eff(%rip), %rdi     # 0x176f20
callq 0x56120
testl %eax, %eax
je 0xb091e
leaq 0xc5ed3(%rip), %rdi     # 0x176f08
leaq 0x633a1(%rip), %rsi     # 0x1143dd
callq 0x579f0
movq 0xbbee8(%rip), %rdi     # 0x16cf30
leaq 0xc5eb9(%rip), %rsi     # 0x176f08
leaq 0xbe02a(%rip), %rdx     # 0x16f080
callq 0x57e10
leaq 0xc5ebe(%rip), %rdi     # 0x176f20
callq 0x56b80
movq 0x20(%rsp), %r14
movq 0x18(%rsp), %r15
jmp 0xb091e
leaq 0xc5ec3(%rip), %rdi     # 0x176f40
callq 0x56120
testl %eax, %eax
je 0xb092c
leaq 0xc5e77(%rip), %rsi     # 0x176f08
leaq 0x148(%rsp), %rdi
callq 0x570b0
leaq 0x6229c(%rip), %rsi     # 0x113341
movq %rsp, %rdi
callq 0x579f0
leaq 0x148(%rsp), %rdi
movq %rsp, %rsi
callq 0x562f0
leaq 0xc5e64(%rip), %rdi     # 0x176f28
movq %rax, %rsi
callq 0x570b0
movq %rsp, %rdi
callq 0x59200
movq 0xbbe55(%rip), %rbx     # 0x16cf30
leaq 0x148(%rsp), %rdi
callq 0x59200
leaq 0xc5e39(%rip), %rsi     # 0x176f28
leaq 0xbdf8a(%rip), %rdx     # 0x16f080
movq %rbx, %rdi
callq 0x57e10
leaq 0xc5e3b(%rip), %rdi     # 0x176f40
callq 0x56b80
movq 0x20(%rsp), %r14
movq 0x18(%rsp), %r15
jmp 0xb092c
movq %rax, %rbx
jmp 0xb113a
movq %rax, %rbx
jmp 0xb1147
movq %rax, %rbx
leaq 0xc5df3(%rip), %rdi     # 0x176f20
jmp 0xb114e
movq %rax, %rbx
movq %rsp, %rdi
callq 0x59200
leaq 0x148(%rsp), %rdi
callq 0x59200
leaq 0xc5df2(%rip), %rdi     # 0x176f40
callq 0x56420
jmp 0xb1370
movq %rax, %rbx
movb $0x1, %bpl
jmp 0xb11b5
movq %rax, %rbx
movb $0x1, %bpl
jmp 0xb11c7
movq %rax, %rbx
movb $0x1, %r15b
jmp 0xb11ee
movq %rax, %rbx
movb $0x1, %r15b
jmp 0xb1200
jmp 0xb1283
jmp 0xb1205
jmp 0xb1283
jmp 0xb1205
jmp 0xb1205
jmp 0xb1283
movq %rax, %rbx
movq %rsp, %rdi
callq 0x59200
jmp 0xb11a3
movq %rax, %rbx
testb %bpl, %bpl
je 0xb11b5
leaq 0xa0(%rsp), %rdi
callq 0x59200
testb %bpl, %bpl
je 0xb11c7
leaq 0xb8(%rsp), %rdi
callq 0x59200
testb %bpl, %bpl
jmp 0xb1208
movq %rax, %rbx
movq %rsp, %rdi
callq 0x59200
jmp 0xb11dc
movq %rax, %rbx
testb %r15b, %r15b
je 0xb11ee
leaq 0xd0(%rsp), %rdi
callq 0x59200
testb %r15b, %r15b
je 0xb1200
leaq 0xe8(%rsp), %rdi
callq 0x59200
testb %r15b, %r15b
jmp 0xb1208
movq %rax, %rbx
leaq 0x148(%rsp), %rdi
jmp 0xb1273
jmp 0xb1283
movq %rax, %rbx
movb $0x1, %r14b
jmp 0xb12d2
movq %rax, %rbx
movb $0x1, %r14b
jmp 0xb12e1
jmp 0xb1244
jmp 0xb124f
movq %rax, %rbx
movb $0x1, %r15b
jmp 0xb1327
movq %rax, %rbx
movb $0x1, %r15b
jmp 0xb1339
movq %rax, %rbx
movb $0x1, %r13b
jmp 0xb1356
movq %rax, %rbx
movq %rsp, %rdi
jmp 0xb135e
jmp 0xb126d
jmp 0xb1283
jmp 0xb1264
jmp 0xb12a3
jmp 0xb1283
movq %rax, %rbx
jmp 0xb12e4
jmp 0xb1293
jmp 0xb12a3
movq %rax, %rbx
movq %rsp, %rdi
callq 0x59200
jmp 0xb1370
jmp 0xb1283
jmp 0xb128b
jmp 0xb12a3
movq %rax, %rbx
jmp 0xb1370
movq %rax, %rbx
jmp 0xb133c
movq %rax, %rbx
jmp 0xb1359
movq %rax, %rbx
movl %r14d, %r13d
jmp 0xb12ec
movq %rax, %rbx
jmp 0xb1363
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x59200
jmp 0xb12c0
movq %rax, %rbx
movl %r15d, %r14d
testb %r14b, %r14b
je 0xb12d2
leaq 0x100(%rsp), %rdi
callq 0x59200
testb %r14b, %r14b
je 0xb12e1
leaq 0x70(%rsp), %rdi
callq 0x59200
testb %r14b, %r14b
movq %rsp, %rdi
callq 0x59200
testb %r13b, %r13b
je 0xb1356
leaq 0x28(%rsp), %rdi
jmp 0xb1351
movq %rax, %rbx
movl %r14d, %r13d
jmp 0xb1344
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x59200
jmp 0xb1315
movq %rax, %rbx
movl %r14d, %r15d
testb %r15b, %r15b
je 0xb1327
leaq 0x118(%rsp), %rdi
callq 0x59200
testb %r15b, %r15b
je 0xb1339
leaq 0x88(%rsp), %rdi
callq 0x59200
testb %r15b, %r15b
movq %rsp, %rdi
callq 0x59200
testb %r13b, %r13b
je 0xb1356
leaq 0x130(%rsp), %rdi
callq 0x59200
testb %r13b, %r13b
leaq 0x58(%rsp), %rdi
callq 0x59200
leaq 0x148(%rsp), %rdi
callq 0x59210
movq 0x20(%rsp), %rdi
callq 0x55c60
movq %rbx, %rdi
callq 0x57090