// File: /workspace/github_cpp_makefile_star2_O3/ncbi[P]amr/common.cpp
// Function: Common_sp::makeTempDir[abi:cxx11]()
string makeTempDir ()
{
  string tmpDir (getEnv ("TMPDIR"));
  if (tmpDir. empty ())
    tmpDir = "/tmp";

  string tmp = tmpDir + "/" + programName + ".XXXXXX";
  if (! mkdtemp (var_cast (tmp. c_str ())))
    throw runtime_error ("Error creating a temporary directory in " + tmpDir);
	if (tmp. empty ())
		throw runtime_error ("Cannot create a temporary directory in " + tmpDir);

  {
  	const string testFName (tmp + "/test");
    {
      ofstream f (testFName);
      f << "abc" << endl;
      if (! f. good ())
		    throw runtime_error (tmpDir + " is full, make space there or use environment variable TMPDIR to change location for temporary files");
    }
    removeFile (testFName);
  }

  return tmp;  
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x268, %rsp            # imm = 0x268
movq %rdi, %rbx
leaq 0x78(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x518ba(%rip), %rsi     # 0x8cdab
leaq 0x518b9(%rip), %rdx     # 0x8cdb1
leaq 0x68(%rsp), %rdi
callq 0x2fa1a
movq 0x68(%rsp), %rdi
callq 0xa6d0
leaq 0x38(%rsp), %r12
movq %r12, -0x10(%r12)
testq %rax, %rax
je 0x3b53b
movq %rax, %r14
movq %rax, %rdi
callq 0xa260
movq %r14, %rdx
addq %rax, %rdx
leaq 0x28(%rsp), %rdi
movq %r14, %rsi
callq 0x2fa1a
jmp 0x3b556
movq 0x75596(%rip), %rsi     # 0xb0ad8
movq 0x75597(%rip), %rdx     # 0xb0ae0
addq %rsi, %rdx
leaq 0x28(%rsp), %rdi
callq 0x2c212
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x3b56d
movq 0x78(%rsp), %rsi
incq %rsi
callq 0xa5a0
movq 0x30(%rsp), %rdx
testq %rdx, %rdx
jne 0x3b597
leaq 0x51834(%rip), %rcx     # 0x8cdb2
leaq 0x28(%rsp), %rdi
movl $0x4, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0xa8c0
movq 0x30(%rsp), %rdx
leaq 0x18(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq 0x28(%rsp), %rsi
addq %rsi, %rdx
leaq 0x8(%rsp), %rdi
callq 0x2c212
leaq 0x51d17(%rip), %rsi     # 0x8d2d0
leaq 0x8(%rsp), %rdi
callq 0xaac0
movq 0x754ce(%rip), %rsi     # 0xb0a98
movq 0x754cf(%rip), %rdx     # 0xb0aa0
leaq 0x8(%rsp), %rdi
callq 0xa190
movq %r15, 0x68(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x3b5fe
movq %rdx, 0x68(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x78(%rsp)
jmp 0x3b605
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq 0x68(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x5178f(%rip), %rsi     # 0x8cdb7
callq 0xaac0
leaq 0x10(%rbx), %r13
movq %r13, (%rbx)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x3b64f
movq %rdx, (%rbx)
movq (%rcx), %rdx
movq %rdx, 0x10(%rbx)
jmp 0x3b657
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rbx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x3b685
movq 0x78(%rsp), %rsi
incq %rsi
callq 0xa5a0
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x3b69c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xa5a0
movq (%rbx), %rdi
callq 0xaa70
testq %rax, %rax
je 0x3b7cc
movq 0x8(%rbx), %rdx
testq %rdx, %rdx
je 0x3b825
leaq 0x8(%rsp), %rdi
movq %rbp, (%rdi)
movq (%rbx), %rsi
addq %rsi, %rdx
callq 0x2c212
leaq 0x5173c(%rip), %rsi     # 0x8ce10
leaq 0x8(%rsp), %rdi
callq 0xaac0
leaq 0x68(%rsp), %rdi
leaq 0x8(%rsp), %rsi
movl $0x10, %edx
callq 0xaad0
leaq 0x5171d(%rip), %rsi     # 0x8ce16
leaq 0x68(%rsp), %r14
movl $0x3, %edx
movq %r14, %rdi
callq 0xa640
movq 0x68(%rsp), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0xa570
movsbl %al, %esi
leaq 0x68(%rsp), %rdi
callq 0xa040
movq %rax, %rdi
callq 0xa3f0
movq 0x68(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x88(%rsp,%rax)
jne 0x3b87b
movq 0x747fc(%rip), %rax     # 0xaff50
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x70(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x68(%rsp,%rcx)
callq 0xa4b0
leaq 0x160(%rsp), %rdi
callq 0xa1c0
leaq 0x8(%rsp), %rdi
callq 0x2e0e8
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x3b7a0
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xa5a0
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x3b7b7
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xa5a0
movq %rbx, %rax
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0xa2c0
movq %rax, %rbp
leaq 0x515df(%rip), %rsi     # 0x8cdbf
leaq 0x68(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x2bb6f
movb $0x1, %al
movl %eax, 0x4(%rsp)
leaq 0x68(%rsp), %rsi
movq %rbp, %rdi
callq 0xa930
movl $0x0, 0x4(%rsp)
movq 0x747d7(%rip), %rsi     # 0xaffe8
movq 0x74748(%rip), %rdx     # 0xaff60
movq %rbp, %rdi
callq 0xa9b0
jmp 0x3b8cf
movl $0x10, %edi
callq 0xa2c0
movq %rax, %rbp
leaq 0x515af(%rip), %rsi     # 0x8cde8
leaq 0x68(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x2bb6f
movb $0x1, %al
movl %eax, 0x4(%rsp)
leaq 0x68(%rsp), %rsi
movq %rbp, %rdi
callq 0xa930
movl $0x0, 0x4(%rsp)
movq 0x7477e(%rip), %rsi     # 0xaffe8
movq 0x746ef(%rip), %rdx     # 0xaff60
movq %rbp, %rdi
callq 0xa9b0
jmp 0x3b8cf
movl $0x10, %edi
callq 0xa2c0
movq %rax, %r15
leaq 0x5158b(%rip), %rdx     # 0x8ce1a
leaq 0x48(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x2cfa9
movb $0x1, %al
movl %eax, 0x4(%rsp)
leaq 0x48(%rsp), %rsi
movq %r15, %rdi
callq 0xa930
movl $0x0, 0x4(%rsp)
movq 0x74728(%rip), %rsi     # 0xaffe8
movq 0x74699(%rip), %rdx     # 0xaff60
movq %r15, %rdi
callq 0xa9b0
jmp 0x3b988
movq %rax, %r14
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3b8f2
movq 0x58(%rsp), %rsi
incq %rsi
callq 0xa5a0
cmpb $0x0, 0x4(%rsp)
jne 0x3b901
jmp 0x3b9a9
movq %rax, %r14
movq %r15, %rdi
callq 0xa440
jmp 0x3b9a9
jmp 0x3b912
jmp 0x3b938
movq %rax, %r14
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x3b92c
movq 0x78(%rsp), %rsi
incq %rsi
callq 0xa5a0
cmpb $0x0, 0x4(%rsp)
jne 0x3b93b
jmp 0x3b9ca
movq %rax, %r14
movq %rbp, %rdi
callq 0xa440
jmp 0x3b9ca
jmp 0x3b94c
jmp 0x3b94c
movq %rax, %r14
jmp 0x3b9b3
movq %rax, %r14
jmp 0x3b9ca
movq %rax, %r14
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x3b977
movq 0x78(%rsp), %rsi
incq %rsi
callq 0xa5a0
jmp 0x3b977
jmp 0x3b974
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x3b9de
movq 0x18(%rsp), %rsi
jmp 0x3b9d6
movq %rax, %r14
jmp 0x3b9de
movq %rax, %r14
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x3b9f5
movq 0x78(%rsp), %rsi
jmp 0x3b9ed
movq %rax, %r14
jmp 0x3b9f5
movq %rax, %r14
leaq 0x68(%rsp), %rdi
callq 0xa850
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x3b9ca
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xa5a0
movq (%rbx), %rdi
cmpq %r13, %rdi
je 0x3b9de
movq (%r13), %rsi
incq %rsi
callq 0xa5a0
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x3b9f5
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xa5a0
movq %r14, %rdi
callq 0xaa10