// File: /workspace/github_cpp_makefile_star2_O1/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 0x5141a(%rip), %rsi     # 0x8cdc1
leaq 0x51419(%rip), %rdx     # 0x8cdc7
leaq 0x68(%rsp), %rdi
callq 0x2fdd8
movq 0x68(%rsp), %rdi
callq 0xa6d0
leaq 0x38(%rsp), %r12
movq %r12, -0x10(%r12)
testq %rax, %rax
je 0x3b9f1
movq %rax, %r14
movq %rax, %rdi
callq 0xa260
movq %r14, %rdx
addq %rax, %rdx
leaq 0x28(%rsp), %rdi
movq %r14, %rsi
callq 0x2fdd8
jmp 0x3ba0c
movq 0x750e0(%rip), %rsi     # 0xb0ad8
movq 0x750e1(%rip), %rdx     # 0xb0ae0
addq %rsi, %rdx
leaq 0x28(%rsp), %rdi
callq 0x2c652
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x3ba23
movq 0x78(%rsp), %rsi
incq %rsi
callq 0xa5a0
movq 0x30(%rsp), %rdx
testq %rdx, %rdx
jne 0x3ba46
leaq 0x51394(%rip), %rcx     # 0x8cdc8
leaq 0x28(%rsp), %rdi
movl $0x4, %r8d
xorl %esi, %esi
callq 0xa8c0
leaq 0x18(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rdi
callq 0x2c652
leaq 0x51879(%rip), %rsi     # 0x8d2e6
leaq 0x8(%rsp), %rdi
callq 0xaac0
movq 0x7501a(%rip), %rsi     # 0xb0a98
movq 0x7501b(%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 0x3bab2
movq %rdx, 0x68(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x78(%rsp)
jmp 0x3bab9
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 0x512f1(%rip), %rsi     # 0x8cdcd
callq 0xaac0
leaq 0x10(%rbx), %r13
movq %r13, (%rbx)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x3bb03
movq %rdx, (%rbx)
movq (%rcx), %rdx
movq %rdx, 0x10(%rbx)
jmp 0x3bb0b
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 0x3bb39
movq 0x78(%rsp), %rsi
incq %rsi
callq 0xa5a0
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x3bb50
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xa5a0
movq (%rbx), %rdi
callq 0xaa70
testq %rax, %rax
je 0x3bc80
movq 0x8(%rbx), %rdx
testq %rdx, %rdx
je 0x3bcd3
leaq 0x8(%rsp), %rdi
movq %rbp, (%rdi)
movq (%rbx), %rsi
addq %rsi, %rdx
callq 0x2c652
leaq 0x5129e(%rip), %rsi     # 0x8ce26
leaq 0x8(%rsp), %rdi
callq 0xaac0
leaq 0x68(%rsp), %rdi
leaq 0x8(%rsp), %rsi
movl $0x10, %edx
callq 0xaad0
leaq 0x5127f(%rip), %rsi     # 0x8ce2c
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 0x3bd23
movq 0x74348(%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 0x2e508
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x3bc54
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xa5a0
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x3bc6b
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, (%rsp)
leaq 0x51140(%rip), %rsi     # 0x8cdd5
leaq 0x68(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x2bfaf
movb $0x1, %bpl
leaq 0x68(%rsp), %rsi
movq (%rsp), %rdi
callq 0xa930
xorl %ebp, %ebp
movq 0x7432a(%rip), %rsi     # 0xaffe8
movq 0x7429b(%rip), %rdx     # 0xaff60
movq (%rsp), %rdi
callq 0xa9b0
jmp 0x3bd72
movl $0x10, %edi
callq 0xa2c0
movq %rax, (%rsp)
leaq 0x51116(%rip), %rsi     # 0x8cdfe
leaq 0x68(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x2bfaf
movb $0x1, %bpl
leaq 0x68(%rsp), %rsi
movq (%rsp), %rdi
callq 0xa930
xorl %ebp, %ebp
movq 0x742d7(%rip), %rsi     # 0xaffe8
movq 0x74248(%rip), %rdx     # 0xaff60
movq (%rsp), %rdi
callq 0xa9b0
jmp 0x3bd72
movl $0x10, %edi
callq 0xa2c0
movq %rax, (%rsp)
leaq 0x510f8(%rip), %rdx     # 0x8ce30
leaq 0x48(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x2d3ba
movb $0x1, %r15b
leaq 0x48(%rsp), %rsi
movq (%rsp), %rdi
callq 0xa930
xorl %r15d, %r15d
movq 0x74286(%rip), %rsi     # 0xaffe8
movq 0x741f7(%rip), %rdx     # 0xaff60
movq (%rsp), %rdi
callq 0xa9b0
jmp 0x3be31
movq %rax, %r14
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3bd9d
movq 0x58(%rsp), %rsi
incq %rsi
callq 0xa5a0
jmp 0x3bd9d
movq %rax, %r14
movb $0x1, %r15b
testb %r15b, %r15b
je 0x3be52
movq (%rsp), %rdi
callq 0xa440
jmp 0x3be52
jmp 0x3bdb8
jmp 0x3bdd4
movq %rax, %r14
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x3bdda
movq 0x78(%rsp), %rsi
incq %rsi
callq 0xa5a0
jmp 0x3bdda
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x3be73
movq (%rsp), %rdi
callq 0xa440
jmp 0x3be73
jmp 0x3bdf5
jmp 0x3bdf5
movq %rax, %r14
jmp 0x3be5c
movq %rax, %r14
jmp 0x3be73
movq %rax, %r14
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x3be20
movq 0x78(%rsp), %rsi
incq %rsi
callq 0xa5a0
jmp 0x3be20
jmp 0x3be1d
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x3be87
movq 0x18(%rsp), %rsi
jmp 0x3be7f
movq %rax, %r14
jmp 0x3be87
movq %rax, %r14
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x3be9e
movq 0x78(%rsp), %rsi
jmp 0x3be96
movq %rax, %r14
jmp 0x3be9e
movq %rax, %r14
leaq 0x68(%rsp), %rdi
callq 0xa850
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x3be73
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xa5a0
movq (%rbx), %rdi
cmpq %r13, %rdi
je 0x3be87
movq (%r13), %rsi
incq %rsi
callq 0xa5a0
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x3be9e
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xa5a0
movq %r14, %rdi
callq 0xaa10