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

	if (configDir != NIL) return configDir;

	String::InputFormat	 inputFormat("UTF-8");

#if defined __WIN32__
	ITEMIDLIST	*idlist;
	Buffer<wchar_t>	 buffer(32768 + 1);

	SHGetSpecialFolderLocation(NIL, CSIDL_APPDATA, &idlist);
	SHGetPathFromIDList(idlist, buffer);

	configDir = buffer;

	CoTaskMemFree(idlist);
#elif defined __APPLE__
	passwd	*pw = getpwuid(getuid());

	if (pw != NIL)	configDir = pw->pw_dir;
	else		configDir = "~";

	configDir = configDir.Append("/Library/Preferences");
#elif defined __HAIKU__
	FILE		*pstdin = popen("finddir B_USER_SETTINGS_DIRECTORY", "r");
	Buffer<char>	 buffer(PATH_MAX + 1);

	buffer.Zero();

	fscanf(pstdin, String("%[^\n]").Append(String::FromInt(buffer.Size() - 1)), (char *) buffer);

	pclose(pstdin);

	configDir = buffer;
#else
	configDir = getenv("XDG_CONFIG_HOME");

	if (configDir == NIL)
	{
		passwd	*pw = getpwuid(getuid());

		if (pw != NIL)	configDir = pw->pw_dir;
		else		configDir = "~";

		configDir = configDir.Append("/.config");
	}
#endif

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

	return configDir;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movb 0xbfa47(%rip), %al      # 0x16c230
testb %al, %al
je 0xac970
leaq 0xbfa20(%rip), %rdi     # 0x16c218
xorl %esi, %esi
callq 0x57d40
testb %al, %al
je 0xac817
leaq 0xbfa0e(%rip), %rsi     # 0x16c218
movq %rbx, %rdi
callq 0x58280
jmp 0xac966
leaq 0x559a8(%rip), %rsi     # 0x1021c6
leaq 0x20(%rsp), %rdi
callq 0x5a450
leaq 0x55f1f(%rip), %rdi     # 0x10274e
callq 0x58950
leaq 0xbf9dd(%rip), %rdi     # 0x16c218
movq %rax, %rsi
callq 0x57010
leaq 0xbf9ce(%rip), %rdi     # 0x16c218
xorl %esi, %esi
callq 0x56280
testb %al, %al
je 0xac8c6
callq 0x57170
movl %eax, %edi
callq 0x56a10
testq %rax, %rax
je 0xac878
movq 0x20(%rax), %rsi
leaq 0xbf9a7(%rip), %rdi     # 0x16c218
callq 0x57010
jmp 0xac88b
leaq 0xbf999(%rip), %rdi     # 0x16c218
leaq 0x369ad(%rip), %rsi     # 0xe3233
callq 0x57010
leaq 0x55ecc(%rip), %rsi     # 0x10275e
leaq 0x8(%rsp), %rdi
callq 0x58c40
leaq 0xbf975(%rip), %rdi     # 0x16c218
leaq 0x8(%rsp), %rsi
callq 0x573e0
leaq 0xbf964(%rip), %rdi     # 0x16c218
movq %rax, %rsi
callq 0x56630
leaq 0x8(%rsp), %rdi
callq 0x5a588
callq 0x563a0
leaq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x58c40
leaq 0xbf939(%rip), %rdi     # 0x16c218
leaq 0x8(%rsp), %rsi
callq 0x59e50
movl %eax, %ebp
leaq 0x8(%rsp), %rdi
callq 0x5a588
testb %bpl, %bpl
jne 0xac927
callq 0x563a0
leaq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x58c40
leaq 0xbf905(%rip), %rdi     # 0x16c218
leaq 0x8(%rsp), %rsi
callq 0x573e0
leaq 0x8(%rsp), %rdi
callq 0x5a588
callq 0x563a0
leaq 0xbf8e5(%rip), %rdi     # 0x16c218
movq %rax, %rsi
callq 0x59180
testb %al, %al
je 0xac94d
leaq 0xbf8d2(%rip), %rdi     # 0x16c218
xorl %esi, %esi
callq 0x58c30
leaq 0xbf8c4(%rip), %rsi     # 0x16c218
movq %rbx, %rdi
callq 0x58280
leaq 0x20(%rsp), %rdi
callq 0x57b90
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %rbp
retq
leaq 0xbf8b9(%rip), %rdi     # 0x16c230
callq 0x57210
testl %eax, %eax
je 0xac7f1
leaq 0xbf88d(%rip), %rdi     # 0x16c218
xorl %esi, %esi
callq 0x5a180
movq 0xb5597(%rip), %rdi     # 0x161f30
leaq 0xbf878(%rip), %rsi     # 0x16c218
leaq 0xb7899(%rip), %rdx     # 0x164240
callq 0x590a0
leaq 0xbf87d(%rip), %rdi     # 0x16c230
callq 0x57cf0
jmp 0xac7f1
movq %rax, %rbx
leaq 0xbf869(%rip), %rdi     # 0x16c230
callq 0x57520
jmp 0xac9f6
jmp 0xac9d6
jmp 0xac9e9
jmp 0xac9e9
jmp 0xac9d6
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x5a588
jmp 0xac9ec
jmp 0xac9e9
jmp 0xac9e9
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x57b90
movq %rbx, %rdi
callq 0x58260