// File: /workspace/github_c_makefile_star2_O3/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 0xc3f30(%rip), %al      # 0x176150
testb %al, %al
je 0xb2404
leaq 0xc3f09(%rip), %rdi     # 0x176138
xorl %esi, %esi
callq 0x56bd0
testb %al, %al
jne 0xb23e4
leaq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0x57a50
leaq 0xc3ee6(%rip), %rdi     # 0x176138
movq %r14, %rsi
callq 0x555f0
leaq 0x18(%rsp), %rdi
callq 0x59200
leaq 0xc3ecd(%rip), %r14     # 0x176138
movq %r14, %rdi
callq 0x57180
leal -0x1(%rax), %esi
movq %r14, %rdi
callq 0x58990
movl $0x0, (%rax)
callq 0x55370
leaq 0x18(%rsp), %r15
movq %r15, %rdi
movq %rax, %rsi
callq 0x579f0
movq %r14, %rdi
movq %r15, %rsi
callq 0x58a10
incl %eax
leaq 0xc3e8b(%rip), %rdi     # 0x176138
movl %eax, %esi
callq 0x58990
movl $0x0, (%rax)
leaq 0x18(%rsp), %rdi
callq 0x59200
leaq 0x6062a(%rip), %rsi     # 0x1128f5
leaq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0x579f0
leaq 0xc3e59(%rip), %rdi     # 0x176138
movq %r14, %rsi
callq 0x562f0
leaq 0x18(%rsp), %rdi
callq 0x59200
movq %rsp, %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x58e20
leaq 0xc3e33(%rip), %rsi     # 0x176138
leaq 0x18(%rsp), %rdi
movq %r14, %rdx
callq 0x58c60
leaq 0x18(%rsp), %rdi
callq 0x55440
movl %eax, %ebp
leaq 0x18(%rsp), %rdi
callq 0x59210
movq %rsp, %rdi
callq 0x59200
testb %bpl, %bpl
jne 0xb235b
leaq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0x57a50
leaq 0xc3def(%rip), %rdi     # 0x176138
movq %r14, %rsi
callq 0x555f0
leaq 0x18(%rsp), %rdi
callq 0x59200
callq 0x55370
leaq 0x18(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x579f0
leaq 0xc3dc1(%rip), %rdi     # 0x176138
movq %r14, %rsi
callq 0x58b10
movl %eax, %ebp
leaq 0x18(%rsp), %rdi
callq 0x59200
testb %bpl, %bpl
jne 0xb23be
callq 0x55370
leaq 0x18(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x579f0
leaq 0xc3d8c(%rip), %rdi     # 0x176138
movq %r14, %rsi
callq 0x562f0
leaq 0x18(%rsp), %rdi
callq 0x59200
callq 0x55370
leaq 0xc3d6e(%rip), %rdi     # 0x176138
movq %rax, %rsi
callq 0x57ef0
testb %al, %al
je 0xb23e4
leaq 0xc3d5b(%rip), %rdi     # 0x176138
xorl %esi, %esi
callq 0x579e0
leaq 0xc3d4d(%rip), %rsi     # 0x176138
movq %rbx, %rdi
callq 0x570b0
movq %rbx, %rax
addq $0xf8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0xc3d45(%rip), %rdi     # 0x176150
callq 0x56120
testl %eax, %eax
je 0xb2228
leaq 0xc3d19(%rip), %rdi     # 0x176138
xorl %esi, %esi
callq 0x58e20
movq 0xb9b03(%rip), %rdi     # 0x16bf30
leaq 0xc3d04(%rip), %rsi     # 0x176138
leaq 0xbbc45(%rip), %rdx     # 0x16e080
callq 0x57e10
leaq 0xc3d09(%rip), %rdi     # 0x176150
callq 0x56b80
jmp 0xb2228
movq %rax, %rbx
leaq 0xc3cf5(%rip), %rdi     # 0x176150
callq 0x56420
jmp 0xb2490
jmp 0xb2483
jmp 0xb2483
jmp 0xb2483
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x59210
jmp 0xb247a
movq %rax, %rbx
movq %rsp, %rdi
jmp 0xb248b
jmp 0xb2483
jmp 0xb2483
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x59200
movq %rbx, %rdi
callq 0x57090