// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/classes/system/system.cpp
// Function: smooth::System::System::GetTempDirectory()
S::String S::System::System::GetTempDirectory()
{
	static String	 tempDir;

	if (tempDir != NIL) return tempDir;

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

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

	GetTempPath(buffer.Size(), buffer);

	tempDir = buffer;
#elif defined __HAIKU__
	FILE		*pstdin = popen("finddir B_COMMON_TEMP_DIRECTORY", "r");
	Buffer<char>	 buffer(PATH_MAX + 1);

	buffer.Zero();

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

	pclose(pstdin);

	tempDir = buffer;
#else
	tempDir = getenv("TMPDIR");

	if (tempDir == NIL) tempDir = "/var/tmp";
#endif

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

	return tempDir;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x70(%rbp)
movq %rdi, %rax
movq %rax, -0x68(%rbp)
movq %rdi, -0x8(%rbp)
cmpb $0x0, 0x108c9f(%rip)    # 0x213dc0
jne 0x10b16a
leaq 0x108c96(%rip), %rdi    # 0x213dc0
callq 0x5a4e0
cmpl $0x0, %eax
je 0x10b16a
leaq 0x108c6d(%rip), %rdi    # 0x213da8
xorl %esi, %esi
callq 0x5da90
jmp 0x10b144
movq 0xfdddd(%rip), %rdi     # 0x208f28
leaq 0x108c56(%rip), %rsi    # 0x213da8
leaq 0x1005a7(%rip), %rdx    # 0x20b700
callq 0x5c700
leaq 0x108c5b(%rip), %rdi    # 0x213dc0
callq 0x5b0c0
leaq 0x108c37(%rip), %rdi    # 0x213da8
xorl %esi, %esi
callq 0x5b110
testb $0x1, %al
jne 0x10b17e
jmp 0x10b1b0
movq -0x70(%rbp), %rdi
leaq 0x108c1f(%rip), %rsi    # 0x213da8
callq 0x5b6d0
jmp 0x10b350
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
leaq 0x108c1a(%rip), %rdi    # 0x213dc0
callq 0x5a860
jmp 0x10b35d
leaq 0x9aa2f(%rip), %rsi     # 0x1a5be6
leaq -0x30(%rbp), %rdi
callq 0x5ddc0
leaq 0x9b02f(%rip), %rdi     # 0x1a61f6
callq 0x5bea0
movq %rax, %rsi
leaq 0x108bd2(%rip), %rdi    # 0x213da8
callq 0x5a230
jmp 0x10b1dd
leaq 0x108bc4(%rip), %rdi    # 0x213da8
xorl %esi, %esi
callq 0x59320
movb %al, -0x71(%rbp)
jmp 0x10b1f0
movb -0x71(%rbp), %al
testb $0x1, %al
jne 0x10b1f9
jmp 0x10b221
leaq 0x108ba8(%rip), %rdi    # 0x213da8
leaq 0x9aff6(%rip), %rsi     # 0x1a61fd
callq 0x5a230
jmp 0x10b20e
jmp 0x10b221
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
jmp 0x10b345
callq 0x59460
movq %rax, -0x80(%rbp)
jmp 0x10b22c
movq -0x80(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x5c1f0
jmp 0x10b23b
leaq 0x108b66(%rip), %rdi    # 0x213da8
leaq -0x48(%rbp), %rsi
callq 0x5d6c0
movb %al, -0x81(%rbp)
jmp 0x10b253
movb -0x81(%rbp), %al
xorb $-0x1, %al
movb %al, -0x82(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x5df00
movb -0x82(%rbp), %al
testb $0x1, %al
jne 0x10b276
jmp 0x10b2e1
callq 0x59460
movq %rax, -0x90(%rbp)
jmp 0x10b284
movq -0x90(%rbp), %rsi
leaq -0x60(%rbp), %rdi
callq 0x5c1f0
jmp 0x10b296
leaq 0x108b0b(%rip), %rdi    # 0x213da8
leaq -0x60(%rbp), %rsi
callq 0x5a710
jmp 0x10b2a8
leaq -0x60(%rbp), %rdi
callq 0x5df00
jmp 0x10b2e1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x5df00
jmp 0x10b345
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x5df00
jmp 0x10b345
callq 0x59460
movq %rax, -0x98(%rbp)
jmp 0x10b2ef
movq -0x98(%rbp), %rsi
leaq 0x108aab(%rip), %rdi    # 0x213da8
callq 0x5c7f0
movb %al, -0x99(%rbp)
jmp 0x10b30a
movb -0x99(%rbp), %al
testb $0x1, %al
jne 0x10b316
jmp 0x10b328
leaq 0x108a8b(%rip), %rdi    # 0x213da8
xorl %esi, %esi
callq 0x5c1e0
jmp 0x10b326
jmp 0x10b328
movq -0x70(%rbp), %rdi
leaq 0x108a75(%rip), %rsi    # 0x213da8
callq 0x5b6d0
jmp 0x10b33a
leaq -0x30(%rbp), %rdi
callq 0x5af60
jmp 0x10b350
leaq -0x30(%rbp), %rdi
callq 0x5af60
jmp 0x10b35d
movq -0x68(%rbp), %rax
addq $0xa0, %rsp
popq %rbp
retq
movq -0x10(%rbp), %rdi
callq 0x5b6b0
nopw %cs:(%rax,%rax)