// File: /workspace/github_cpp_makefile_star2_O1/kallaballa[P]PixelStencil/./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(st_path,1024,"%s",p); \
        cimg_snprintf(tmp,sizeof(tmp),"%s%c%s",st_path,cimg_file_separator,filetmp); \
        if ((file=std::fopen(tmp,"wb"))!=0) { cimg::fclose(file); std::remove(tmp); path_found = true; } \
      }
      static char *st_path = 0;
      if (reinit_path) { delete[] st_path; st_path = 0; }
      if (user_path) {
        if (!st_path) st_path = new char[1024];
        std::memset(st_path,0,1024);
        std::strncpy(st_path,user_path,1023);
      } else if (!st_path) {
        st_path = new char[1024];
        std::memset(st_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) {
          *st_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)
          throw CImgIOException("cimg::temporary_path(): Failed to locate path for writing temporary files.\n");
      }
      return st_path;
    }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x600, %rsp            # imm = 0x600
movq %rdi, %rbx
testl %esi, %esi
je 0x9599
movq 0x30d8c(%rip), %rdi     # 0x3a310
testq %rdi, %rdi
je 0x958e
callq 0x3380
movq $0x0, 0x30d77(%rip) # 0x3a310
movq 0x30d70(%rip), %rax     # 0x3a310
testq %rbx, %rbx
je 0x95e6
testq %rax, %rax
jne 0x95bb
movl $0x400, %edi            # imm = 0x400
callq 0x3040
movq %rax, 0x30d55(%rip)     # 0x3a310
movq 0x30d4e(%rip), %r14     # 0x3a310
movl $0x400, %edx            # imm = 0x400
movq %r14, %rdi
xorl %esi, %esi
callq 0x3150
movl $0x3ff, %edx            # imm = 0x3FF
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3120
jmp 0x98e6
testq %rax, %rax
jne 0x98e6
movl $0x400, %edi            # imm = 0x400
callq 0x3040
movq %rax, 0x30d10(%rip)     # 0x3a310
movl $0x400, %edx            # imm = 0x400
movq %rax, %rdi
xorl %esi, %esi
callq 0x3150
leaq 0x200(%rsp), %rdi
movl $0x400, %edx            # imm = 0x400
xorl %esi, %esi
callq 0x3150
movq %rsp, %rbx
movl $0x200, %edx            # imm = 0x200
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3150
callq 0x9a8e
leaq 0x2453b(%rip), %rdx     # 0x2db7c
movl $0x200, %esi            # imm = 0x200
movq %rbx, %rdi
movq %rax, %rcx
xorl %eax, %eax
callq 0x3460
leaq 0x24529(%rip), %rdi     # 0x2db83
callq 0x3360
testq %rax, %rax
jne 0x9670
leaq 0x2451c(%rip), %rdi     # 0x2db87
callq 0x3360
testq %rax, %rax
je 0x9720
movq 0x30c90(%rip), %rdi     # 0x3a310
leaq 0x25ffa(%rip), %rdx     # 0x2f681
xorl %ebp, %ebp
movl $0x400, %esi            # imm = 0x400
movq %rax, %rcx
xorl %eax, %eax
callq 0x3460
movq 0x30c71(%rip), %rcx     # 0x3a310
leaq 0x244e6(%rip), %rdx     # 0x2db8c
leaq 0x200(%rsp), %rbx
movq %rsp, %r9
movl $0x400, %esi            # imm = 0x400
movq %rbx, %rdi
movl $0x2f, %r8d
xorl %eax, %eax
callq 0x3460
leaq 0x244c6(%rip), %rsi     # 0x2db93
movq %rbx, %rdi
callq 0x3350
testq %rax, %rax
je 0x9722
movq 0x308df(%rip), %rcx     # 0x39fc0
cmpq %rax, (%rcx)
je 0x970e
movq 0x308ab(%rip), %rcx     # 0x39f98
cmpq %rax, (%rcx)
je 0x970e
movq %rax, %rdi
callq 0x32b0
testl %eax, %eax
je 0x970e
leaq 0x2440f(%rip), %rdi     # 0x2db14
movl %eax, %esi
xorl %eax, %eax
callq 0x9991
leaq 0x200(%rsp), %rdi
callq 0x34f0
movb $0x1, %bpl
jmp 0x9722
xorl %ebp, %ebp
testb %bpl, %bpl
jne 0x97c2
movq 0x30bde(%rip), %rax     # 0x3a310
movb $0x0, 0x4(%rax)
movl $0x706d742f, (%rax)     # imm = 0x706D742F
movq 0x30bcd(%rip), %rcx     # 0x3a310
leaq 0x24442(%rip), %rdx     # 0x2db8c
leaq 0x200(%rsp), %rbx
movq %rsp, %r9
movl $0x400, %esi            # imm = 0x400
movq %rbx, %rdi
movl $0x2f, %r8d
xorl %eax, %eax
callq 0x3460
leaq 0x24422(%rip), %rsi     # 0x2db93
movq %rbx, %rdi
callq 0x3350
testq %rax, %rax
je 0x97c2
movq 0x3083b(%rip), %rcx     # 0x39fc0
cmpq %rax, (%rcx)
je 0x97b2
movq 0x30807(%rip), %rcx     # 0x39f98
cmpq %rax, (%rcx)
je 0x97b2
movq %rax, %rdi
callq 0x32b0
testl %eax, %eax
je 0x97b2
leaq 0x2436b(%rip), %rdi     # 0x2db14
movl %eax, %esi
xorl %eax, %eax
callq 0x9991
leaq 0x200(%rsp), %rdi
callq 0x34f0
movb $0x1, %bpl
testb %bpl, %bpl
jne 0x9862
movq 0x30b3e(%rip), %rcx     # 0x3a310
movabsq $0x706d742f7261762f, %rax # imm = 0x706D742F7261762F
movq %rax, (%rcx)
movb $0x0, 0x8(%rcx)
leaq 0x243a2(%rip), %rdx     # 0x2db8c
leaq 0x200(%rsp), %rbx
movq %rsp, %r9
movl $0x400, %esi            # imm = 0x400
movq %rbx, %rdi
movl $0x2f, %r8d
xorl %eax, %eax
callq 0x3460
leaq 0x24382(%rip), %rsi     # 0x2db93
movq %rbx, %rdi
callq 0x3350
testq %rax, %rax
je 0x9862
movq 0x3079b(%rip), %rcx     # 0x39fc0
cmpq %rax, (%rcx)
je 0x9852
movq 0x30767(%rip), %rcx     # 0x39f98
cmpq %rax, (%rcx)
je 0x9852
movq %rax, %rdi
callq 0x32b0
testl %eax, %eax
je 0x9852
leaq 0x242cb(%rip), %rdi     # 0x2db14
movl %eax, %esi
xorl %eax, %eax
callq 0x9991
leaq 0x200(%rsp), %rdi
callq 0x34f0
movb $0x1, %bpl
testb %bpl, %bpl
jne 0x98e1
movq 0x30aa2(%rip), %rax     # 0x3a310
movb $0x0, (%rax)
leaq 0x200(%rsp), %rbx
movq %rsp, %rsi
movl $0x3ff, %edx            # imm = 0x3FF
movq %rbx, %rdi
callq 0x3120
leaq 0x24303(%rip), %rsi     # 0x2db93
movq %rbx, %rdi
callq 0x3350
testq %rax, %rax
je 0x98e1
movq 0x3071c(%rip), %rcx     # 0x39fc0
cmpq %rax, (%rcx)
je 0x98d1
movq 0x306e8(%rip), %rcx     # 0x39f98
cmpq %rax, (%rcx)
je 0x98d1
movq %rax, %rdi
callq 0x32b0
testl %eax, %eax
je 0x98d1
leaq 0x2424c(%rip), %rdi     # 0x2db14
movl %eax, %esi
xorl %eax, %eax
callq 0x9991
leaq 0x200(%rsp), %rdi
callq 0x34f0
movb $0x1, %bpl
testb %bpl, %bpl
je 0x98f9
movq 0x30a23(%rip), %rax     # 0x3a310
addq $0x600, %rsp            # imm = 0x600
popq %rbx
popq %r14
popq %rbp
retq
movl $0x4008, %edi           # imm = 0x4008
callq 0x3110
movq %rax, %rbx
leaq 0x24292(%rip), %rsi     # 0x2db9f
movq %rax, %rdi
xorl %eax, %eax
callq 0x8558
leaq 0x3038a(%rip), %rsi     # 0x39ca8
movq 0x306b3(%rip), %rdx     # 0x39fd8
movq %rbx, %rdi
callq 0x34b0
movq %rax, %r14
movq %rbx, %rdi
callq 0x31e0
movq %r14, %rdi
callq 0x34d0