// File: /workspace/github_cpp_makefile_star2_O3/ryuichiueda[P]GlueLang/src/Environment.cc
// Function: Environment::removeFiles()
void Environment::removeFiles(void)
{
	/*
	for(auto le : m_local_env){
		le.second->removeFiles(true);
	}
	*/

	for(auto d : m_data){
		string *f = d.second->getFileName();
		if(f == NULL)
			continue;

		if(m_tmpdir + "/" != f->substr(0,m_tmpdir.size() + 1))
			continue;

		//if(f->substr(m_tmpdir.size()+1,6) != "local." && m_is_local)
		//	continue;

		remove(f->c_str());
		if(m_v_opt)
			cerr << "+ pid " << getpid() << " file " << f << " deleted" << endl;
	}
	

//	if(!local){
		struct stat buf;
		while(stat(m_tmpdir.c_str(), &buf) == 0){
			if(remove(m_tmpdir.c_str()) != 0){
				cerr << "cannot remove tmpdir" << endl;
				sleep(1);
			}
		}
//	}

	if(Element::m_signal != 0)
		kill(0,Element::m_signal);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbx
movq 0x80(%rdi), %r14
leaq 0x70(%rdi), %r12
cmpq %r12, %r14
je 0xb967
leaq 0x58(%rsp), %r15
movq %r15, 0x48(%rsp)
movq 0x20(%r14), %rsi
movq 0x28(%r14), %rdx
addq %rsi, %rdx
leaq 0x48(%rsp), %rdi
callq 0x745a
movq 0x40(%r14), %rdi
movq %rdi, 0x68(%rsp)
movq (%rdi), %rax
callq *0x18(%rax)
movq %rax, %r13
testq %rax, %rax
je 0xb93c
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0xc0(%rbx), %rsi
movq 0xc8(%rbx), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x745a
movq %r15, %rdi
leaq 0x8e2e(%rip), %rsi      # 0x1462e
callq 0x65d0
movq 0xc8(%rbx), %rcx
incq %rcx
leaq 0x28(%rsp), %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x6350
movq 0x10(%rsp), %rdx
cmpq 0x30(%rsp), %rdx
jne 0xb849
movq 0x28(%rsp), %rbp
testq %rdx, %rdx
je 0xb853
movq 0x8(%rsp), %rdi
movq %rbp, %rsi
callq 0x6340
testl %eax, %eax
setne %r15b
jmp 0xb856
movb $0x1, %r15b
movq 0x28(%rsp), %rbp
jmp 0xb856
xorl %r15d, %r15d
leaq 0x38(%rsp), %rax
cmpq %rax, %rbp
je 0xb870
movq 0x38(%rsp), %rsi
incq %rsi
movq %rbp, %rdi
callq 0x6330
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xb88c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6330
testb %r15b, %r15b
leaq 0x58(%rsp), %r15
jne 0xb93c
movq (%r13), %rdi
callq 0x65a0
cmpb $0x1, 0xe0(%rbx)
jne 0xb93c
movl $0x6, %edx
movq 0x10734(%rip), %rdi     # 0x1bff0
leaq 0x89b0(%rip), %rsi      # 0x14273
callq 0x63a0
callq 0x6480
movq 0x1071c(%rip), %rdi     # 0x1bff0
movl %eax, %esi
callq 0x6560
movq %rax, %rbp
movl $0x6, %edx
movq %rax, %rdi
leaq 0x898d(%rip), %rsi      # 0x1427a
callq 0x63a0
movq %rbp, %rdi
movq %r13, %rsi
callq 0x6230
movq %rax, %r13
movl $0x8, %edx
movq %rax, %rdi
leaq 0x8b79(%rip), %rsi      # 0x14488
callq 0x63a0
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x6300
movsbl %al, %esi
movq %r13, %rdi
callq 0x6040
movq %rax, %rdi
callq 0x61e0
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0xb953
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x6330
movq %r14, %rdi
callq 0x61f0
movq %rax, %r14
cmpq %r12, %rax
jne 0xb799
movq 0xc0(%rbx), %rdi
leaq 0x48(%rsp), %rsi
callq 0x62b0
testl %eax, %eax
jne 0xb9f3
leaq 0x48(%rsp), %r14
movq 0x10668(%rip), %r15     # 0x1bff0
leaq 0x8b02(%rip), %r12      # 0x14491
movq 0xc0(%rbx), %rdi
callq 0x65a0
testl %eax, %eax
je 0xb9e0
movl $0x14, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x63a0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x6300
movsbl %al, %esi
movq %r15, %rdi
callq 0x6040
movq %rax, %rdi
callq 0x61e0
movl $0x1, %edi
callq 0x6220
movq 0xc0(%rbx), %rdi
movq %r14, %rsi
callq 0x62b0
testl %eax, %eax
je 0xb98f
leaq 0x1097e(%rip), %rax     # 0x1c378
movl (%rax), %esi
testl %esi, %esi
je 0xba07
xorl %edi, %edi
callq 0x6450
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xba3e
jmp 0xba1d
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xba41
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6330
jmp 0xba41
movq %rax, %rbx
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0xba5d
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x6330
movq %rbx, %rdi
callq 0x6580
nop