// File: /workspace/github_cpp_makefile_star2_O3/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
movb 0x7261d(%rip), %al      # 0xa8aa8
testb %al, %al
je 0x36745
leaq 0x72226(%rip), %rdi     # 0xa86c0
callq 0x47a0
testb %bpl, %bpl
je 0x364c0
movq 0x748f5(%rip), %rdi     # 0xaada0
testq %rdi, %rdi
je 0x364b5
callq 0x4690
movq $0x0, 0x748e0(%rip) # 0xaada0
movq 0x748d9(%rip), %r14     # 0xaada0
testq %rbx, %rbx
je 0x36509
testq %r14, %r14
jne 0x364e5
movl $0x400, %edi            # imm = 0x400
callq 0x4040
movq %rax, %r14
movq %rax, 0x748bb(%rip)     # 0xaada0
movl $0x400, %edx            # imm = 0x400
movq %r14, %rdi
xorl %esi, %esi
callq 0x4290
movl $0x3ff, %edx            # imm = 0x3FF
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4240
jmp 0x3671c
testq %r14, %r14
jne 0x3671c
movl $0x400, %edi            # imm = 0x400
callq 0x4040
movq %rax, 0x7487d(%rip)     # 0xaada0
movl $0x400, %edx            # imm = 0x400
movq %rax, %rdi
xorl %esi, %esi
callq 0x4290
leaq 0x200(%rsp), %rdi
movl $0x400, %edx            # imm = 0x400
xorl %esi, %esi
callq 0x4290
movq %rsp, %rbx
movl $0x200, %edx            # imm = 0x200
movq %rbx, %rdi
xorl %esi, %esi
callq 0x4290
callq 0x36803
leaq 0x58ae2(%rip), %rdx     # 0x8f046
movl $0x200, %esi            # imm = 0x200
movq %rbx, %rdi
movq %rax, %rcx
xorl %eax, %eax
callq 0x4890
leaq 0x58ad0(%rip), %rdi     # 0x8f04d
callq 0x45f0
testq %rax, %rax
jne 0x36598
leaq 0x58ac3(%rip), %rdi     # 0x8f051
callq 0x45f0
testq %rax, %rax
je 0x365fb
movq 0x74801(%rip), %rdi     # 0xaada0
leaq 0x5a38b(%rip), %rdx     # 0x90931
movl $0x400, %esi            # imm = 0x400
movq %rax, %rcx
xorl %eax, %eax
callq 0x4890
movq 0x747e4(%rip), %rcx     # 0xaada0
leaq 0x58a93(%rip), %rdx     # 0x8f056
leaq 0x200(%rsp), %rbx
movq %rsp, %r9
movl $0x400, %esi            # imm = 0x400
movq %rbx, %rdi
movl $0x2f, %r8d
xorl %eax, %eax
callq 0x4890
leaq 0x58a73(%rip), %rsi     # 0x8f05d
movq %rbx, %rdi
callq 0x45d0
testq %rax, %rax
jne 0x366db
movq 0x7479e(%rip), %rax     # 0xaada0
movb $0x0, 0x4(%rax)
movl $0x706d742f, (%rax)     # imm = 0x706D742F
movq 0x7478d(%rip), %rcx     # 0xaada0
leaq 0x58a3c(%rip), %rdx     # 0x8f056
leaq 0x200(%rsp), %rbx
movq %rsp, %r9
movl $0x400, %esi            # imm = 0x400
movq %rbx, %rdi
movl $0x2f, %r8d
xorl %eax, %eax
callq 0x4890
leaq 0x58a1c(%rip), %rsi     # 0x8f05d
movq %rbx, %rdi
callq 0x45d0
testq %rax, %rax
jne 0x366db
movq 0x74747(%rip), %rcx     # 0xaada0
movabsq $0x706d742f7261762f, %rax # imm = 0x706D742F7261762F
movq %rax, (%rcx)
movb $0x0, 0x8(%rcx)
leaq 0x589e5(%rip), %rdx     # 0x8f056
leaq 0x200(%rsp), %rbx
movq %rsp, %r9
movl $0x400, %esi            # imm = 0x400
movq %rbx, %rdi
movl $0x2f, %r8d
xorl %eax, %eax
callq 0x4890
leaq 0x589c5(%rip), %rsi     # 0x8f05d
movq %rbx, %rdi
callq 0x45d0
testq %rax, %rax
jne 0x366db
movq 0x746f4(%rip), %rax     # 0xaada0
movb $0x0, (%rax)
leaq 0x200(%rsp), %rbx
movq %rsp, %rsi
movl $0x3ff, %edx            # imm = 0x3FF
movq %rbx, %rdi
callq 0x4240
leaq 0x5898f(%rip), %rsi     # 0x8f05d
movq %rbx, %rdi
callq 0x45d0
testq %rax, %rax
je 0x36756
movq 0x718c6(%rip), %rcx     # 0xa7fa8
cmpq %rax, (%rcx)
je 0x3670f
movq 0x7189a(%rip), %rcx     # 0xa7f88
cmpq %rax, (%rcx)
je 0x3670f
movq %rax, %rdi
callq 0x4550
testl %eax, %eax
je 0x3670f
leaq 0x588f6(%rip), %rdi     # 0x8effc
movl %eax, %esi
xorl %eax, %eax
callq 0xbb10
leaq 0x200(%rsp), %rdi
callq 0x49b0
movb 0x72386(%rip), %al      # 0xa8aa8
testb %al, %al
je 0x3674f
leaq 0x71f93(%rip), %rdi     # 0xa86c0
callq 0x43f0
movq 0x74667(%rip), %rax     # 0xaada0
addq $0x600, %rsp            # imm = 0x600
popq %rbx
popq %r14
popq %rbp
retq
callq 0x5392
jmp 0x36493
callq 0x53e2
jmp 0x36726
movl $0x7, %edi
xorl %esi, %esi
callq 0xc83f
movl $0x4008, %edi           # imm = 0x4008
callq 0x4210
movq %rax, %rbx
leaq 0x588f3(%rip), %rsi     # 0x8f069
movq %rax, %rdi
xorl %eax, %eax
callq 0x36908
leaq 0x71569(%rip), %rsi     # 0xa7cf0
movq 0x71842(%rip), %rdx     # 0xa7fd0
movq %rbx, %rdi
callq 0x4910
movq %rax, %r14
movq %rbx, %rdi
callq 0x43c0
movq %r14, %rdi
callq 0x4960