// File: /workspace/github_c_makefile_star2_O2/enzo1982[P]smooth/classes/system/system.cpp
// Function: smooth::System::System::GetResourcesDirectory()
S::String S::System::System::GetResourcesDirectory()
{
	static String	 resourcesDir;

	if (resourcesDir != NIL) return resourcesDir;

	resourcesDir = GUI::Application::GetApplicationDirectory();

#if !defined __WIN32__
	resourcesDir[resourcesDir.Length() - 1]					    = 0;
	resourcesDir[resourcesDir.FindLast(Directory::GetDirectoryDelimiter()) + 1] = 0;

#if defined __HAIKU__
	resourcesDir.Append("data");
#else
	resourcesDir.Append("share");
#endif

	if (!Directory(resourcesDir).Exists()) resourcesDir = GUI::Application::GetApplicationDirectory();
#endif

	if (!resourcesDir.EndsWith(Directory::GetDirectoryDelimiter())) resourcesDir.Append(Directory::GetDirectoryDelimiter());
	if ( resourcesDir == Directory::GetDirectoryDelimiter())	resourcesDir = NIL;

	return resourcesDir;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xf8, %rsp
movq %rdi, %rbx
movb 0xbf036(%rip), %al      # 0x16c310
testb %al, %al
je 0xad4b8
leaq 0xbf00f(%rip), %rdi     # 0x16c2f8
xorl %esi, %esi
callq 0x57d40
testb %al, %al
jne 0xad498
leaq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0x58cb0
leaq 0xbefec(%rip), %rdi     # 0x16c2f8
movq %r14, %rsi
callq 0x56630
leaq 0x18(%rsp), %rdi
callq 0x5a588
leaq 0xbefd3(%rip), %r14     # 0x16c2f8
movq %r14, %rdi
callq 0x58370
leal -0x1(%rax), %esi
movq %r14, %rdi
callq 0x59cc0
andl $0x0, (%rax)
callq 0x563a0
leaq 0x18(%rsp), %r15
movq %r15, %rdi
movq %rax, %rsi
callq 0x58c40
movq %r14, %rdi
movq %r15, %rsi
callq 0x59d50
incl %eax
leaq 0xbef94(%rip), %rdi     # 0x16c2f8
movl %eax, %esi
callq 0x59cc0
andl $0x0, (%rax)
leaq 0x18(%rsp), %rdi
callq 0x5a588
leaq 0x55466(%rip), %rsi     # 0x1027e5
leaq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0x58c40
leaq 0xbef65(%rip), %rdi     # 0x16c2f8
movq %r14, %rsi
callq 0x573e0
leaq 0x18(%rsp), %rdi
callq 0x5a588
movq %rsp, %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x5a180
leaq 0xbef3f(%rip), %rsi     # 0x16c2f8
leaq 0x18(%rsp), %rdi
movq %r14, %rdx
callq 0x59fb0
leaq 0x18(%rsp), %rdi
callq 0x56480
movl %eax, %ebp
leaq 0x18(%rsp), %rdi
callq 0x5a598
movq %rsp, %rdi
callq 0x5a588
testb %bpl, %bpl
jne 0xad40f
leaq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0x58cb0
leaq 0xbeefb(%rip), %rdi     # 0x16c2f8
movq %r14, %rsi
callq 0x56630
leaq 0x18(%rsp), %rdi
callq 0x5a588
callq 0x563a0
leaq 0x18(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x58c40
leaq 0xbeecd(%rip), %rdi     # 0x16c2f8
movq %r14, %rsi
callq 0x59e50
movl %eax, %ebp
leaq 0x18(%rsp), %rdi
callq 0x5a588
testb %bpl, %bpl
jne 0xad472
callq 0x563a0
leaq 0x18(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x58c40
leaq 0xbee98(%rip), %rdi     # 0x16c2f8
movq %r14, %rsi
callq 0x573e0
leaq 0x18(%rsp), %rdi
callq 0x5a588
callq 0x563a0
leaq 0xbee7a(%rip), %rdi     # 0x16c2f8
movq %rax, %rsi
callq 0x59180
testb %al, %al
je 0xad498
leaq 0xbee67(%rip), %rdi     # 0x16c2f8
xorl %esi, %esi
callq 0x58c30
leaq 0xbee59(%rip), %rsi     # 0x16c2f8
movq %rbx, %rdi
callq 0x58280
movq %rbx, %rax
addq $0xf8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0xbee51(%rip), %rdi     # 0x16c310
callq 0x57210
testl %eax, %eax
je 0xad2e2
leaq 0xbee25(%rip), %rdi     # 0x16c2f8
xorl %esi, %esi
callq 0x5a180
movq 0xb4a4f(%rip), %rdi     # 0x161f30
leaq 0xbee10(%rip), %rsi     # 0x16c2f8
leaq 0xb6d51(%rip), %rdx     # 0x164240
callq 0x590a0
leaq 0xbee15(%rip), %rdi     # 0x16c310
callq 0x57cf0
jmp 0xad2e2
movq %rax, %rbx
leaq 0xbee01(%rip), %rdi     # 0x16c310
callq 0x57520
jmp 0xad544
jmp 0xad537
jmp 0xad537
jmp 0xad537
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x5a598
jmp 0xad52e
movq %rax, %rbx
movq %rsp, %rdi
jmp 0xad53f
jmp 0xad537
jmp 0xad537
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x5a588
movq %rbx, %rdi
callq 0x58260