// File: /workspace/github_cpp_makefile_star2_O2/manikandan5[P]Image-Matching-Stitching-Warping/./CImg.h
// Function: cimg_library::cimg::temporary_path(char const*, bool)
inline const char* temporary_path(const char *const user_path=0, const bool reinit_path=false) {
#define _cimg_test_temporary_path(p) \
      if (!path_found) { \
        cimg_snprintf(s_path,1024,"%s",p); \
        cimg_snprintf(tmp,sizeof(tmp),"%s%c%s",s_path,cimg_file_separator,filetmp); \
        if ((file=std::fopen(tmp,"wb"))!=0) { cimg::fclose(file); std::remove(tmp); path_found = true; } \
      }
      static char *s_path = 0;
      cimg::mutex(7);
      if (reinit_path) { delete[] s_path; s_path = 0; }
      if (user_path) {
        if (!s_path) s_path = new char[1024];
        std::memset(s_path,0,1024);
        std::strncpy(s_path,user_path,1023);
      } else if (!s_path) {
        s_path = new char[1024];
        std::memset(s_path,0,1024);
        bool path_found = false;
        char tmp[1024] = { 0 }, filetmp[512] = { 0 };
        std::FILE *file = 0;
        cimg_snprintf(filetmp,sizeof(filetmp),"%s.tmp",cimg::filenamerand());
        char *tmpPath = std::getenv("TMP");
        if (!tmpPath) { tmpPath = std::getenv("TEMP"); winformat_string(tmpPath); }
        if (tmpPath) _cimg_test_temporary_path(tmpPath);
#if cimg_OS==2
        _cimg_test_temporary_path("C:\\WINNT\\Temp");
        _cimg_test_temporary_path("C:\\WINDOWS\\Temp");
        _cimg_test_temporary_path("C:\\Temp");
        _cimg_test_temporary_path("C:");
        _cimg_test_temporary_path("D:\\WINNT\\Temp");
        _cimg_test_temporary_path("D:\\WINDOWS\\Temp");
        _cimg_test_temporary_path("D:\\Temp");
        _cimg_test_temporary_path("D:");
#else
        _cimg_test_temporary_path("/tmp");
        _cimg_test_temporary_path("/var/tmp");
#endif
        if (!path_found) {
          *s_path = 0;
          std::strncpy(tmp,filetmp,sizeof(tmp)-1);
          if ((file=std::fopen(tmp,"wb"))!=0) { cimg::fclose(file); std::remove(tmp); path_found = true; }
        }
        if (!path_found) {
          cimg::mutex(7,0);
          throw CImgIOException("cimg::temporary_path(): Failed to locate path for writing temporary files.\n");
        }
      }
      cimg::mutex(7,0);
      return s_path;
    }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x600, %rsp            # imm = 0x600
movl %esi, %ebp
movq %rdi, %rbx
pushq $0x7
popq %rdi
pushq $0x1
popq %rsi
callq 0xa419
testl %ebp, %ebp
je 0x2a060
movq 0x68d42(%rip), %rdi     # 0x92d90
testq %rdi, %rdi
je 0x2a058
callq 0x4670
andq $0x0, 0x68d30(%rip)     # 0x92d90
movq 0x68d29(%rip), %r14     # 0x92d90
testq %rbx, %rbx
je 0x2a0a9
testq %r14, %r14
jne 0x2a085
movl $0x400, %edi            # imm = 0x400
callq 0x4040
movq %rax, %r14
movq %rax, 0x68d0b(%rip)     # 0x92d90
movl $0x400, %edx            # imm = 0x400
movq %r14, %rdi
xorl %esi, %esi
callq 0x4280
movl $0x3ff, %edx            # imm = 0x3FF
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4240
jmp 0x2a28a
testq %r14, %r14
jne 0x2a28a
movl $0x400, %edi            # imm = 0x400
callq 0x4040
movq %rax, 0x68ccd(%rip)     # 0x92d90
movl $0x400, %edx            # imm = 0x400
movq %rax, %rdi
xorl %esi, %esi
callq 0x4280
leaq 0x200(%rsp), %rdi
movl $0x400, %edx            # imm = 0x400
xorl %esi, %esi
callq 0x4280
movq %rsp, %rbx
movl $0x200, %edx            # imm = 0x200
movq %rbx, %rdi
xorl %esi, %esi
callq 0x4280
callq 0x2a352
leaq 0x4aec2(%rip), %rdx     # 0x74fc6
movl $0x200, %esi            # imm = 0x200
movq %rbx, %rdi
movq %rax, %rcx
xorl %eax, %eax
callq 0x4890
leaq 0x4aeb0(%rip), %rdi     # 0x74fcd
callq 0x45d0
testq %rax, %rax
jne 0x2a138
leaq 0x4aea3(%rip), %rdi     # 0x74fd1
callq 0x45d0
testq %rax, %rax
je 0x2a199
movq 0x68c51(%rip), %rdi     # 0x92d90
leaq 0x4c741(%rip), %rdx     # 0x76887
movl $0x400, %esi            # imm = 0x400
movq %rax, %rcx
xorl %eax, %eax
callq 0x4890
movq 0x68c34(%rip), %rcx     # 0x92d90
leaq 0x4ae73(%rip), %rdx     # 0x74fd6
leaq 0x200(%rsp), %rbx
pushq $0x2f
popq %r8
movq %rsp, %r9
movl $0x400, %esi            # imm = 0x400
movq %rbx, %rdi
xorl %eax, %eax
callq 0x4890
leaq 0x4ae55(%rip), %rsi     # 0x74fdd
movq %rbx, %rdi
callq 0x45b0
testq %rax, %rax
jne 0x2a275
movq 0x68bf0(%rip), %rax     # 0x92d90
movb $0x0, 0x4(%rax)
movl $0x706d742f, (%rax)     # imm = 0x706D742F
movq 0x68bdf(%rip), %rcx     # 0x92d90
leaq 0x4ae1e(%rip), %rdx     # 0x74fd6
leaq 0x200(%rsp), %rbx
pushq $0x2f
popq %r8
movq %rsp, %r9
movl $0x400, %esi            # imm = 0x400
movq %rbx, %rdi
xorl %eax, %eax
callq 0x4890
leaq 0x4ae00(%rip), %rsi     # 0x74fdd
movq %rbx, %rdi
callq 0x45b0
testq %rax, %rax
jne 0x2a275
movq 0x68b9b(%rip), %rcx     # 0x92d90
movabsq $0x706d742f7261762f, %rax # imm = 0x706D742F7261762F
movq %rax, (%rcx)
movb $0x0, 0x8(%rcx)
leaq 0x4adc9(%rip), %rdx     # 0x74fd6
leaq 0x200(%rsp), %rbx
pushq $0x2f
popq %r8
movq %rsp, %r9
movl $0x400, %esi            # imm = 0x400
movq %rbx, %rdi
xorl %eax, %eax
callq 0x4890
leaq 0x4adab(%rip), %rsi     # 0x74fdd
movq %rbx, %rdi
callq 0x45b0
testq %rax, %rax
jne 0x2a275
movq 0x68b4a(%rip), %rax     # 0x92d90
movb $0x0, (%rax)
leaq 0x200(%rsp), %rbx
movq %rsp, %rsi
movl $0x3ff, %edx            # imm = 0x3FF
movq %rbx, %rdi
callq 0x4240
leaq 0x4ad75(%rip), %rsi     # 0x74fdd
movq %rbx, %rdi
callq 0x45b0
testq %rax, %rax
je 0x2a2a7
movq %rax, %rdi
callq 0x2a2f8
leaq 0x200(%rsp), %rdi
callq 0x4990
pushq $0x7
popq %rdi
xorl %esi, %esi
callq 0xa419
movq 0x68af5(%rip), %rax     # 0x92d90
addq $0x600, %rsp            # imm = 0x600
popq %rbx
popq %r14
popq %rbp
retq
pushq $0x7
popq %rdi
xorl %esi, %esi
callq 0xa419
movl $0x4008, %edi           # imm = 0x4008
callq 0x4210
movq %rax, %rbx
leaq 0x4ad24(%rip), %rsi     # 0x74fe9
movq %rax, %rdi
xorl %eax, %eax
callq 0x2a3de
leaq 0x65a2a(%rip), %rsi     # 0x8fd00
movq 0x65cfb(%rip), %rdx     # 0x8ffd8
movq %rbx, %rdi
callq 0x4910
movq %rax, %r14
movq %rbx, %rdi
callq 0x4390
movq %r14, %rdi
callq 0x4950