// File: ryuichiueda[P]GlueLang/src/Environment.cc
// Function: Environment::initTmpdir()
void Environment::initTmpdir(void)
{
	auto *p = getImportPaths("tmpdir");
	if(p == NULL || p->size() < 1){
		cerr << "unable to find tmpdir" << endl;
		throw this;
	}

	srand(time(NULL));

	m_tmpdir = p->at(0) + "glue" + to_string(m_pid) + "-" + to_string(rand());
	while(mkdir(m_tmpdir.c_str(),0700) != 0){
		cerr << "unable to create tmpdir" << endl;
		throw this;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
leaq 0xf1fc(%rip), %rsi      # 0x1d42d
callq 0xe4d0
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xe250
movq -0x10(%rbp), %rdi
callq 0xb6a0
cmpq $0x1, %rax
jae 0xe299
movq 0x1ad91(%rip), %rdi     # 0x28fe8
leaq 0xf1c0(%rip), %rsi      # 0x1d41e
callq 0x6410
movq %rax, %rdi
movq 0x1ad3b(%rip), %rsi     # 0x28fa8
callq 0x6460
movl $0x8, %edi
callq 0x6200
movq %rax, %rdi
movq -0xe8(%rbp), %rax
movq %rax, (%rdi)
leaq 0x19fe0(%rip), %rsi     # 0x28270
xorl %eax, %eax
movl %eax, %edx
callq 0x66d0
xorl %eax, %eax
movl %eax, %edi
movq %rdi, -0xf0(%rbp)
callq 0x63c0
movl %eax, %edi
callq 0x6400
movq -0xf0(%rbp), %rsi
movq -0x10(%rbp), %rdi
callq 0xb5e0
movq %rax, %rsi
leaq 0xf16a(%rip), %rdx      # 0x1d434
leaq -0x90(%rbp), %rdi
callq 0x79f0
movq -0xe8(%rbp), %rax
movl 0xe4(%rax), %esi
leaq -0xb0(%rbp), %rdi
callq 0xa480
jmp 0xe2f1
leaq -0x70(%rbp), %rdi
leaq -0x90(%rbp), %rsi
leaq -0xb0(%rbp), %rdx
callq 0x8f90
jmp 0xe30a
leaq 0xef60(%rip), %rdx      # 0x1d271
leaq -0x50(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x7bd0
jmp 0xe320
callq 0x6120
movl %eax, %esi
leaq -0xe0(%rbp), %rdi
callq 0xa480
jmp 0xe335
leaq -0x30(%rbp), %rdi
leaq -0x50(%rbp), %rsi
leaq -0xe0(%rbp), %rdx
callq 0x8f90
jmp 0xe34b
movq -0xe8(%rbp), %rdi
addq $0xc0, %rdi
leaq -0x30(%rbp), %rsi
callq 0x6520
leaq -0x30(%rbp), %rdi
callq 0x6280
leaq -0xe0(%rbp), %rdi
callq 0x6280
leaq -0x50(%rbp), %rdi
callq 0x6280
leaq -0x70(%rbp), %rdi
callq 0x6280
leaq -0xb0(%rbp), %rdi
callq 0x6280
leaq -0x90(%rbp), %rdi
callq 0x6280
movq -0xe8(%rbp), %rdi
addq $0xc0, %rdi
callq 0x6190
movq %rax, %rdi
movl $0x1c0, %esi            # imm = 0x1C0
callq 0x61e0
cmpl $0x0, %eax
je 0xe4ad
movq 0x1ac17(%rip), %rdi     # 0x28fe8
leaq 0xf061(%rip), %rsi      # 0x1d439
callq 0x6410
movq %rax, %rdi
movq 0x1abc1(%rip), %rsi     # 0x28fa8
callq 0x6460
movl $0x8, %edi
callq 0x6200
movq %rax, %rdi
movq -0xe8(%rbp), %rax
movq %rax, (%rdi)
leaq 0x19e66(%rip), %rsi     # 0x28270
xorl %eax, %eax
movl %eax, %edx
callq 0x66d0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
jmp 0xe49f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
jmp 0xe493
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
jmp 0xe48a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
jmp 0xe481
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x6280
leaq -0x50(%rbp), %rdi
callq 0x6280
leaq -0x70(%rbp), %rdi
callq 0x6280
leaq -0xb0(%rbp), %rdi
callq 0x6280
leaq -0x90(%rbp), %rdi
callq 0x6280
jmp 0xe4b6
addq $0xf0, %rsp
popq %rbp
retq
movq -0xb8(%rbp), %rdi
callq 0x6700
nopw %cs:(%rax,%rax)