// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x90(%rbp)
movq %rdi, %rax
movq %rax, -0x88(%rbp)
movq %rdi, -0x8(%rbp)
cmpb $0x0, 0x10a2c9(%rip)    # 0x213cc0
jne 0x109a40
leaq 0x10a2c0(%rip), %rdi    # 0x213cc0
callq 0x5a4e0
cmpl $0x0, %eax
je 0x109a40
leaq 0x10a297(%rip), %rdi    # 0x213ca8
xorl %esi, %esi
callq 0x5da90
jmp 0x109a1a
movq 0xff507(%rip), %rdi     # 0x208f28
leaq 0x10a280(%rip), %rsi    # 0x213ca8
leaq 0x101cd1(%rip), %rdx    # 0x20b700
callq 0x5c700
leaq 0x10a285(%rip), %rdi    # 0x213cc0
callq 0x5b0c0
leaq 0x10a261(%rip), %rdi    # 0x213ca8
xorl %esi, %esi
callq 0x5b110
testb $0x1, %al
jne 0x109a54
jmp 0x109a89
movq -0x90(%rbp), %rdi
leaq 0x10a246(%rip), %rsi    # 0x213ca8
callq 0x5b6d0
jmp 0x109cdf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
leaq 0x10a241(%rip), %rdi    # 0x213cc0
callq 0x5a860
jmp 0x109cef
leaq 0x9c156(%rip), %rsi     # 0x1a5be6
leaq -0x30(%rbp), %rdi
callq 0x5ddc0
leaq 0x9c6b9(%rip), %rdi     # 0x1a6159
callq 0x5bea0
movq %rax, %rsi
leaq 0x10a1f9(%rip), %rdi    # 0x213ca8
callq 0x5a230
jmp 0x109ab6
leaq 0x10a1eb(%rip), %rdi    # 0x213ca8
xorl %esi, %esi
callq 0x59320
movb %al, -0x91(%rbp)
jmp 0x109acc
movb -0x91(%rbp), %al
testb $0x1, %al
jne 0x109adb
jmp 0x109ba7
callq 0x5a3e0
movl %eax, %edi
callq 0x59b70
movq %rax, -0xa0(%rbp)
jmp 0x109af0
movq -0xa0(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x109b2b
movq -0x38(%rbp), %rax
movq 0x20(%rax), %rsi
leaq 0x10a197(%rip), %rdi    # 0x213ca8
callq 0x5a230
jmp 0x109b18
jmp 0x109b42
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
jmp 0x109cd4
leaq 0x10a176(%rip), %rdi    # 0x213ca8
leaq 0x7d6fa(%rip), %rsi     # 0x187233
callq 0x5a230
jmp 0x109b40
jmp 0x109b42
leaq 0x9c620(%rip), %rsi     # 0x1a6169
leaq -0x50(%rbp), %rdi
callq 0x5c1f0
jmp 0x109b54
leaq 0x10a14d(%rip), %rdi    # 0x213ca8
leaq -0x50(%rbp), %rsi
callq 0x5a710
movq %rax, -0xa8(%rbp)
jmp 0x109b6d
movq -0xa8(%rbp), %rsi
leaq 0x10a12d(%rip), %rdi    # 0x213ca8
callq 0x59760
jmp 0x109b82
leaq -0x50(%rbp), %rdi
callq 0x5df00
jmp 0x109ba7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x5df00
jmp 0x109cd4
callq 0x59460
movq %rax, -0xb0(%rbp)
jmp 0x109bb5
movq -0xb0(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x5c1f0
jmp 0x109bc7
leaq 0x10a0da(%rip), %rdi    # 0x213ca8
leaq -0x68(%rbp), %rsi
callq 0x5d6c0
movb %al, -0xb1(%rbp)
jmp 0x109bdf
movb -0xb1(%rbp), %al
xorb $-0x1, %al
movb %al, -0xb2(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x5df00
movb -0xb2(%rbp), %al
testb $0x1, %al
jne 0x109c02
jmp 0x109c6d
callq 0x59460
movq %rax, -0xc0(%rbp)
jmp 0x109c10
movq -0xc0(%rbp), %rsi
leaq -0x80(%rbp), %rdi
callq 0x5c1f0
jmp 0x109c22
leaq 0x10a07f(%rip), %rdi    # 0x213ca8
leaq -0x80(%rbp), %rsi
callq 0x5a710
jmp 0x109c34
leaq -0x80(%rbp), %rdi
callq 0x5df00
jmp 0x109c6d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x5df00
jmp 0x109cd4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x5df00
jmp 0x109cd4
callq 0x59460
movq %rax, -0xc8(%rbp)
jmp 0x109c7b
movq -0xc8(%rbp), %rsi
leaq 0x10a01f(%rip), %rdi    # 0x213ca8
callq 0x5c7f0
movb %al, -0xc9(%rbp)
jmp 0x109c96
movb -0xc9(%rbp), %al
testb $0x1, %al
jne 0x109ca2
jmp 0x109cb4
leaq 0x109fff(%rip), %rdi    # 0x213ca8
xorl %esi, %esi
callq 0x5c1e0
jmp 0x109cb2
jmp 0x109cb4
movq -0x90(%rbp), %rdi
leaq 0x109fe6(%rip), %rsi    # 0x213ca8
callq 0x5b6d0
jmp 0x109cc9
leaq -0x30(%rbp), %rdi
callq 0x5af60
jmp 0x109cdf
leaq -0x30(%rbp), %rdi
callq 0x5af60
jmp 0x109cef
movq -0x88(%rbp), %rax
addq $0xd0, %rsp
popq %rbp
retq
movq -0x10(%rbp), %rdi
callq 0x5b6b0
nopl (%rax,%rax)